1 2010-04-27 Jakub Jelinek <jakub@redhat.com>
3 * unwind-dw2.c (_Unwind_DebugHook): Add used attribute.
5 2009-05-27 Tom Tromey <tromey@redhat.com>
7 * unwind-dw2.c (_Unwind_DebugHook): New function.
8 (uw_install_context): Call _Unwind_DebugHook.
10 --- gcc/unwind-dw2.c (revision 147933)
11 +++ gcc/unwind-dw2.c (revision 147934)
12 @@ -1473,18 +1473,32 @@ uw_init_context_1 (struct _Unwind_Contex
13 context->ra = __builtin_extract_return_addr (outer_ra);
16 +static void _Unwind_DebugHook (void *, void *)
17 + __attribute__ ((__noinline__, __used__));
19 +/* This function is called during unwinding. It is intended as a hook
20 + for a debugger to intercept exceptions. CFA is the CFA of the
21 + target frame. HANDLER is the PC to which control will be
24 +_Unwind_DebugHook (void *cfa __attribute__ ((__unused__)),
25 + void *handler __attribute__ ((__unused__)))
30 /* Install TARGET into CURRENT so that we can return to it. This is a
31 macro because __builtin_eh_return must be invoked in the context of
34 -#define uw_install_context(CURRENT, TARGET) \
37 - long offset = uw_install_context_1 ((CURRENT), (TARGET)); \
38 - void *handler = __builtin_frob_return_addr ((TARGET)->ra); \
39 - __builtin_eh_return (offset, handler); \
41 +#define uw_install_context(CURRENT, TARGET) \
44 + long offset = uw_install_context_1 ((CURRENT), (TARGET)); \
45 + void *handler = __builtin_frob_return_addr ((TARGET)->ra); \
46 + _Unwind_DebugHook ((TARGET)->cfa, handler); \
47 + __builtin_eh_return (offset, handler); \