Blame SOURCES/gcc44-unwind-debug-hook.patch

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