Re: Breaking
Re: Breaking
- Subject: Re: Breaking
- From: matt neuburg <email@hidden>
- Date: Tue, 17 Dec 2002 07:35:12 -0800
On Sat, 14 Dec 2002 09:17:36 -0500, Timothy Larkin <email@hidden> said:
>
I am trying to find the Cocoa equivalent of DebugStr() that will evoke
>
the debugger dynamically when some assertion fails. I can raise an
>
exception, but the exception mechanism, as far as I can tell, cannot
>
invoke the debugger.
First, you have to be debugging in order to stop at a breakpoint (not like OS 9 where you can just fall into MacsBug regardless).
Okay, so the only place you can break is at a breakpoint that you've explicitly set in gdb. So the problem is where to put a breakpoint such that it will be reached on every exception. Here's one way:
@implementation NSApplication (exceptionCatcher)
- (void)reportException:(NSException *)e {
// put a breakpoint here
}
@end
m.
matt neuburg, phd = email@hidden,
http://www.tidbits.com/matt
pantes anthropoi tou eidenai oregontai phusei
Subscribe to TidBITS! It's free and smart.
http://www.tidbits.com/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.