Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Fix hppa_frame_prev_register_helper
@ 2004-05-30 14:11 Mark Kettenis
  0 siblings, 0 replies; only message in thread
From: Mark Kettenis @ 2004-05-30 14:11 UTC (permalink / raw)
  To: gdb-patches

The current version of this function has a serious bug; it doesn't
deal correctly with VALUEP being null.  This causes GDB to crash if
you use "info frame".  This patch replaces the function with an
implementation that's similar to m88k.  This also makes the
information printed by "info frame" more correct.

Committed,

Mark


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>
 
	* hppa-tdep.c (hppa_frame_prev_register_helper): Reimplement to
	handle VALUEP being null.

 
Index: hppa-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-tdep.c,v
retrieving revision 1.165
diff -u -p -r1.165 hppa-tdep.c
--- hppa-tdep.c 26 May 2004 04:02:24 -0000 1.165
+++ hppa-tdep.c 30 May 2004 14:08:24 -0000
@@ -2316,20 +2316,32 @@ hppa_frame_prev_register_helper (struct 
 				 enum lval_type *lvalp, CORE_ADDR *addrp,
 				 int *realnump, void *valuep)
 {
-  int pcoqt = (regnum == HPPA_PCOQ_TAIL_REGNUM);
-  struct gdbarch *gdbarch = get_frame_arch (next_frame);
-  int regsize = register_size (gdbarch, HPPA_PCOQ_HEAD_REGNUM);
-
-  if (pcoqt)
-    regnum = HPPA_PCOQ_HEAD_REGNUM;
+  if (regnum == HPPA_PCOQ_TAIL_REGNUM)
+    {
+      if (valuep)
+	{
+	  CORE_ADDR pc;
+
+	  trad_frame_prev_register (next_frame, saved_regs,
+				    HPPA_PCOQ_HEAD_REGNUM, optimizedp,
+				    lvalp, addrp, realnump, valuep);
+
+	  pc = extract_unsigned_integer (valuep, 4);
+	  store_unsigned_integer (valuep, 4, pc + 4);
+	}
+
+      /* It's a computed value.  */
+      *optimizedp = 0;
+      *lvalp = not_lval;
+      *addrp = 0;
+      *realnump = -1;
+      return;
+    }
 
   trad_frame_prev_register (next_frame, saved_regs, regnum,
                             optimizedp, lvalp, addrp, realnump, valuep);
-
-  if (pcoqt)
-    store_unsigned_integer (valuep, regsize, 
-		      	    extract_unsigned_integer (valuep, regsize) + 4);
 }
+\f
 
 /* Here is a table of C type sizes on hppa with various compiles
    and options.  I measured this on PA 9000/800 with HP-UX 11.11
@@ -2559,4 +2571,3 @@ be no argument or the argument must be a
 				  &hppa_debug, "Set hppa debugging.\n\
 When non-zero, hppa specific debugging is enabled.", &setdebuglist), &showdebuglist);
 }
-


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-05-30 14:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-30 14:11 [PATCH] Fix hppa_frame_prev_register_helper Mark Kettenis

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