• 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
Breakpoint on @throw?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Breakpoint on @throw?


  • Subject: Breakpoint on @throw?
  • From: Aaron Hillegass <email@hidden>
  • Date: Mon, 17 Jan 2005 12:23:32 -0500

Raising old-style exceptions looked like this:

if (x == 13) {
NSException *badness = [NSException exceptionWithName:@"BadLuckException"
reason:@"13 is unlucky"
userInfo:nil];
[badness raise];
}


So, to stop on exceptional conditions in gdb, I'd create a breakpoint:

> fb - [NSException raise]

This works great, but with new style exceptions the raise becomes an @throw:

if (x == 13) {
NSException *badness = [NSException exceptionWithName:@"BadLuckException"
reason:@"13 is unlucky"
userInfo:nil];
@throw badness;
}
(Don't forget "-fobjc-exceptions" when you build.)


Does anyone know how to put a breakpoint on @throw?  Thanks.

- Aaron Hillegass
Big Nerd Ranch, Inc
http://www.bignerdranch.com/

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Breakpoint on @throw?
      • From: Steven Kramer <email@hidden>
  • Prev by Date: Re: Inserting text
  • Next by Date: long long
  • Previous by thread: Encoding
  • Next by thread: Re: Breakpoint on @throw?
  • Index(es):
    • Date
    • Thread