2007-08-29 Randolph Chung <tausq@debian.org>
authorCarlos O'Donell <carlos@codesourcery.com>
Wed, 29 Aug 2007 04:11:06 +0000 (04:11 +0000)
committerCarlos O'Donell <carlos@codesourcery.com>
Wed, 29 Aug 2007 04:11:06 +0000 (04:11 +0000)
* hppa-tdep.c (hppa32_cannot_fetch_register)
(hppa64_cannot_fetch_register): New functions.
(hppa_gdbarch_init): Set cannot_fetch_register appropriately.
* hppa-tdep.h (hppa_regnum): Add HPPA_CR26_REGNUM.

gdb/ChangeLog
gdb/hppa-tdep.c
gdb/hppa-tdep.h

index 3b97a5f833e54cacb70af5709ae1ed27e864be6a..1b67a5916ac58041a2389ce5d03520b57fae7447 100644 (file)
@@ -1,3 +1,10 @@
+2007-08-29  Randolph Chung  <tausq@debian.org>
+
+       * hppa-tdep.c (hppa32_cannot_fetch_register)
+       (hppa64_cannot_fetch_register): New functions.
+       (hppa_gdbarch_init): Set cannot_fetch_register appropriately.
+       * hppa-tdep.h (hppa_regnum): Add HPPA_CR26_REGNUM.
+
 2007-08-28  Michael Snyder  <msnyder@access-company.com>
 
        * mi/mi-cmd-var.c (mi_print_value_p): No longer necessary to 
index f562e5fa059c3138234cbbbe19b5f535fb215494..10ac7ecde152e67dbd80e6160b80c64bbc4f8a6f 100644 (file)
@@ -2673,6 +2673,16 @@ hppa32_cannot_store_register (int regnum)
           || (regnum > HPPA_IPSW_REGNUM && regnum < HPPA_FP4_REGNUM));
 }
 
+static int
+hppa32_cannot_fetch_register (int regnum)
+{
+  /* cr26 and cr27 are readable (but not writable) from userspace.  */
+  if (regnum == HPPA_CR26_REGNUM || regnum == HPPA_CR27_REGNUM)
+    return 0;
+  else
+    return hppa32_cannot_store_register (regnum);
+}
+
 static int
 hppa64_cannot_store_register (int regnum)
 {
@@ -2682,6 +2692,16 @@ hppa64_cannot_store_register (int regnum)
           || (regnum > HPPA_IPSW_REGNUM && regnum < HPPA64_FP4_REGNUM));
 }
 
+static int
+hppa64_cannot_fetch_register (int regnum)
+{
+  /* cr26 and cr27 are readable (but not writable) from userspace.  */
+  if (regnum == HPPA_CR26_REGNUM || regnum == HPPA_CR27_REGNUM)
+    return 0;
+  else
+    return hppa64_cannot_store_register (regnum);
+}
+
 static CORE_ADDR
 hppa_smash_text_address (CORE_ADDR addr)
 {
@@ -3074,7 +3094,7 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
        set_gdbarch_cannot_store_register (gdbarch,
                                           hppa32_cannot_store_register);
        set_gdbarch_cannot_fetch_register (gdbarch,
-                                          hppa32_cannot_store_register);
+                                          hppa32_cannot_fetch_register);
         break;
       case 8:
         set_gdbarch_num_regs (gdbarch, hppa64_num_regs);
@@ -3085,7 +3105,7 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
        set_gdbarch_cannot_store_register (gdbarch,
                                           hppa64_cannot_store_register);
        set_gdbarch_cannot_fetch_register (gdbarch,
-                                          hppa64_cannot_store_register);
+                                          hppa64_cannot_fetch_register);
         break;
       default:
         internal_error (__FILE__, __LINE__, _("Unsupported address size: %d"),
index 381a4ff354cb8945366357e14bf145aeec591de7..b7ba8fbc155f8e389056633e334b5c3859cbb0d8 100644 (file)
@@ -57,6 +57,7 @@ enum hppa_regnum
   HPPA_PID3_REGNUM = 56,       /* Protection ID */
   HPPA_CCR_REGNUM = 54,                /* Coprocessor Configuration Register */
   HPPA_TR0_REGNUM = 57,                /* Temporary Registers (cr24 -> cr31) */
+  HPPA_CR26_REGNUM = 59,
   HPPA_CR27_REGNUM = 60,       /* Base register for thread-local storage, cr27 */
   HPPA_FP0_REGNUM = 64,                /* First floating-point.  */
   HPPA_FP4_REGNUM = 72,