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

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