* hppa-tdep.c (hppa_frame_prev_register_helper): Make 64-bit safe.
authorMark Kettenis <kettenis@gnu.org>
Tue, 21 Dec 2004 22:50:54 +0000 (22:50 +0000)
committerMark Kettenis <kettenis@gnu.org>
Tue, 21 Dec 2004 22:50:54 +0000 (22:50 +0000)
gdb/ChangeLog
gdb/hppa-tdep.c

index 639d287e5b40dee6fe36d9bdd805bd99e6481ef0..2796723bf794f4921354b52bef85ffba8f520348 100644 (file)
@@ -1,3 +1,7 @@
+2004-12-21  Mark Kettenis  <kettenis@gnu.org>
+
+       * hppa-tdep.c (hppa_frame_prev_register_helper): Make 64-bit safe.
+
 2004-12-21  Mark Kettenis  <kettenis@gnu.org>
 
        * hppa-tdep.c (hppa64_return_value): Fix previous commit.
index 97dcc0d7738d5cc8c970f6089d7c94ae179872e0..d4317d1a58537f2de981dd34a0b239cde393cca2 100644 (file)
@@ -2622,18 +2622,21 @@ hppa_frame_prev_register_helper (struct frame_info *next_frame,
                                 enum lval_type *lvalp, CORE_ADDR *addrp,
                                 int *realnump, void *valuep)
 {
+  struct gdbarch *arch = get_frame_arch (next_frame);
+
   if (regnum == HPPA_PCOQ_TAIL_REGNUM)
     {
       if (valuep)
        {
+         int size = register_size (arch, HPPA_PCOQ_HEAD_REGNUM);
          CORE_ADDR pc;
 
          trad_frame_get_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);
+         pc = extract_unsigned_integer (valuep, size);
+         store_unsigned_integer (valuep, size, pc + 4);
        }
 
       /* It's a computed value.  */
@@ -2652,10 +2655,7 @@ hppa_frame_prev_register_helper (struct frame_info *next_frame,
   if (regnum == HPPA_FLAGS_REGNUM)
     {
       if (valuep)
-       store_unsigned_integer (valuep, 
-                               register_size (get_frame_arch (next_frame), 
-                                              regnum), 
-                               0);
+       store_unsigned_integer (valuep, register_size (arch, regnum), 0);
 
       /* It's a computed value.  */
       *optimizedp = 0;