Re: Immediate Nib Loading Error
Re: Immediate Nib Loading Error
- Subject: Re: Immediate Nib Loading Error
- From: Ken Thomases <email@hidden>
- Date: Tue, 6 Jan 2009 22:38:56 -0600
On Jan 6, 2009, at 2:55 AM, Kyle Sluder wrote:
On Fri, Jan 2, 2009 at 3:13 PM, Steve Cronin <email@hidden>
wrote:
The stack at the crash is below.
In the debugger (XC3.1) I enter 'frame 9' and then do a 'po *(id*)
($ebp+16)' to see what the offending object is but I just get "No
symbol
"id" in current context."
I must be mis-remembering how to access arguments to the registers...
You shouldn't need to typecast it to id (it's a po statement after
all), and the value on the stack is going to be an id, not an id*. If
you're on i386, self is at EBP[8] anyway (I'm unfamiliar with the
x86_64 calling convention). Did you try just `po ($ebp+8)`?
The value on the stack is an id rather than an id*, but the expression
$ebp+8 isn't the value on the stack, it's the address of the value on
the stack. That's why one casts it to id*.
On Jan 6, 2009, at 3:04 AM, Kyle Sluder wrote:
Correction, self is at EBP[4]. But you're probably interested in the
first parameter to the method, not the NSIBObjectData object, so you
want EBP[12] (self at EBP[4], cmd at EBP[8], first arg at EBP[12],
...).
This is not correct, generally. Typically, gdb breaks into functions
after their frame pointer has been set up. At that time, $ebp points
to the old frame pointer, $ebp+4 points to the return address, $ebp+8
points to the first parameter (self for Obj-C methods), $ebp+12 is the
second parameter (cmd), and $ebp+16 is the third parameter, etc.
I have seen gdb refuse to recognize the "id" symbol when debugging a
program compiled without debugging symbols (or stripped of them). You
can substitute "void*" for "id" in many cases. For example: po
*(void**)($ebp+8)
Cheers,
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