aboutsummaryrefslogtreecommitdiff
path: root/libobjc/exception.c
diff options
context:
space:
mode:
authorDavid Ayers <ayers@gcc.gnu.org>2009-03-12 22:28:15 +0000
committerDavid Ayers <ayers@gcc.gnu.org>2009-03-12 22:28:15 +0000
commitfaef499bdf0a88f9ec9d3282728ee081f12b8cb4 (patch)
tree53acb0e9cd94a0ada09c499da8ecc1b24cdba655 /libobjc/exception.c
parent03a181983d217bfc13d295e698edc1eae0e8dacd (diff)
downloadgcc-faef499bdf0a88f9ec9d3282728ee081f12b8cb4.zip
gcc-faef499bdf0a88f9ec9d3282728ee081f12b8cb4.tar.gz
gcc-faef499bdf0a88f9ec9d3282728ee081f12b8cb4.tar.bz2
re PR libobjc/27466 (RFE: Support for libobjc equivalent of std::set_unexpected)
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. From-SVN: r144826
Diffstat (limited to 'libobjc/exception.c')
-rw-r--r--libobjc/exception.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/libobjc/exception.c b/libobjc/exception.c
index bc59aa7..5af6310 100644
--- a/libobjc/exception.c
+++ b/libobjc/exception.c
@@ -1,5 +1,5 @@
/* The implementation of exception handling primitives for Objective-C.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of GCC.
@@ -86,6 +86,11 @@ struct lsda_header_info
unsigned char call_site_encoding;
};
+/* This hook allows libraries to sepecify special actions when an
+ exception is thrown without a handler in place.
+ */
+void (*_objc_unexpected_exception) (id exception); /* !T:SAFE */
+
static const unsigned char *
parse_lsda_header (struct _Unwind_Context *context, const unsigned char *p,
struct lsda_header_info *info)
@@ -486,5 +491,9 @@ objc_exception_throw (id value)
#endif
/* Some sort of unwinding error. */
+ if (_objc_unexpected_exception != 0)
+ {
+ (*_objc_unexpected_exception) (value);
+ }
abort ();
}