Re: objc_exception_throw (solved)
Re: objc_exception_throw (solved)
- Subject: Re: objc_exception_throw (solved)
- From: "Joan Lluch (casa)" <email@hidden>
- Date: Mon, 30 Jun 2008 22:06:42 +0200
El 30/06/2008, a las 16:02, Jean-Daniel Dupas escribió:
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.
[...]
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 ;-)
After a lot of testing (including running the app in another mac with
a fresh installation of XCode), I finally figured out what was the
cause of the problem. And you can guess that it is the stupidest thing
on Earth. Now both the stack call trace and "step over" are doing just
as expected.
Thanks to all for your extensive support and useful tips that I have
been able to know thanks to you. Activity monitor is a gem. I didn't
know that and It helped me to find the source of the out of range
exception. (Which I fixed *before* I figured out my problem with the
debugger)
So well, the problem was that some time ago I had set several of my
source files to "Objective C++" (by changing their extension to .mm)
in order to use the new/delete operators. By renaming back the files
to .m and using malloc/sizeof/free instead all the problems went away.
In fact, the calls the debugger refused to trace, were precisely the
ones where a language change occurred. This included calls from my
code to the frameworks, and I suppose that "step over" was also
failing because of this.
Now, after having learned a lot in the process, a remaining question
arises: The developer-tools documentation carelessly states that you
can use Objective-C and Objective-C++ as you want with no
restrictions, with no mention of the dramatic consequences that doing
so will have on your ability to debug your code. Unless I am missing
something, of course.
So my question is: Is it possible to compile a project as Objective-C+
+, and being able to tell somehow the compiler/debugger that it should
use the appropriate workarounds (or measures) so that the debugger
could actually be used? After all, activity monitor is able to show a
complete stack call trace even in that mixed-C-dialect context. So why
not the debugger?
Thanks again to you all. _______________________________________________
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