tstellar / rpms / gcc

Forked from rpms/gcc 4 years ago
Clone
a4dde82
2009-05-27  Tom Tromey  <tromey@redhat.com>
a4dde82
a4dde82
	* unwind-dw2.c (_Unwind_DebugHook): New function.
a4dde82
	(uw_install_context): Call _Unwind_DebugHook.
a4dde82
a4dde82
--- gcc/unwind-dw2.c	(revision 147933)
a4dde82
+++ gcc/unwind-dw2.c	(revision 147934)
a4dde82
@@ -1473,18 +1473,31 @@ uw_init_context_1 (struct _Unwind_Contex
a4dde82
   context->ra = __builtin_extract_return_addr (outer_ra);
a4dde82
 }
a4dde82
 
a4dde82
+static void _Unwind_DebugHook (void *, void *) __attribute__ ((__noinline__));
a4dde82
+
a4dde82
+/* This function is called during unwinding.  It is intended as a hook
a4dde82
+   for a debugger to intercept exceptions.  CFA is the CFA of the
a4dde82
+   target frame.  HANDLER is the PC to which control will be
a4dde82
+   transferred.  */
a4dde82
+static void
a4dde82
+_Unwind_DebugHook (void *cfa __attribute__ ((__unused__)),
a4dde82
+		   void *handler __attribute__ ((__unused__)))
a4dde82
+{
a4dde82
+  asm ("");
a4dde82
+}
a4dde82
 
a4dde82
 /* Install TARGET into CURRENT so that we can return to it.  This is a
a4dde82
    macro because __builtin_eh_return must be invoked in the context of
a4dde82
    our caller.  */
a4dde82
 
a4dde82
-#define uw_install_context(CURRENT, TARGET)				 \
a4dde82
-  do									 \
a4dde82
-    {									 \
a4dde82
-      long offset = uw_install_context_1 ((CURRENT), (TARGET));		 \
a4dde82
-      void *handler = __builtin_frob_return_addr ((TARGET)->ra);	 \
a4dde82
-      __builtin_eh_return (offset, handler);				 \
a4dde82
-    }									 \
a4dde82
+#define uw_install_context(CURRENT, TARGET)				\
a4dde82
+  do									\
a4dde82
+    {									\
a4dde82
+      long offset = uw_install_context_1 ((CURRENT), (TARGET));		\
a4dde82
+      void *handler = __builtin_frob_return_addr ((TARGET)->ra);	\
a4dde82
+      _Unwind_DebugHook ((TARGET)->cfa, handler);			\
a4dde82
+      __builtin_eh_return (offset, handler);				\
a4dde82
+    }									\
a4dde82
   while (0)
a4dde82
 
a4dde82
 static long