[patch] Revise pa_fallback_frame_state to skip export stubs on PA hpux

John David Anglin dave@hiauly1.hia.nrc.ca
Wed May 17 01:25:00 GMT 2006


The enclosed patch is the last change needed to the PA unwind
machinary to get Java working on the 32-bit hpux port.  UnwindTraceFn
in stacktrace.cc assumes a 1:1 correspondence between call frames in
the interpreted stack and occurences of _Jv_InterpMethod::run() on the
native stack.  In order for this to be true, we need to skip export
stubs in pa_fallback_frame_state.  Otherwise, we sometimes have two
frames on the native stack for one on the interpreted stack.

In order to call uw_update_context and uw_frame_state_for from within
pa_fallback_frame_state, I need to add declarations for these functions
to unwind-dw2.c.

With this change plus some hpux specific changes to libjava, the libjava
testsuite is now clean on hppa2.0w-hp-hpux11.11 except for LargeFile.  The
failure of this test is expected since this feature isn't enabled on the
filesystem used for the test.  See
http://gcc.gnu.org/ml/gcc-testresults/2006-05/msg00901.html

Ok for head?

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)

2006-05-16  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>

	* unwind-dw2.c: Add declarations for uw_update_context and
	uw_frame_state_for.
	* pa/hpux-unwind.h (pa_fallback_frame_state): When an export stub is
	detected, advance frame state and context once to skip over stub.

Index: unwind-dw2.c
===================================================================
--- unwind-dw2.c	(revision 113764)
+++ unwind-dw2.c	(working copy)
@@ -92,6 +92,10 @@
   signed s8 __attribute__ ((mode (DI)));
 } __attribute__ ((packed));
 
+static void uw_update_context (struct _Unwind_Context *, _Unwind_FrameState *);
+static _Unwind_Reason_Code uw_frame_state_for (struct _Unwind_Context *,
+					       _Unwind_FrameState *);
+
 static inline void *
 read_pointer (const void *p) { const union unaligned *up = p; return up->p; }
 
Index: config/pa/hpux-unwind.h
===================================================================
--- config/pa/hpux-unwind.h	(revision 113764)
+++ config/pa/hpux-unwind.h	(working copy)
@@ -155,7 +155,11 @@
       fs->regs.reg[0].how = REG_SAVED_OFFSET;
       fs->regs.reg[0].loc.offset = -24;
 
-      return _URC_NO_REASON;
+      /* Update context to describe the stub frame.  */
+      uw_update_context (context, fs);
+
+      /* Set up fs to describe the FDE for the caller of this stub.  */
+      return uw_frame_state_for (context, fs);
     }
   /* Check if the return address points to a relocation stub.  */
   else if (!TARGET_64BIT
@@ -171,7 +175,11 @@
       fs->regs.reg[0].how = REG_SAVED_OFFSET;
       fs->regs.reg[0].loc.offset = -8;
 
-      return _URC_NO_REASON;
+      /* Update context to describe the stub frame.  */
+      uw_update_context (context, fs);
+
+      /* Set up fs to describe the FDE for the caller of this stub.  */
+      return uw_frame_state_for (context, fs);
     }
 
   /* Check if the return address is an export stub as signal handlers



More information about the Gcc-patches mailing list