This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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]

[commit] Fix signal trampoline detection for HP-UX 10.20


This fixes signal trampoline detection on HP-UX 10.20, where unwinding
from the signal handler leads us to the export stub for _sigreturn()
rather than _sigreturn() itself.  The code generalizes things a bit by
considering any export stub for a function that has
HP_UX_interrupt_marker set in its unwind descriptor to be a signal
trampoline.

It's not unlikely that this is necessary for other HP-UX variants too.

Committed,

Mark


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* hppa-hpux-tdep.c (hppa_hpux_sigtramp_unwind_sniffer): Detect
	export stub for signal trampoline as a signal trampoline too.

Index: hppa-hpux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-hpux-tdep.c,v
retrieving revision 1.47
diff -u -p -r1.47 hppa-hpux-tdep.c
--- hppa-hpux-tdep.c 13 Dec 2005 10:17:09 -0000 1.47
+++ hppa-hpux-tdep.c 13 Dec 2005 10:19:08 -0000
@@ -1276,6 +1276,22 @@ hppa_hpux_sigtramp_unwind_sniffer (struc
 
   u = find_unwind_entry (pc);
 
+  /* If this is an export stub, try to get the unwind descriptor for
+     the actual function itself.  */
+  if (u && u->stub_unwind.stub_type == EXPORT)
+    {
+      gdb_byte buf[HPPA_INSN_SIZE];
+      unsigned long insn;
+
+      if (!safe_frame_unwind_memory (next_frame, u->region_start,
+				     buf, sizeof buf))
+	return NULL;
+
+      insn = extract_unsigned_integer (buf, sizeof buf);
+      if ((insn & 0xffe0e000) == 0xe8400000)
+	u = find_unwind_entry(u->region_start + hppa_extract_17 (insn) + 8);
+    }
+
   if (u && u->HP_UX_interrupt_marker)
     return &hppa_hpux_sigtramp_frame_unwind;
 


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