• 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: c++ exceptions causing abort
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

re: c++ exceptions causing abort


  • Subject: re: c++ exceptions causing abort
  • From: Keith Ray <email@hidden>
  • Date: Mon, 13 Dec 2004 11:39:19 -0800

You could write code to translate C++ exceptions into Cocoa exceptions
and vice versa, and someone already has done a lot of work for this...
see "Membrane Library" at
http://www.umbar.com/membrane/

> Message: 2
> Date: Mon, 13 Dec 2004 16:09:29 +0000
> From: Benjohn <email@hidden>
> Subject: c++ exceptions causing abort
> To: Cocoa Dev <email@hidden>
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset=US-ASCII; format=flowed
>
> Our application uses some cross platform c++ code that can throw c++
> exceptions. We would like to catch otherwise unhandled c++ exceptions
> close to the main event loop, and display a suitable error dialogue.
> This seems like it should be reasonably easy to do by using a custom
> NSApplication that replaces some methods with calls to  the super
> object wrapped in a try catch block.
>
> Having tried this though, it doesn't work. We have found that if a c++
> throw and its catch are separated by App Kit or Foundation functions,
> the catch handler isn't called, and instead the program aborts.
>
> ie:
>
>         Our c++ code                    - throw occurs here.
>         Our c++ code
>         Our c++ code
>         App Kit / Foundation
>         App Kit / Foundation
>         App Kit / Foundation
>         App Kit / Foundation
>         Our handler                     - catch here doesn't work.
>         App Kit / Foundation
>         App Kit / Foundation
>         Root of the stack
>
> We have a small project that will reproduce this.
>
> We're getting a bit desperate for a solution or explanation, and have
> failed to find any leads. I wouldn't be surprised if we had some
> compiler flags set wrong, but we've not found anything that makes a
> difference.
>
> Please could someone tell me if this is not possible (c++ exceptions
> can't be thrown through app kit / foundation methods, for eg).
> Alternatively, could someone confirm if it's definitely possible, and
> we must have something set up wrong.
>
> Thanks very much,
>         Benjohn
>
 _______________________________________________
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

  • Prev by Date: Re: Best way to email html?
  • Next by Date: Re: c++ exceptions causing abort
  • Previous by thread: Re: c++ exceptions causing abort
  • Next by thread: re: c++ exceptions causing abort
  • Index(es):
    • Date
    • Thread