[MacRuby-devel] dtrace doesn't get sourcefile and line numbers
Gabriel Ayuso
gabriel at gabrielayuso.com
Sat Feb 19 11:05:41 PST 2011
I ran a dtrace script on the MacRuby samples to print all the info provided to the method_entry probe.
The sourcefile was always either empty or "core" and the linenumber was always 0.
Do I have to execute the script in some particular way for this information to be received?
SCRIPT:
-------------
#!/usr/sbin/dtrace -s
#pragma D option quiet
BEGIN
{
printf("Target pid: %d\n\n", $target);
}
macruby$target:::method-entry
{
printf("Class name: %s, Method name %s, Source file %s, Line number %d\n", copyinstr(arg0), copyinstr(arg1), copyinstr(arg2), arg3);
}
COMMAND:
-------------
sudo dtrace -s call_info.d -c ../build/AnimatingViews.app/Contents/MacOS/AnimatingViews
OUTPUT:
-------------
Class name: DemoView, Method name randf:, Source file , Line number 0
Class name: DemoView, Method name rand:, Source file , Line number 0
Class name: Float, Method name to_int, Source file core, Line number 0
Class name: Class, Method name new:, Source file , Line number 0
Class name: CGPoint, Method name x, Source file , Line number 0
Class name: CGPoint, Method name y, Source file , Line number 0
Class name: Fixnum, Method name to_i, Source file , Line number 0
Thanks,
Gabriel Ayuso
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20110219/0f8fd2e0/attachment.html>
More information about the MacRuby-devel
mailing list