• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Breaking
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Breaking


  • Subject: Re: Breaking
  • From: Mike Ferris <email@hidden>
  • Date: Tue, 17 Dec 2002 08:47:55 -0800

You can just break on -[NSException raise] if you want to stop at any exception.

In PB, go to the breakpoints tab, hit the "New" button and type "-[NSException raise]" as the value for the new symbolic breakpoint.

I usually have one of these breakpoints permanently in all my projects.

Mike


Begin forwarded message:

From: matt neuburg <email@hidden>
Date: Tue Dec 17, 2002 7:35:12 AM US/Pacific
To: Timothy Larkin <email@hidden>
Cc: email@hidden
Subject: Re: Breaking

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.
_______________________________________________
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.

  • Prev by Date: Re: NSTableView - Alternating blue and white background
  • Next by Date: Re: NSTextField sizing to fit
  • Previous by thread: Re: Breaking
  • Next by thread: NSDistantObject error
  • Index(es):
    • Date
    • Thread