diff options
author | Carlos O'Donell <carlos@codesourcery.com> | 2007-08-29 04:11:06 +0000 |
---|---|---|
committer | Carlos O'Donell <carlos@codesourcery.com> | 2007-08-29 04:11:06 +0000 |
commit | d037d08851dcb4ce4feb713a7f024ebac5d84cca (patch) | |
tree | abfd0fd70ac88b8eff94ba074f811ba414ac52cb /gdb/hppa-tdep.c | |
parent | 1ebd95fdf1ebf842d59c98715fa7b62ba85f0c83 (diff) | |
download | gdb-d037d08851dcb4ce4feb713a7f024ebac5d84cca.zip gdb-d037d08851dcb4ce4feb713a7f024ebac5d84cca.tar.gz gdb-d037d08851dcb4ce4feb713a7f024ebac5d84cca.tar.bz2 |
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.
Diffstat (limited to 'gdb/hppa-tdep.c')
-rw-r--r-- | gdb/hppa-tdep.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index f562e5f..10ac7ec 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -2674,6 +2674,16 @@ hppa32_cannot_store_register (int 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) { return (regnum == 0 @@ -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"), |