diff options
author | Randolph Chung <tausq@debian.org> | 2004-11-23 21:05:23 +0000 |
---|---|---|
committer | Randolph Chung <tausq@debian.org> | 2004-11-23 21:05:23 +0000 |
commit | 68a53df635ebe8a9bd138f6232a05a11e6414e8e (patch) | |
tree | 7a06cba09e019010599ad2c5b704ffae18c4592c /gdb/hppa-tdep.c | |
parent | a8f011379b781734b6f64ec51a49543e73aa2c99 (diff) | |
download | gdb-68a53df635ebe8a9bd138f6232a05a11e6414e8e.tar.gz |
2004-11-23 Randolph Chung <tausq@debian.org>
* arch-utils.c (generic_instruction_nullified): New.
* arch-utils.h (generic_instruction_nullified): New.
* gdbarch.sh (instruction_nullified): New method.
* gdbarch.c: Regenerate.
* gdbarch.h: Regenerate.
* infrun.c (INSTRUCTION_NULLIFIED): Delete.
(handle_inferior_event): Replace INSTRUCTION_NULLIFIED with calls to
new gdbarch method.
* config/pa/tm-hppa.h (INSTRUCTION_NULLIFIED): Delete definition.
* hppa-tdep.c (hppa_instruction_nullified): Remove prototype and make
static. Rewrite to work directly off the passed regcache.
(hppa_gdbarch_init): Set instruction_nullified method.
Diffstat (limited to 'gdb/hppa-tdep.c')
-rw-r--r-- | gdb/hppa-tdep.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index f4cca55a34e..fb6e7ebea79 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -71,7 +71,6 @@ const struct objfile_data *hppa_objfile_priv_data = NULL; /* FIXME: brobecker 2002-11-07: We will likely be able to make the following functions static, once we hppa is partially multiarched. */ int hppa_pc_requires_run_before_use (CORE_ADDR pc); -int hppa_instruction_nullified (void); /* Handle 32/64-bit struct return conventions. */ @@ -2292,14 +2291,18 @@ hppa_pc_requires_run_before_use (CORE_ADDR pc) return (!target_has_stack && (pc & 0xFF000000)); } -int -hppa_instruction_nullified (void) +static int +hppa_instruction_nullified (struct gdbarch *gdbarch, struct regcache *regcache) { - /* brobecker 2002/11/07: Couldn't we use a ULONGEST here? It would - avoid the type cast. I'm leaving it as is for now as I'm doing - semi-mechanical multiarching-related changes. */ - const int ipsw = (int) read_register (HPPA_IPSW_REGNUM); - const int flags = (int) read_register (HPPA_FLAGS_REGNUM); + ULONGEST tmp, ipsw, flags; + + regcache_cooked_read (regcache, HPPA_IPSW_REGNUM, &tmp); + ipsw = extract_unsigned_integer (&tmp, + register_size (gdbarch, HPPA_IPSW_REGNUM)); + + regcache_cooked_read (regcache, HPPA_FLAGS_REGNUM, &tmp); + flags = extract_unsigned_integer (&tmp, + register_size (gdbarch, HPPA_FLAGS_REGNUM)); return ((ipsw & 0x00200000) && !(flags & 0x2)); } @@ -2570,6 +2573,7 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_breakpoint_from_pc (gdbarch, hppa_breakpoint_from_pc); set_gdbarch_pseudo_register_read (gdbarch, hppa_pseudo_register_read); + set_gdbarch_instruction_nullified (gdbarch, hppa_instruction_nullified); /* Frame unwind methods. */ set_gdbarch_unwind_dummy_id (gdbarch, hppa_unwind_dummy_id); |