Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [hppa-hpux] Signal frame unwinding support for hppa64-hp-hpux11.11
@ 2005-11-17 11:28 Randolph Chung
  2005-11-17 11:48 ` Mark Kettenis
  0 siblings, 1 reply; 7+ messages in thread
From: Randolph Chung @ 2005-11-17 11:28 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 314 bytes --]

The attached patch adds support for signal frame unwinding under
hppa64-hp-hpux11.11, and fixes a bug with signal frame unwinding under
hppa2.0w-hp-hpux11.11. I will commit this in a day or no if there are no
comments.

randolph
-- 
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/

[-- Attachment #2: hpux-sigframe.diff --]
[-- Type: text/plain, Size: 2128 bytes --]

2005-11-15  Randolph Chung  <tausq@debian.org>

	* hppa-hpux-tdep.c (hppa_hpux_sigtramp_frame_unwind_cache): Ensure "off"
	is large enough to hold 64-bit offset.  Set proper signal context offset
	for 64-bit programs.  Set pc properly for signal frames.

Index: hppa-hpux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-hpux-tdep.c,v
retrieving revision 1.43
diff -u -p -r1.43 hppa-hpux-tdep.c
--- hppa-hpux-tdep.c	29 Oct 2005 21:31:45 -0000	1.43
+++ hppa-hpux-tdep.c	15 Nov 2005 15:40:07 -0000
@@ -1158,8 +1158,8 @@ hppa_hpux_sigtramp_frame_unwind_cache (s
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   struct hppa_hpux_sigtramp_unwind_cache *info;
   unsigned int flag;
-  CORE_ADDR sp, scptr;
-  int i, incr, off, szoff;
+  CORE_ADDR sp, scptr, off;
+  int i, incr, szoff;
 
   if (*this_cache)
     return *this_cache;
@@ -1170,14 +1170,18 @@ hppa_hpux_sigtramp_frame_unwind_cache (s
 
   sp = frame_unwind_register_unsigned (next_frame, HPPA_SP_REGNUM);
 
-  scptr = sp - 1352;
+  if (IS_32BIT_TARGET (gdbarch))
+    scptr = sp - 1352;
+  else
+    scptr = sp - 1520;
+
   off = scptr;
 
   /* See /usr/include/machine/save_state.h for the structure of the save_state_t
      structure. */
   
   flag = read_memory_unsigned_integer(scptr, 4);
-    
+
   if (!(flag & 0x40))
     {
       /* Narrow registers. */
@@ -1188,7 +1192,7 @@ hppa_hpux_sigtramp_frame_unwind_cache (s
   else
     {
       /* Wide registers. */
-      off = scptr + offsetof (save_state_t, ss_wide) + 8;
+      off = scptr + offsetof (save_state_t, ss_wide.ss_64) + 8;
       incr = 8;
       szoff = (tdep->bytes_per_address == 4 ? 4 : 0);
     }
@@ -1203,11 +1207,15 @@ hppa_hpux_sigtramp_frame_unwind_cache (s
     {
       if (hppa_hpux_tramp_reg[i] > 0)
         info->saved_regs[hppa_hpux_tramp_reg[i]].addr = off + szoff;
+
       off += incr;
     }
 
   /* TODO: fp regs */
 
+  info->saved_regs[HPPA_PCOQ_HEAD_REGNUM].addr = 
+    info->saved_regs[HPPA_RP_REGNUM].addr;
+
   info->base = frame_unwind_register_unsigned (next_frame, HPPA_SP_REGNUM);
 
   return info;

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-11-19 12:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-17 11:28 [hppa-hpux] Signal frame unwinding support for hppa64-hp-hpux11.11 Randolph Chung
2005-11-17 11:48 ` Mark Kettenis
2005-11-17 12:10   ` Randolph Chung
2005-11-17 12:17     ` Mark Kettenis
2005-11-17 12:44       ` Randolph Chung
2005-11-17 12:56         ` Mark Kettenis
2005-11-19 18:58           ` Randolph Chung

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox