Re: Opposite of "step out"
Re: Opposite of "step out"
- Subject: Re: Opposite of "step out"
- From: Ken Thomases <email@hidden>
- Date: Thu, 9 Oct 2008 17:50:45 -0500
On Oct 9, 2008, at 5:28 PM, Hamish Allan wrote:
Thanks for your reply.
You're welcome.
On Thu, Oct 9, 2008 at 11:13 PM, Ken Thomases <email@hidden>
wrote:
To break on any method invocation, you would put a breakpoint on
objc_msgSend and its variants.
Having done this, I need to step past another 20 or 30 asm
instructions to get to the point where the debugger actually tells me
which method has been called. I don't suppose there's a shortcut to
this?
Well, you can find the instruction(s) within objc_msgSend where it
"jmp"s to the method implementation. You can add a breakpoint there
and remove the breakpoint from the objc_msgSend entry point. Then,
you can use the "command" command to set commands to execute when the
new breakpoint fires. You can use something like:
(gdb) command
> silent
> si
> end
That will silently break on the jmp, step into the jmp and therefore
the method implementation, and stop there.
Depending on what you're trying to accomplish, just for
completeness' sake,
you might want to look into DTrace and the objc provider. Using
that, you
can trace all method calls matching certain patterns.
That sounds interesting -- I'll look into this!
Here's a quick example:
sudo dtrace -F -n 'objc$target:MyClass*::entry, objc
$target:MyClass*::return {}' -p <pid>
Good luck,
Ken
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden