From 2188cbdd51632bca507dd4ae973a6e9bc322f297 Mon Sep 17 00:00:00 2001 From: Elena Zannoni Date: Sun, 9 Dec 2001 21:39:53 +0000 Subject: 2001-12-09 Elena Zannoni * 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. --- gdb/ppc-tdep.h | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'gdb/ppc-tdep.h') diff --git a/gdb/ppc-tdep.h b/gdb/ppc-tdep.h index 9ed1567..8745cb0 100644 --- a/gdb/ppc-tdep.h +++ b/gdb/ppc-tdep.h @@ -44,16 +44,23 @@ int rs6000_frameless_function_invocation (struct frame_info *); void rs6000_frame_init_saved_regs (struct frame_info *); CORE_ADDR rs6000_frame_chain (struct frame_info *); -/* Some important register numbers. */ - -#define PPC_GP0_REGNUM 0 /* GPR register 0 */ -#define PPC_GPLAST_REGNUM 31 /* GPR register 31 */ -#define PPC_TOC_REGNUM 2 /* TOC register */ -#define PPC_PS_REGNUM 65 /* Processor (or machine) status (%msr) */ -#define PPC_CR_REGNUM 66 /* Condition register */ -#define PPC_LR_REGNUM 67 /* Link register */ -#define PPC_CTR_REGNUM 68 /* Count register */ -#define PPC_XER_REGNUM 69 /* Integer exception register */ -#define PPC_MQ_REGNUM 70 /* Multiply/Divide extension register */ +/* Private data that this module attaches to struct gdbarch. */ + +struct gdbarch_tdep + { + int wordsize; /* size in bytes of fixed-point word */ + int osabi; /* OS / ABI from ELF header */ + int *regoff; /* byte offsets in register arrays */ + const struct reg *regs; /* from current variant */ + int ppc_gp0_regnum; /* GPR register 0 */ + int ppc_gplast_regnum; /* GPR register 31 */ + int ppc_toc_regnum; /* TOC register */ + int ppc_ps_regnum; /* Processor (or machine) status (%msr) */ + int ppc_cr_regnum; /* Condition register */ + int ppc_lr_regnum; /* Link register */ + int ppc_ctr_regnum; /* Count register */ + int ppc_xer_regnum; /* Integer exception register */ + int ppc_mq_regnum; /* Multiply/Divide extension register */ +}; #endif -- cgit v1.1