Re: objc_exception_throw
Re: objc_exception_throw
- Subject: Re: objc_exception_throw
- From: Jean-Daniel Dupas <email@hidden>
- Date: Mon, 30 Jun 2008 16:02:39 +0200
Le 30 juin 08 à 15:54, Brian Stern a écrit :
On Jun 30, 2008, at 3:59 AM, Joan Lluch (casa) wrote:
The exception that is thrown is a simple out of range access to an
NSArray, which does not crash or hangs the app, so I am still more
confused about it. I tend to think that the problem must be
related to some misconfiguration of XCode or the debugger. By
setting lots of breakpoints in my app I figured out that the origin
of the problem is in the observeValueForKeyPath method of one of my
controller objects, but again, breakpoints set in that method do
not show any stack trace at all. Please help !
You can use Activity Monitor to get a stack trace when you are
stopped at a breakpoint in the debugger also.
To do this:
Launch Activity Monitor
Select your app that is stopped at a breakpoint in the debugger in
the list of processes
Choose Inspect Process (cmd-I)
Click the Sample button
You will see all the stack traces for your application in the Sample
window.
I think the explanation for why gdb sometimes fails to give a stack
trace and why Activity Monitor does give a useful stack trace is
because of how the two apps build their stack traces.
I am guessing from the name of the backtrace command that gdb walks
the stack from the leaf function to the stack root. This is how the
bt is displayed: from leaf to root - top to bottom, both in the
console and in the Xcode debugger.
I guess that Activity Monitor walks the stack from the root to the
leaf function. This is how it's displayed in the sample window:
root to leaf - top to bottom.
As Chris mentioned if the stack is corrupted gdb may not be able to
give a stack trace. gdb gives up and doesn't display more than one
or two functions, starting at the leaf function. gdb's method is
fragile and unfortunately breaks when the developer needs it most.
I don't know why gdb doesn't step into some functions but I'll guess
that it's also related to the OP's application corrupting the stack.
Note that you can also use the "sample" command line tool (see man
sample for details). That's what the Activity monitor does under the
hood (and it's usefull when you have to debug from an ssh session ;-)
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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