aboutsummaryrefslogtreecommitdiff
path: root/gdb/rs6000-nat.c
diff options
context:
space:
mode:
authorMarkus Deuling <deuling@de.ibm.com>2008-02-18 11:00:02 +0000
committerMarkus Deuling <deuling@de.ibm.com>2008-02-18 11:00:02 +0000
commit206988c4346c46f6dd714432959cf0c2dfb3f797 (patch)
tree6a089ac57418ad3981a61b314e13156df6b785e1 /gdb/rs6000-nat.c
parentf642be6b2e99b51fd66d83cc4dbd6f2e0e68c6dd (diff)
downloadgdb-206988c4346c46f6dd714432959cf0c2dfb3f797.zip
gdb-206988c4346c46f6dd714432959cf0c2dfb3f797.tar.gz
gdb-206988c4346c46f6dd714432959cf0c2dfb3f797.tar.bz2
* rs6000-nat.c (exec_one_dummy_insn, regmap): Add gdbarch as parameter
and replace current_gdbarch by gdbarch. (store_register): Update call for exec_one_dummy_insn. (fetch_register, store_register): Update call of regmap. * ppcnbsd-nat.c (getregs_supplies, getfpregs_supplies): Add gdbarch as parameter and replace current_gdbarch by gdbarch. (ppcnbsd_store_inferior_registers): Use get_regcache_arch to get at the current architecture. Update call for getregs_supplies and getfpregs_supplies. (ppcnbsd_fetch_inferior_registers): Likewise. * ppcobsd-nat.c (getfpregs_supplies): Add gdbarch as parameter and replace current_gdbarch by gdbarch. (ppcobsd_fetch_registers, ppcobsd_store_registers): Use get_regcache_arch to get at the current architecture. Update call for getfpregs_supplies.
Diffstat (limited to 'gdb/rs6000-nat.c')
-rw-r--r--gdb/rs6000-nat.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c
index 02a7946..2a180be 100644
--- a/gdb/rs6000-nat.c
+++ b/gdb/rs6000-nat.c
@@ -130,7 +130,7 @@ static int objfile_symbol_add (void *);
static void vmap_symtab (struct vmap *);
-static void exec_one_dummy_insn (void);
+static void exec_one_dummy_insn (struct gdbarch *);
extern void fixup_breakpoints (CORE_ADDR low, CORE_ADDR high, CORE_ADDR delta);
@@ -140,9 +140,9 @@ extern void fixup_breakpoints (CORE_ADDR low, CORE_ADDR high, CORE_ADDR delta);
ISFLOAT to indicate whether REGNO is a floating point register. */
static int
-regmap (int regno, int *isfloat)
+regmap (struct gdbarch *gdbarch, int regno, int *isfloat)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
*isfloat = 0;
if (tdep->ppc_gp0_regnum <= regno
@@ -155,7 +155,7 @@ regmap (int regno, int *isfloat)
*isfloat = 1;
return regno - tdep->ppc_fp0_regnum + FPR0;
}
- else if (regno == gdbarch_pc_regnum (current_gdbarch))
+ else if (regno == gdbarch_pc_regnum (gdbarch))
return IAR;
else if (regno == tdep->ppc_ps_regnum)
return MSR;
@@ -218,7 +218,7 @@ fetch_register (struct regcache *regcache, int regno)
/* Retrieved values may be -1, so infer errors from errno. */
errno = 0;
- nr = regmap (regno, &isfloat);
+ nr = regmap (gdbarch, regno, &isfloat);
/* Floating-point registers. */
if (isfloat)
@@ -279,7 +279,7 @@ store_register (const struct regcache *regcache, int regno)
/* -1 can be a successful return value, so infer errors from errno. */
errno = 0;
- nr = regmap (regno, &isfloat);
+ nr = regmap (gdbarch, regno, &isfloat);
/* Floating-point registers. */
if (isfloat)
@@ -303,7 +303,7 @@ store_register (const struct regcache *regcache, int regno)
Otherwise the following ptrace(2) calls will mess up user stack
since kernel will get confused about the bottom of the stack
(%sp). */
- exec_one_dummy_insn ();
+ exec_one_dummy_insn (gdbarch);
/* The PT_WRITE_GPR operation is rather odd. For 32-bit inferiors,
the register's value is passed by value, but for 64-bit inferiors,
@@ -576,9 +576,9 @@ rs6000_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
including u_area. */
static void
-exec_one_dummy_insn (void)
+exec_one_dummy_insn (struct gdbarch *gdbarch)
{
-#define DUMMY_INSN_ADDR gdbarch_tdep (current_gdbarch)->text_segment_base+0x200
+#define DUMMY_INSN_ADDR gdbarch_tdep (gdbarch)->text_segment_base+0x200
int ret, status, pid;
CORE_ADDR prev_pc;