On Nov 2, 2011, at 1:18 PM, Matt Neuburg <m...@tidbits.com> wrote: > > On Nov 2, 2011, at 9:55 AM, Ben Kennedy wrote: > >> On 02 Nov 2011, at 8:22 am, Matt Neuburg wrote: >> >>> On Nov 2, 2011, at 3:39 AM, Kyle Sluder wrote: >>> >>>> I have to ask why you're printing $eax >>> >>> You tell me. I'm doing it because Ben Kennedy and a bunch of Web sites >>> (after a Google search) told me to. m. >> >> And I'll tell you why I did: after being baffled for awhile why my app was >> crashing with no console messages (and Xcode showing me main.c), I decided >> to manually set breakpoints on objc_exception_throw and -[NSException >> raise], hoping that would give me a reasonable chance of actually seeing, >> you know, the exception that crashed my app. Of course "po self" doesn't >> work there, so I crudely began po'ing every CPU register (not knowing much >> at all about ABI conventions) until I happened on a message that resembled >> the description string I was expecting. That happened to be eax in the >> simulator, and r0 on the device. > > And it does work as advertised (though only, in my tests, when the debugger > is LLDB).
I think the only reason it's working for you is a fluke. LLDB might have stopped at the wrong address, one instruction past the function prologue. I would imagine that objc_exception_throw would rather quickly load the argument into a register. Or perhaps $eax happens to be loaded with the exception when the function is called, but because $eax is not preserved across function calls gdb uses it as a scratch register when breaking into your code, while LLDB uses other registers. Or I could be totally missing something about the exception ABI. I just wouldn't trust LLDB for anything at this point, after watching my coworkers fight it. --Kyle Sluder_______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com