From: tromey Date: Wed, 27 May 2009 23:12:21 +0000 (+0000) Subject: * unwind-dw2.c (_Unwind_DebugHook): New function. X-Git-Url: http://git.sourceforge.jp/view?a=commitdiff_plain;h=99385b4bf103b95e840017382cd671ec93ec2e15;p=pf3gnuchains%2Fgcc-fork.git * unwind-dw2.c (_Unwind_DebugHook): New function. (uw_install_context): Call _Unwind_DebugHook. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@147934 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 306b3f844d8..6920b5a11ce 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2009-05-27 Tom Tromey + * unwind-dw2.c (_Unwind_DebugHook): New function. + (uw_install_context): Call _Unwind_DebugHook. + +2009-05-27 Tom Tromey + * system.h (CONST_CAST2): Use C++ const_cast when compiled as C++ 2009-05-27 Ian Lance Taylor diff --git a/gcc/unwind-dw2.c b/gcc/unwind-dw2.c index dd3dd549cd1..68a1a282b34 100644 --- a/gcc/unwind-dw2.c +++ b/gcc/unwind-dw2.c @@ -1473,18 +1473,31 @@ uw_init_context_1 (struct _Unwind_Context *context, context->ra = __builtin_extract_return_addr (outer_ra); } +static void _Unwind_DebugHook (void *, void *) __attribute__ ((__noinline__)); + +/* This function is called during unwinding. It is intended as a hook + for a debugger to intercept exceptions. CFA is the CFA of the + target frame. HANDLER is the PC to which control will be + transferred. */ +static void +_Unwind_DebugHook (void *cfa __attribute__ ((__unused__)), + void *handler __attribute__ ((__unused__))) +{ + asm (""); +} /* Install TARGET into CURRENT so that we can return to it. This is a macro because __builtin_eh_return must be invoked in the context of our caller. */ -#define uw_install_context(CURRENT, TARGET) \ - do \ - { \ - long offset = uw_install_context_1 ((CURRENT), (TARGET)); \ - void *handler = __builtin_frob_return_addr ((TARGET)->ra); \ - __builtin_eh_return (offset, handler); \ - } \ +#define uw_install_context(CURRENT, TARGET) \ + do \ + { \ + long offset = uw_install_context_1 ((CURRENT), (TARGET)); \ + void *handler = __builtin_frob_return_addr ((TARGET)->ra); \ + _Unwind_DebugHook ((TARGET)->cfa, handler); \ + __builtin_eh_return (offset, handler); \ + } \ while (0) static long