Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / CodeWarrior / January 2005



Tip: Looking for answers? Try searching our database.

CW9: catching Cocoa/AppKit objective-C exceptions in debugger

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mark Alldritt - 19 Jan 2005 19:17 GMT
Hi,

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?

Cheers
-Mark
Sean McBride - 27 Jan 2005 03:28 GMT
> 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?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.