aboutsummaryrefslogtreecommitdiff
path: root/gdb/hppa-tdep.c
diff options
context:
space:
mode:
authorRandolph Chung <tausq@debian.org>2004-11-23 21:05:23 +0000
committerRandolph Chung <tausq@debian.org>2004-11-23 21:05:23 +0000
commit3ca649544956e996656d40602064d9169949252b (patch)
treed4b05ca6ae749846443899a63d5113ee912da22b /gdb/hppa-tdep.c
parent0107feeddf942c0686ac9256fca6467baca40bf0 (diff)
downloadgdb-3ca649544956e996656d40602064d9169949252b.zip
gdb-3ca649544956e996656d40602064d9169949252b.tar.gz
gdb-3ca649544956e996656d40602064d9169949252b.tar.bz2
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.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index f4cca55..fb6e7eb 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);