This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[committed] Handle parameter relocation and relocation stubs in pa_fallback_frame_state


The enclosed patch adds the capability to unwind through relocation
stubs and export stubs with return parameter relocation.  This fixes
a couple of fails in the libjava testsuite.

Tested on hppa2.0w-hp-hpux11.11 with no regressions observed.
Committed to trunk.

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

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

	* hpux-unwind.h (pa_fallback_frame_state): Handle return parameter
	relocation and relocation stubs.

Index: config/pa/hpux-unwind.h
===================================================================
--- config/pa/hpux-unwind.h	(revision 113593)
+++ config/pa/hpux-unwind.h	(working copy)
@@ -116,6 +116,26 @@
   if (pc == 0)
     return _URC_END_OF_STACK;
 
+  /* Check for relocation of the return value.  */
+  if (!TARGET_64BIT
+      && *(pc + 0) == 0x2fd01224		/* fstd,ma fr4,8(sp) */
+      && *(pc + 1) == 0x0fd9109d		/* ldw -4(sp),ret1 */
+      && *(pc + 2) == 0x0fd130bc)		/* ldw,mb -8(sp),ret0 */
+    pc += 3;
+  else if (!TARGET_64BIT
+	   && *(pc + 0) == 0x27d01224		/* fstw,ma fr4,8(sp) */
+	   && *(pc + 1) == 0x0fd130bc)		/* ldw,mb -8(sp),ret0 */
+    pc += 2;
+  else if (!TARGET_64BIT
+	   && *(pc + 0) == 0x0fdc12b0		/* stw,ma ret0,8(sp) */
+	   && *(pc + 1) == 0x0fdd1299		/* stw ret1,-4(sp) */
+	   && *(pc + 2) == 0x2fd13024)		/* fldd,mb -8(sp),fr4 */
+    pc += 3;
+  else if (!TARGET_64BIT
+	   && *(pc + 0) == 0x0fdc12b0		/* stw,ma ret0,8(sp) */
+	   && *(pc + 1) == 0x27d13024)		/* fldw,mb -8(sp),fr4 */
+    pc += 2;
+
   /* Check if the return address points to an export stub (PA 1.1 or 2.0).  */
   if ((!TARGET_64BIT
        && *(pc + 0) == 0x4bc23fd1		/* ldw -18(sp),rp */
@@ -137,7 +157,23 @@
 
       return _URC_NO_REASON;
     }
+  /* Check if the return address points to a relocation stub.  */
+  else if (!TARGET_64BIT
+	   && *(pc + 0) == 0x0fd11082		/* ldw -8(sp),rp */
+	   && (*(pc + 1) == 0xe840c002		/* bv,n r0(rp) */
+	       || *(pc + 1) == 0xe840d002))	/* bve,n (rp) */
+    {
+      fs->cfa_how    = CFA_REG_OFFSET;
+      fs->cfa_reg    = 30;
+      fs->cfa_offset = 0;
 
+      fs->retaddr_column = 0;
+      fs->regs.reg[0].how = REG_SAVED_OFFSET;
+      fs->regs.reg[0].loc.offset = -8;
+
+      return _URC_NO_REASON;
+    }
+
   /* Check if the return address is an export stub as signal handlers
      may return via an export stub.  */
   if (!TARGET_64BIT


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]