> I'm trying to trap the source of an Objective-C exception generated from
> within Cocoa/AppKit. Is there a way to do this in the CodeWarrior 9
> debugger?
<http://www.cocoadev.com/index.pl?DebuggingTechniques> near the bottom:
"If you are using the Codewarrior debugger instead of XCode, it's not
obvious how to drop into the debugger on an exception. You can create a
category on NSException to always drop into the debugger and go back up
in the stack to see what happened. Unfortunately, since you are
replacing the 'raise' method, you won't see the helpful message that
gets printed to the log. Does anyone know a better way to get the
Codewarrior Debugger to break and still print the helpful log
information?
@implementation NSException (StopOnException ? )
-(void)raise
{
assert (0);
}
@end
You could just add NSLog(@"%@", self); before your assert"
Maybe calling [super raise] would also be good? I wonder if setting a
future breakpoint in your .gdbinit file would be picked up by the CW
debugger?