Immediate Nib Loading Error
-
Folks;
I'm getting an immediate crash, before I can get anything written into
a log (before any class +iniitialize).
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...
There are NO non Cocoa objects in the visual display of the
MainMenu.nib in IB3 (8 - NSCustomObject).
What are all the '??' in this stack? (3-7) And what are the 2 at the
lowest level? (16-17)
Any thoughts on how to go about debugging this?
Thanks for any help!,
Steve
#0 0x90347e17 in objc_exception_throw
#1 0x96e90199 in _PFManagedObject_coerceValueForKeyWithDescription
#2 0x96eaa5aa in -[NSManagedObject setPrimitiveValue:forKey:]
#3 0x00094b01 in ??
#4 0x00092666 in ??
#5 0x00091e26 in ??
#6 0x000182f3 in ??
#7 0x0000784b in ??
#8 0x9270de73 in -[NSCustomObject nibInstantiate]
#9 0x926ee865 in -[NSIBObjectData instantiateObject:]
#10 0x926edf86 in -[NSIBObjectData
nibInstantiateWithOwner:topLevelObjects:]
#11 0x926e4686 in loadNib
#12 0x926e3fe8 in +[NSBundle(NSNibLoading)
_loadNibFile:nameTable:withZone:ownerBundle:]
#13 0x926e3c2b in +[NSBundle(NSNibLoading)
loadNibFile:externalNameTable:withZone:]
#14 0x926e3b69 in +[NSBundle(NSNibLoading) loadNibNamed:owner:]
#15 0x926e3818 in NSApplicationMain
#16 0x0000227a in ??
#17 0x000021a1 in ?? -
On Fri, Jan 2, 2009 at 3:13 PM, Steve Cronin <steve_cronin...> wrote:
> I'm getting an immediate crash, before I can get anything written into a log
> (before any class +iniitialize).
Have you tried +load?
> 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)`?
> Any thoughts on how to go about debugging this?
My first step would be to let execution continue so that you can see
what exception is being thrown. Breaking on objc_exception_throw
doesn't do a good job of telling you what the exception is.
--Kyle Sluder -
On Tue, Jan 6, 2009 at 3:55 AM, Kyle Sluder <kyle.sluder...> wrote:
> you're on i386, self is at EBP[8] anyway (I'm unfamiliar with the
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],
...).
--Kyle Sluder -
On Jan 6, 2009, at 3:55 AM, Kyle Sluder wrote:
> If
> you're on i386, self is at EBP[8] anyway (I'm unfamiliar with the
> x86_64 calling convention).
It's pretty complicated, and documented here in case anyone is
wondering: <http://www.x86-64.org/documentation/abi.pdf>
In this case, the X86-64 equivalent of $ebp+8 would be $rdi.
> Did you try just `po ($ebp+8)`?
In 32-bit Intel programs, I always use "po *(int *)($ebp+8)" to print
the value of the first argument when it is a pointer to an ObjC
object, and it works for me.
Nick Zitzmann
<http://www.chronosnet.com/>



