Re: Getting the arguments of methods in other frameworks (from GDB)
Re: Getting the arguments of methods in other frameworks (from GDB)
- Subject: Re: Getting the arguments of methods in other frameworks (from GDB)
- From: Andre <email@hidden>
- Date: Tue, 13 Dec 2005 23:32:03 -0800
On 平成 17/12/13, at 22:22, Andrew Farmer wrote:
On 13 Dec 05, at 16:32, Andre wrote:
Dave Hayden wrote:
On Dec 12, 2005, at 12:34 PM, email@hidden wrote:
As an example in : -[NSNotificationCenter
postNotificationName:object:userInfo:]
I want to get the args passed to this method, but I cant... even
with the debug version of appkit.
On PPC machines, you can find everything in the registers: r3
contains the "self" pointer, r4 is the current selector (as a
SEL, which is a char*), and the arguments are stored in r5 and
up. So here, you could do "po $r5" in gdb to get the selector
name or "po $r7" to see the userInfo dict.
Yea, but doesn't this only give me what's at the top of the call
stack? The current frame?
That's correct; $rN will only give you the current value. However,
there isn't really much that you can do about it.
As soon as a routine is called, it has _carte blanche_ to do
whatever it wants with register arguments. Some routines will save
some of them on the stack for later. Some will discard or stomp on
register arguments instantly. And there's no way that gdb can
reasonably keep track of these arguments, or tell where they're
being kept.
I wonder if at least in debug mode GDB cant keep track of the
arguments until the end of the event loop?
At least a textual representation of the arguments... would help.
Would it be worth a bug (enhancement) report?
Thanks BTW.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden