aboutsummaryrefslogtreecommitdiff
path: root/gdb/ppc-bdm.c
diff options
context:
space:
mode:
authorJim Blandy <jimb@codesourcery.com>2004-05-05 01:46:55 +0000
committerJim Blandy <jimb@codesourcery.com>2004-05-05 01:46:55 +0000
commit366f009f23b0e5fc1668d1f728b4cda533df5cb5 (patch)
tree6a4f33eea5a1504c1169b4f9e7d0f7bff0dca852 /gdb/ppc-bdm.c
parente792b4ce88267ea6d1fc66defae56f8dc8d4c05d (diff)
downloadgdb-366f009f23b0e5fc1668d1f728b4cda533df5cb5.zip
gdb-366f009f23b0e5fc1668d1f728b4cda533df5cb5.tar.gz
gdb-366f009f23b0e5fc1668d1f728b4cda533df5cb5.tar.bz2
* config/rs6000/tm-rs6000.h (FP0_REGNUM): Document that this
should no longer be used in code specific to the RS6000 and its derivatives. * ppc-tdep.h (struct gdbarch_tdep): Add 'ppc_fp0_regnum' member. * rs6000-tdep.c (rs6000_gdbarch_init): Initialize tdep->ppc_fp0_regnum. (ppc_supply_fpregset, ppc_collect_fpregset) (rs6000_push_dummy_call, rs6000_extract_return_value) (rs6000_dwarf2_stab_reg_to_regnum, rs6000_store_return_value) (rs6000_frame_cache): Use tdep->ppc_fp0_regnum instead of FP0_REGNUM. * aix-thread.c (supply_fprs, fetch_regs_kernel_thread) (fill_gprs64, fill_gprs32, fill_fprs, store_regs_kernel_thread): Same. * ppc-bdm.c (bdm_ppc_fetch_registers, bdm_ppc_fetch_registers, bdm_ppc_store_registers): Same. * ppc-linux-nat.c (ppc_register_u_addr, fetch_register) (store_register, fill_fpregset): Same. * ppc-linux-tdep.c (ppc_linux_sigtramp_cache) (ppc_linux_supply_fpregset): Same. * ppcnbsd-nat.c (getfpregs_supplies): Same. * ppcnbsd-tdep.c (ppcnbsd_supply_fpreg, ppcnbsd_fill_fpreg): Same. * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call, do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call, ppc64_sysv_abi_return_value): Same. * rs6000-nat.c (regmap, fetch_inferior_registers) (store_inferior_registers, fetch_core_registers): Same.
Diffstat (limited to 'gdb/ppc-bdm.c')
-rw-r--r--gdb/ppc-bdm.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/gdb/ppc-bdm.c b/gdb/ppc-bdm.c
index 515cbdd..59fac1f 100644
--- a/gdb/ppc-bdm.c
+++ b/gdb/ppc-bdm.c
@@ -153,6 +153,7 @@ static int bdm_regmap[] =
static void
bdm_ppc_fetch_registers (int regno)
{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
int i;
unsigned char *regs, *beginregs, *endregs, *almostregs;
unsigned char midregs[32];
@@ -202,8 +203,8 @@ bdm_ppc_fetch_registers (int regno)
/* if asking for an invalid register */
if ((first_regno == gdbarch_tdep (current_gdbarch)->ppc_mq_regnum)
|| (first_regno == gdbarch_tdep (current_gdbarch)->ppc_fpscr_regnum)
- || ((first_regno >= FP0_REGNUM)
- && (first_regno < FP0_REGNUM + ppc_num_fprs)))
+ || ((first_regno >= tdep->ppc_fp0_regnum)
+ && (first_regno < tdep->ppc_fp0_regnum + ppc_num_fprs)))
{
/* printf("invalid reg request!\n"); */
supply_register (first_regno, NULL);
@@ -220,10 +221,12 @@ bdm_ppc_fetch_registers (int regno)
{
/* printf("Asking for registers %d to %d\n", first_regno, last_regno); */
beginregs = ocd_read_bdm_registers (first_bdm_regno,
- FP0_REGNUM - 1, &beginreglen);
- endregs = (strcat (midregs,
- ocd_read_bdm_registers (FP0_REGNUM + ppc_num_fprs,
- last_bdm_regno - 1, &endreglen)));
+ tdep->ppc_fp0_regnum - 1,
+ &beginreglen);
+ endregs
+ = (strcat (midregs,
+ ocd_read_bdm_registers (tdep->ppc_fp0_regnum + ppc_num_fprs,
+ last_bdm_regno - 1, &endreglen)));
almostregs = (strcat (beginregs, endregs));
regs = (strcat (almostregs, mqreg));
reglen = beginreglen + 32 + endreglen + 1;
@@ -259,6 +262,7 @@ bdm_ppc_fetch_registers (int regno)
static void
bdm_ppc_store_registers (int regno)
{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
int i;
int first_regno, last_regno;
int first_bdm_regno, last_bdm_regno;
@@ -293,7 +297,8 @@ bdm_ppc_store_registers (int regno)
/* (need to avoid FP regs and MQ reg) */
if ((i != gdbarch_tdep (current_gdbarch)->ppc_mq_regnum)
&& (i != gdbarch_tdep (current_gdbarch)->ppc_fpscr_regnum)
- && ((i < FP0_REGNUM) || (i >= FP0_REGNUM + ppc_num_fprs)))
+ && ((i < tdep->ppc_fp0_regnum)
+ || (i >= tdep->ppc_fp0_regnum + ppc_num_fprs)))
{
/* printf("write valid reg %d\n", bdm_regno); */
ocd_write_bdm_registers (bdm_regno, deprecated_registers + DEPRECATED_REGISTER_BYTE (i), 4);