gcc/gcc44-unwind-debug-hook.patch

52 lines
1.7 KiB
Diff
Raw Normal View History

2010-04-27 19:29:26 +00:00
2010-04-27 Jakub Jelinek <jakub@redhat.com>
* unwind-dw2.c (_Unwind_DebugHook): Add used attribute.
2009-06-09 14:26:59 +00:00
2009-05-27 Tom Tromey <tromey@redhat.com>
* unwind-dw2.c (_Unwind_DebugHook): New function.
(uw_install_context): Call _Unwind_DebugHook.
--- gcc/unwind-dw2.c (revision 147933)
+++ gcc/unwind-dw2.c (revision 147934)
2010-04-27 19:29:26 +00:00
@@ -1473,18 +1473,32 @@ uw_init_context_1 (struct _Unwind_Contex
2009-06-09 14:26:59 +00:00
context->ra = __builtin_extract_return_addr (outer_ra);
}
2010-04-27 19:29:26 +00:00
+static void _Unwind_DebugHook (void *, void *)
+ __attribute__ ((__noinline__, __used__));
2009-06-09 14:26:59 +00:00
+
+/* 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