Re: objc_exception_throw (solved)
Re: objc_exception_throw (solved)
- Subject: Re: objc_exception_throw (solved)
- From: Chris Espinosa <email@hidden>
- Date: Mon, 30 Jun 2008 22:57:35 -0700
On Jun 30, 2008, at 1:06 PM, Joan Lluch (casa) wrote: 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.
What you're missing is that exception handling across the ObjectiveC-C++ boundary is much like rocket science. In nonexceptional cases, ObjC++ debugging is fairly straightforward. 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?
It can, except when exceptions are thrown across the ObjC-C++ boundary, at which point very special measures must be taken [1]. To avoid that, try to make sure that C++ exceptions are caught in C++ code and Objective-C exceptions are caught in Objective-C code, and things will be a lot saner.
|
_______________________________________________
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