libobjc's exception implementation doesn't support a user-supplied default uncaught exception handler, and this would be a very handy feature to have. With the equivalent of std:set_unexpected, one could implement the NSSetUncaughtExceptionHandler() Foundation API.
It will most likely be called objc_set_unexpected like all other libobjc functions and then GNUStep will implement NSSetUncaughtExceptionHandler.
Created attachment 16787 [details] An implementation of objc_set_unexpected function We really need this function to use native objective-c in GNUstep. The tiny attached patch does what the gnustep-base library needs ... providing a function to set a hanlder to be called if an exception is not caught. Please could you apply it or something similar.
Any news on when this can be done? The path is tiny/trivial, so even though it might be judged low priority I'd have hoped it could be fitted in quickly.
Is anyone monitoring/progressing this bug?
I just checked up on this again ... The problem was initially reported two and a half years ago. I supplied a (very very simple) patch to fix it a month ago. Could someone please apply the patch so it gets into the next release?
Created attachment 17364 [details] Updated patch (using and accessor function) inlcuding a test case For the record: This is an update of the existing patch which includes a test case. This was posted as an RFA: http://gcc.gnu.org/ml/gcc-patches/2009-02/msg01085.html with the following ChangeLog entries: 2009-02-23 Richard Frith-Macdonald <rfm@gnu.org> PR libobjc/27466 * objc/objc-api.h: declare objc_set_unexpected function. * exception.c: implement objc_set_unexpected function. * libobjc.def: export objc_set_unexpected 2009-02-23 David Ayers <ayers@fsfe.org> PR libobjc/27466 * objc/execute/exceptions/handler-1.m. New.
Created attachment 17365 [details] Alternative patch using a callback hook This patch was posted as an RFA: http://gcc.gnu.org/ml/gcc-patches/2009-02/msg01086.html With the following ChangeLog entry: 2009-02-23 Richard Frith-Macdonald <rfm@gnu.org> David Ayers <ayers@fsfe.org> PR libobjc/27466 * objc/objc-api.h (_objc_unexpected_exception): Declare new hook. * exception.c (objc_exception_throw): Use hook. * libobjc.def (_objc_unexpected_exception): Export hook. 2009-02-23 David Ayers <ayers@fsfe.org> PR libobjc/27466 * objc/execute/exceptions/handler-1.m. New.
Subject: Bug 27466 Author: ayers Date: Thu Mar 12 22:28:15 2009 New Revision: 144826 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=144826 Log: libobjc/ 2009-03-12 Richard Frith-Macdonald <rfm@gnu.org> David Ayers <ayers@fsfe.org> PR libobjc/27466 * objc/objc-api.h (_objc_unexpected_exception): Declare new hook. Update copyright dates. * exception.c (objc_exception_throw): Use hook. Update copyright dates. * libobjc.def (_objc_unexpected_exception): Export hook. Update copyright dates. gcc/testsuite/ 2009-03-12 David Ayers <ayers@fsfe.org> PR libobjc/27466 * objc/execute/exceptions/handler-1.m. New test. Added: trunk/gcc/testsuite/objc/execute/exceptions/handler-1.m Modified: trunk/gcc/testsuite/ChangeLog trunk/libobjc/ChangeLog trunk/libobjc/exception.c trunk/libobjc/libobjc.def trunk/libobjc/objc/objc-api.h
Fixed for 4.4.0