Re: Xcode/gdb and Objective-C runtime errors/warnings
Re: Xcode/gdb and Objective-C runtime errors/warnings
- Subject: Re: Xcode/gdb and Objective-C runtime errors/warnings
- From: Tommy Nordgren <email@hidden>
- Date: Sun, 19 Aug 2007 12:25:41 +0200
On 19 aug 2007, at 05.22, Phil wrote:
Perfect! It did exactly what I was looking for.
Thanks,
Phil
There is another trick you might also find useful:
If the method in question is not defined in NSObject, then you can
add it to NSObject
via a category.
In the method write this first:
-(float) floatValue
{
#ifdef DEBUG
Debugger(); /* Will break into gdb */
#endif
after this code, you can add code to throw an exception if you want to.
Note that you will need to link against the Carbon framework for this
to work.
On Aug 18, 2007, at 10:27 PM, Clark Cox wrote:
If you set breakpoints at: "-[NSException raise]" and
"objc_exception_throw", the debugger should stop when any such
exception is raised.
On 8/18/07, Phil <email@hidden> wrote:
I've introduced a problem somewhere in my code but am having a
bit of
trouble tracking it down so I was wondering: is it possible to have
Obj-C runtime errors/warnings drop me into the debugger at the
offending code? In my case, I'm attempting to call [NSNull
floatValue] which of course won't work and results in
an ...unrecognized selector sent to... message. Is there a flag
that
would treat this as an error and drop me into the debugger when this
happens?
--
Clark S. Cox III
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40comhem.se
This email sent to email@hidden
-----------------------------------------------------
An astronomer to a colleague:
-I can't understsnad how you can go to the brothel as often as you
do. Not only is it a filthy habit, but it must cost a lot of money too.
-Thats no problem. I've got a big government grant for the study of
black holes.
Tommy Nordgren
email@hidden
_______________________________________________
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