aboutsummaryrefslogtreecommitdiff
path: root/gdb/ppc-linux-tdep.c
diff options
context:
space:
mode:
authorElena Zannoni <ezannoni@kwikemart.cygnus.com>2001-12-09 21:39:53 +0000
committerElena Zannoni <ezannoni@kwikemart.cygnus.com>2001-12-09 21:39:53 +0000
commit2188cbdd51632bca507dd4ae973a6e9bc322f297 (patch)
tree99d4eb8b1ce69e38c114b09f557be16d9ffcf98e /gdb/ppc-linux-tdep.c
parent6edc140fcf4ac600f32a7ab7c290797d9943dc6b (diff)
downloadgdb-2188cbdd51632bca507dd4ae973a6e9bc322f297.zip
gdb-2188cbdd51632bca507dd4ae973a6e9bc322f297.tar.gz
gdb-2188cbdd51632bca507dd4ae973a6e9bc322f297.tar.bz2
2001-12-09 Elena Zannoni <ezannoni@redhat.com>
* config/rs6000/tm-rs6000.h (STAB_REG_TO_REGNUM): Remove definition, it is now multiarched. * ppc-tdep.h (struct gdbarch_tdep): Move from rs6000-tdep.c. Add fields for special register numbers. * rs6000-tdep.c (rs6000_gdbarch_init): Initialize new tdep special regnum fields. (rs6000_saved_pc_after_call): Use gdbarch_tdep registers fields instead of hardcoded macros. (branch_dest, rs6000_pop_frame, rs6000_fix_call_dummy, ppc_push_return_address, rs6000_frame_saved_pc, frame_get_saved_regs, rs6000_frame_chain, rs6000_store_return_value): Ditto. (rs6000_stab_reg_to_regnum): New function. * ppcnbsd-nat.c (fetch_inferior_registers, store_inferior_registers, fetch_core_registers): Ditto. * ppc-linux-tdep.c (ppc_linux_in_sigtramp, ppc_linux_frame_init_saved_regs): Ditto. * ppc-linux-nat.c (ppc_register_u_addr, supply_gregset, fill_gregset): Ditto. * ppc-bdm.c (bdm_ppc_fetch_registers, bdm_ppc_store_registers): Ditto.
Diffstat (limited to 'gdb/ppc-linux-tdep.c')
-rw-r--r--gdb/ppc-linux-tdep.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c
index fb60385..5c1fa28 100644
--- a/gdb/ppc-linux-tdep.c
+++ b/gdb/ppc-linux-tdep.c
@@ -156,7 +156,7 @@ ppc_linux_in_sigtramp (CORE_ADDR pc, char *func_name)
char buf[4];
CORE_ADDR handler;
- lr = read_register (PPC_LR_REGNUM);
+ lr = read_register (gdbarch_tdep (current_gdbarch)->ppc_lr_regnum);
if (!ppc_linux_at_sigtramp_return_path (lr))
return 0;
@@ -378,14 +378,21 @@ ppc_linux_frame_init_saved_regs (struct frame_info *fi)
regs_addr =
read_memory_integer (fi->frame + PPC_LINUX_REGS_PTR_OFFSET, 4);
fi->saved_regs[PC_REGNUM] = regs_addr + 4 * PPC_LINUX_PT_NIP;
- fi->saved_regs[PPC_PS_REGNUM] = regs_addr + 4 * PPC_LINUX_PT_MSR;
- fi->saved_regs[PPC_CR_REGNUM] = regs_addr + 4 * PPC_LINUX_PT_CCR;
- fi->saved_regs[PPC_LR_REGNUM] = regs_addr + 4 * PPC_LINUX_PT_LNK;
- fi->saved_regs[PPC_CTR_REGNUM] = regs_addr + 4 * PPC_LINUX_PT_CTR;
- fi->saved_regs[PPC_XER_REGNUM] = regs_addr + 4 * PPC_LINUX_PT_XER;
- fi->saved_regs[PPC_MQ_REGNUM] = regs_addr + 4 * PPC_LINUX_PT_MQ;
+ fi->saved_regs[gdbarch_tdep (current_gdbarch)->ppc_ps_regnum] =
+ regs_addr + 4 * PPC_LINUX_PT_MSR;
+ fi->saved_regs[gdbarch_tdep (current_gdbarch)->ppc_cr_regnum] =
+ regs_addr + 4 * PPC_LINUX_PT_CCR;
+ fi->saved_regs[gdbarch_tdep (current_gdbarch)->ppc_lr_regnum] =
+ regs_addr + 4 * PPC_LINUX_PT_LNK;
+ fi->saved_regs[gdbarch_tdep (current_gdbarch)->ppc_ctr_regnum] =
+ regs_addr + 4 * PPC_LINUX_PT_CTR;
+ fi->saved_regs[gdbarch_tdep (current_gdbarch)->ppc_xer_regnum] =
+ regs_addr + 4 * PPC_LINUX_PT_XER;
+ fi->saved_regs[gdbarch_tdep (current_gdbarch)->ppc_mq_regnum] =
+ regs_addr + 4 * PPC_LINUX_PT_MQ;
for (i = 0; i < 32; i++)
- fi->saved_regs[PPC_GP0_REGNUM + i] = regs_addr + 4 * PPC_LINUX_PT_R0 + 4 * i;
+ fi->saved_regs[gdbarch_tdep (current_gdbarch)->ppc_gp0_regnum + i] =
+ regs_addr + 4 * PPC_LINUX_PT_R0 + 4 * i;
for (i = 0; i < 32; i++)
fi->saved_regs[FP0_REGNUM + i] = regs_addr + 4 * PPC_LINUX_PT_FPR0 + 8 * i;
}