* gdbarch.sh (SP_REGNUM): Replace by gdbarch_sp_regnum.
* v850-tdep.c (v850_unwind_sp): Likewise.
* std-regs.c (value_of_builtin_frame_sp_reg): Likewise.
* stack.c (frame_info): Likewise.
* stabsread.c (define_symbol): Likewise.
* sh-tdep.c (sh_push_dummy_call_fpu, sh_push_dummy_call_nofpu)
(sh_dwarf2_frame_init_reg, sh_frame_cache, sh_frame_prev_register)
(sh_unwind_sp): Likewise.
* sh64-tdep.c (sh64_push_dummy_call, sh64_frame_cache)
(sh64_frame_prev_register, sh64_unwind_sp): Likewise.
* rs6000-tdep.c (rs6000_push_dummy_call, rs6000_unwind_dummy_id)
(rs6000_frame_cache): Likewise.
* rs6000-nat.c (store_register): Likewise.
* remote-mips.c (mips_wait): Likewise.
* procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call)
(ppc64_sysv_abi_push_dummy_call): Likewise.
* ppcobsd-tdep.c (ppcobsd_sigtramp_frame_cache): Likewise.
* ppcobsd-nat.c (ppcobsd_supply_pcb): Likewise.
* ppcnbsd-tdep.c (ppcnbsd_sigtramp_cache_init): Likewise.
* ppc-linux-tdep.c (ppc_linux_sigtramp_cache): Likewise.
* m32r-rom.c (m32r_supply_register): Likewise.
* frame.c (frame_sp_unwind): Likewise.
* mips-tdep.c (mips_insn16_frame_cache)
(mips_insn32_frame_cache): Likewise (comment).
* m68klinux-nat.c (supply_gregset): Likewise.
* m68k-tdep.c (m68k_get_longjmp_target): Likewise.
* ia64-tdep.c (ia64_frame_prev_register): Likewise.
* i386-tdep.c (i386_get_longjmp_target): Likewise.
* dwarf2-frame.c (dwarf2_frame_default_init_reg): Likewise.
* cris-tdep.c (cris_regnums, cris_sigcontext_addr)
(cris_sigtramp_frame_unwind_cache, cris_push_dummy_call)
(cris_scan_prologue, crisv32_scan_prologue, cris_unwind_sp)
(cris_register_type, crisv32_register_type)
(cris_dwarf2_frame_init_reg): Likewise.
* arch-utils.c (legacy_virtual_frame_pointer): Likewise.
* amd64-tdep.c (amd64_frame_prev_register): Likewise.
* amd64-linux-tdep.c (amd64_linux_sigcontext_addr): Likewise.
* libunwind-frame.c (libunwind_frame_cache): Likewise.
* gdbarch.sh (PC_REGNUM): Replace by gdbarch_pc_regnum.
* regcache.c (read_pc_pid, generic_target_write_pc): Likewise.
* xtensa-tdep.c (xtensa_register_type, xtensa_supply_gregset)
(xtensa_unwind_pc, xtensa_frame_cache, xtensa_frame_prev_register)
(xtensa_extract_return_value, xtensa_store_return_value): Likewise.
* v850-tdep.c (v850_unwind_pc): Likewise.
* stack.c (frame_info): Likewise.
* sh-tdep.c (sh_generic_show_regs, sh3_show_regs, sh2e_show_regs)
(sh2a_show_regs, sh2a_nofpu_show_regs, sh3e_show_regs)
(sh3_dsp_show_regs, sh4_show_regs, sh4_nofpu_show_regs)
(sh_dwarf2_frame_init_reg, sh_frame_prev_register, sh_unwind_pc)
(sh_dsp_show_regs): Likewise.
* shnbsd-tdep.c (shnbsd_supply_gregset)
(shnbsd_collect_gregset): Likewise.
* shnbsd-nat.c (GETREGS_SUPPLIES): Likewise.
* sh64-tdep.c (sh64_compact_reg_base_num, sh64_show_media_regs)
(sh64_frame_prev_register, sh64_unwind_pc): Likewise.
* rs6000-tdep.c (ppc_supply_gregset, ppc_collect_gregset)
(6000_register_reggroup_p, rs6000_unwind_pc)
(rs6000_frame_cache): Likewise.
* rs6000-nat.c (regmap, rs6000_fetch_inferior_registers)
(rs6000_store_inferior_registers): Likewise.
* remote-mips.c (mips_wait, mips_load): Likewise.
* procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise.
* ppcobsd-tdep.c (ppcobsd_sigtramp_frame_cache): Likewise.
* ppcobsd-nat.c (ppcobsd_supply_pcb): Likewise.
* ppcnbsd-tdep.c (ppcnbsd_sigtramp_cache_init): Likewise.
* ppcnbsd-nat.c (getregs_supplies, ppcnbsd_supply_pcb): Likewise.
* ppc-linux-tdep.c (ppc_linux_sigtramp_cache): Likewise.
* ppc-linux-nat.c (ppc_register_u_addr, fetch_ppc_registers)
(store_ppc_registers, fill_gregset): Likewise.
* mips-tdep.c (mips_stub_frame_cache, mips_gdbarch_init): Likewise.
* mipsnbsd-tdep.c (mipsnbsd_supply_reg, mipsnbsd_fill_reg): Likewise.
* mipsnbsd-nat.c (getregs_supplies): Likewise.
* m68k-tdep.c (m68k_register_type, m68k_unwind_pc): Likewise.
* m68klinux-nat.c (supply_gregset): Likewise.
* irix5-nat.c (fill_gregset): Likewise.
* i386-tdep.c (i386_unwind_pc): Likewise.
* i386-linux-nat.c (i386_linux_resume): Likewise.
* frame.c (get_prev_frame_1): Likewise.
* dwarf2-frame.c (dwarf2_frame_default_init_reg): Likewise.
* dbug-rom.c (dbug_supply_register): Likewise.
* cris-tdep.c (cris_sigtramp_frame_unwind_cache, cris_scan_prologue)
(crisv32_scan_prologue, cris_unwind_pc, cris_register_size)
(cris_register_type, crisv32_register_type, crisv32_register_name)
(cris_dwarf2_frame_init_reg, find_step_target)
(cris_software_single_step, cris_supply_gregset)
(cris_regnums): Likewise.
* alpha-linux-nat.c (alpha_linux_register_u_offset): Likewise.
* aix-thread.c (special_register_p, supply_sprs64, supply_sprs32)
(fill_sprs64, fill_sprs32, store_regs_user_thread): Likewise.
* mips-linux-tdep.c (mips_linux_write_pc): Likewise.
* gdbarch.sh (PS_REGNUM): Replace by gdbarch_ps_regnum.
* dbug-rom.c (dbug_supply_register): Likewise.
* xtensa-tdep.c (xtensa_supply_gregset, xtensa_frame_cache)
(xtensa_frame_prev_register, xtensa_push_dummy_call): Likewise.
* win32-nat.c (win32_resume): Likewise.
* std-regs.c (value_of_builtin_frame_ps_reg)
(value_of_builtin_frame_pc_reg): Likewise.
* m68k-tdep.c (m68k_register_type): Likewise.
* m68klinux-nat.c (supply_gregset): Likewise.
* gdbarch.sh (FP0_REGNUM): Replace by gdbarch_fp0_regnum.
* sh-tdep.c (sh_extract_return_value_fpu, sh_store_return_value_fpu)
(sh2e_show_regs, sh2a_show_regs, sh3e_show_regs, sh4_show_regs)
(sh_sh2a_register_type, sh_sh3e_register_type, sh_sh4_register_type)
(fv_reg_base_num, dr_reg_base_num): Likewise.
* sh64-tdep.c (sh64_fv_reg_base_num, sh64_dr_reg_base_num)
(sh64_fpp_reg_base_num, sh64_compact_reg_base_num, sh64_push_dummy_call)
(sh64_extract_return_value, sh64_store_return_value)
(sh64_show_media_regs, sh64_show_compact_regs, sh64_register_type)
(sh64_do_fp_register, sh64_media_print_registers_info): Likewise.
* procfs.c (procfs_fetch_registers, procfs_store_registers)
(invalidate_cache): Likewise.
* ppc-linux-tdep.c (ppc_linux_sigtramp_cache): Likewise.
* mipsnbsd-tdep.c (mipsnbsd_supply_fpreg)
(mipsnbsd_fill_fpreg): Likewise.
* mipsnbsd-nat.c (mipsnbsd_fetch_inferior_registers)
(mipsnbsd_store_inferior_registers): Likewise.
* mips-linux-tdep.c (mips_supply_fpregset, mips_fill_fpregset)
(mips64_supply_fpregset, mips64_fill_fpregset): Likewise.
* mips-linux-nat.c (mips64_linux_register_addr): Likewise.
* m68k-tdep.c (m68k_register_type, m68k_convert_register_p): Likewise.
* m68klinux-nat.c (getfpregs_supplies, supply_fpregset)
(fill_fpregset): Likewise.
* irix5-nat.c (supply_fpregset, fill_fpregset): Likewise.
* i386-tdep.h (struct_return): Likewise (comment).
* i386-nto-tdep.c (i386nto_register_area): Likewise.
* go32-nat.c (fetch_register, go32_fetch_registers, store_register)
(go32_store_registers): Likewise.
* alpha-tdep.c (alpha_next_pc): Likewise.
* alpha-linux-nat.c (alpha_linux_register_u_offset): Likewise.
* alphabsd-nat.c (alphabsd_fetch_inferior_registers)
(alphabsd_store_inferior_registers): Likewise.
* core-regset.c (fetch_core_registers): Likewise.
* i386v4-nat.c (supply_fpregset, fill_fpregset): Likewise.
* gdbarch.c, gdbarch.h: Regenerate.
+2007-06-18 Markus Deuling <deuling@de.ibm.com>
+
+ * gdbarch.sh (SP_REGNUM): Replace by gdbarch_sp_regnum.
+ * v850-tdep.c (v850_unwind_sp): Likewise.
+ * std-regs.c (value_of_builtin_frame_sp_reg): Likewise.
+ * stack.c (frame_info): Likewise.
+ * stabsread.c (define_symbol): Likewise.
+ * sh-tdep.c (sh_push_dummy_call_fpu, sh_push_dummy_call_nofpu)
+ (sh_dwarf2_frame_init_reg, sh_frame_cache, sh_frame_prev_register)
+ (sh_unwind_sp): Likewise.
+ * sh64-tdep.c (sh64_push_dummy_call, sh64_frame_cache)
+ (sh64_frame_prev_register, sh64_unwind_sp): Likewise.
+ * rs6000-tdep.c (rs6000_push_dummy_call, rs6000_unwind_dummy_id)
+ (rs6000_frame_cache): Likewise.
+ * rs6000-nat.c (store_register): Likewise.
+ * remote-mips.c (mips_wait): Likewise.
+ * procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise.
+ * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call)
+ (ppc64_sysv_abi_push_dummy_call): Likewise.
+ * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_cache): Likewise.
+ * ppcobsd-nat.c (ppcobsd_supply_pcb): Likewise.
+ * ppcnbsd-tdep.c (ppcnbsd_sigtramp_cache_init): Likewise.
+ * ppc-linux-tdep.c (ppc_linux_sigtramp_cache): Likewise.
+ * m32r-rom.c (m32r_supply_register): Likewise.
+ * frame.c (frame_sp_unwind): Likewise.
+ * mips-tdep.c (mips_insn16_frame_cache)
+ (mips_insn32_frame_cache): Likewise (comment).
+ * m68klinux-nat.c (supply_gregset): Likewise.
+ * m68k-tdep.c (m68k_get_longjmp_target): Likewise.
+ * ia64-tdep.c (ia64_frame_prev_register): Likewise.
+ * i386-tdep.c (i386_get_longjmp_target): Likewise.
+ * dwarf2-frame.c (dwarf2_frame_default_init_reg): Likewise.
+ * cris-tdep.c (cris_regnums, cris_sigcontext_addr)
+ (cris_sigtramp_frame_unwind_cache, cris_push_dummy_call)
+ (cris_scan_prologue, crisv32_scan_prologue, cris_unwind_sp)
+ (cris_register_type, crisv32_register_type)
+ (cris_dwarf2_frame_init_reg): Likewise.
+ * arch-utils.c (legacy_virtual_frame_pointer): Likewise.
+ * amd64-tdep.c (amd64_frame_prev_register): Likewise.
+ * amd64-linux-tdep.c (amd64_linux_sigcontext_addr): Likewise.
+ * libunwind-frame.c (libunwind_frame_cache): Likewise.
+
+ * gdbarch.sh (PC_REGNUM): Replace by gdbarch_pc_regnum.
+ * regcache.c (read_pc_pid, generic_target_write_pc): Likewise.
+ * xtensa-tdep.c (xtensa_register_type, xtensa_supply_gregset)
+ (xtensa_unwind_pc, xtensa_frame_cache, xtensa_frame_prev_register)
+ (xtensa_extract_return_value, xtensa_store_return_value): Likewise.
+ * v850-tdep.c (v850_unwind_pc): Likewise.
+ * stack.c (frame_info): Likewise.
+ * sh-tdep.c (sh_generic_show_regs, sh3_show_regs, sh2e_show_regs)
+ (sh2a_show_regs, sh2a_nofpu_show_regs, sh3e_show_regs)
+ (sh3_dsp_show_regs, sh4_show_regs, sh4_nofpu_show_regs)
+ (sh_dwarf2_frame_init_reg, sh_frame_prev_register, sh_unwind_pc)
+ (sh_dsp_show_regs): Likewise.
+ * shnbsd-tdep.c (shnbsd_supply_gregset)
+ (shnbsd_collect_gregset): Likewise.
+ * shnbsd-nat.c (GETREGS_SUPPLIES): Likewise.
+ * sh64-tdep.c (sh64_compact_reg_base_num, sh64_show_media_regs)
+ (sh64_frame_prev_register, sh64_unwind_pc): Likewise.
+ * rs6000-tdep.c (ppc_supply_gregset, ppc_collect_gregset)
+ (6000_register_reggroup_p, rs6000_unwind_pc)
+ (rs6000_frame_cache): Likewise.
+ * rs6000-nat.c (regmap, rs6000_fetch_inferior_registers)
+ (rs6000_store_inferior_registers): Likewise.
+ * remote-mips.c (mips_wait, mips_load): Likewise.
+ * procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise.
+ * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_cache): Likewise.
+ * ppcobsd-nat.c (ppcobsd_supply_pcb): Likewise.
+ * ppcnbsd-tdep.c (ppcnbsd_sigtramp_cache_init): Likewise.
+ * ppcnbsd-nat.c (getregs_supplies, ppcnbsd_supply_pcb): Likewise.
+ * ppc-linux-tdep.c (ppc_linux_sigtramp_cache): Likewise.
+ * ppc-linux-nat.c (ppc_register_u_addr, fetch_ppc_registers)
+ (store_ppc_registers, fill_gregset): Likewise.
+ * mips-tdep.c (mips_stub_frame_cache, mips_gdbarch_init): Likewise.
+ * mipsnbsd-tdep.c (mipsnbsd_supply_reg, mipsnbsd_fill_reg): Likewise.
+ * mipsnbsd-nat.c (getregs_supplies): Likewise.
+ * m68k-tdep.c (m68k_register_type, m68k_unwind_pc): Likewise.
+ * m68klinux-nat.c (supply_gregset): Likewise.
+ * irix5-nat.c (fill_gregset): Likewise.
+ * i386-tdep.c (i386_unwind_pc): Likewise.
+ * i386-linux-nat.c (i386_linux_resume): Likewise.
+ * frame.c (get_prev_frame_1): Likewise.
+ * dwarf2-frame.c (dwarf2_frame_default_init_reg): Likewise.
+ * dbug-rom.c (dbug_supply_register): Likewise.
+ * cris-tdep.c (cris_sigtramp_frame_unwind_cache, cris_scan_prologue)
+ (crisv32_scan_prologue, cris_unwind_pc, cris_register_size)
+ (cris_register_type, crisv32_register_type, crisv32_register_name)
+ (cris_dwarf2_frame_init_reg, find_step_target)
+ (cris_software_single_step, cris_supply_gregset)
+ (cris_regnums): Likewise.
+ * alpha-linux-nat.c (alpha_linux_register_u_offset): Likewise.
+ * aix-thread.c (special_register_p, supply_sprs64, supply_sprs32)
+ (fill_sprs64, fill_sprs32, store_regs_user_thread): Likewise.
+ * std-regs.c (value_of_builtin_frame_pc_reg): Likewise.
+ * mips-linux-tdep.c (mips_linux_write_pc): Likewise.
+
+ * gdbarch.sh (PS_REGNUM): Replace by gdbarch_ps_regnum.
+ * dbug-rom.c (dbug_supply_register): Likewise.
+ * xtensa-tdep.c (xtensa_supply_gregset, xtensa_frame_cache)
+ (xtensa_frame_prev_register, xtensa_push_dummy_call): Likewise.
+ * win32-nat.c (win32_resume): Likewise.
+ * std-regs.c (value_of_builtin_frame_ps_reg): Likewise.
+ * m68k-tdep.c (m68k_register_type): Likewise.
+ * m68klinux-nat.c (supply_gregset): Likewise.
+
+ * gdbarch.sh (FP0_REGNUM): Replace by gdbarch_fp0_regnum.
+ * sh-tdep.c (sh_extract_return_value_fpu, sh_store_return_value_fpu)
+ (sh2e_show_regs, sh2a_show_regs, sh3e_show_regs, sh4_show_regs)
+ (sh_sh2a_register_type, sh_sh3e_register_type, sh_sh4_register_type)
+ (fv_reg_base_num, dr_reg_base_num): Likewise.
+ * sh64-tdep.c (sh64_fv_reg_base_num, sh64_dr_reg_base_num)
+ (sh64_fpp_reg_base_num, sh64_compact_reg_base_num, sh64_push_dummy_call)
+ (sh64_extract_return_value, sh64_store_return_value)
+ (sh64_show_media_regs, sh64_show_compact_regs, sh64_register_type)
+ (sh64_do_fp_register, sh64_media_print_registers_info): Likewise.
+ * procfs.c (procfs_fetch_registers, procfs_store_registers)
+ (invalidate_cache): Likewise.
+ * ppc-linux-tdep.c (ppc_linux_sigtramp_cache): Likewise.
+ * mipsnbsd-tdep.c (mipsnbsd_supply_fpreg)
+ (mipsnbsd_fill_fpreg): Likewise.
+ * mipsnbsd-nat.c (mipsnbsd_fetch_inferior_registers)
+ (mipsnbsd_store_inferior_registers): Likewise.
+ * mips-linux-tdep.c (mips_supply_fpregset, mips_fill_fpregset)
+ (mips64_supply_fpregset, mips64_fill_fpregset): Likewise.
+ * mips-linux-nat.c (mips64_linux_register_addr): Likewise.
+ * m68k-tdep.c (m68k_register_type, m68k_convert_register_p): Likewise.
+ * m68klinux-nat.c (getfpregs_supplies, supply_fpregset)
+ (fill_fpregset): Likewise.
+ * irix5-nat.c (supply_fpregset, fill_fpregset): Likewise.
+ * i386-tdep.h (struct_return): Likewise (comment).
+ * i386-nto-tdep.c (i386nto_register_area): Likewise.
+ * go32-nat.c (fetch_register, go32_fetch_registers, store_register)
+ (go32_store_registers): Likewise.
+ * alpha-tdep.c (alpha_next_pc): Likewise.
+ * alpha-linux-nat.c (alpha_linux_register_u_offset): Likewise.
+ * alphabsd-nat.c (alphabsd_fetch_inferior_registers)
+ (alphabsd_store_inferior_registers): Likewise.
+ * core-regset.c (fetch_core_registers): Likewise.
+ * i386v4-nat.c (supply_fpregset, fill_fpregset): Likewise.
+
+ * gdbarch.c, gdbarch.h: Regenerate.
+
2007-06-18 Daniel Jacobowitz <dan@codesourcery.com>
* coffread.c (coff_sym_fns): Add default_symfile_segments.
{
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
- return regno == PC_REGNUM
+ return regno == gdbarch_pc_regnum (current_gdbarch)
|| regno == tdep->ppc_ps_regnum
|| regno == tdep->ppc_cr_regnum
|| regno == tdep->ppc_lr_regnum
{
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
- regcache_raw_supply (regcache, PC_REGNUM, (char *) &iar);
+ regcache_raw_supply (regcache, gdbarch_pc_regnum (current_gdbarch),
+ (char *) &iar);
regcache_raw_supply (regcache, tdep->ppc_ps_regnum, (char *) &msr);
regcache_raw_supply (regcache, tdep->ppc_cr_regnum, (char *) &cr);
regcache_raw_supply (regcache, tdep->ppc_lr_regnum, (char *) &lr);
{
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
- regcache_raw_supply (regcache, PC_REGNUM, (char *) &iar);
+ regcache_raw_supply (regcache, gdbarch_pc_regnum (current_gdbarch),
+ (char *) &iar);
regcache_raw_supply (regcache, tdep->ppc_ps_regnum, (char *) &msr);
regcache_raw_supply (regcache, tdep->ppc_cr_regnum, (char *) &cr);
regcache_raw_supply (regcache, tdep->ppc_lr_regnum, (char *) &lr);
they're not, then either GDB has been built incorrectly, or
there's some other kind of internal error. To be really safe,
we should check all of the sizes. */
- gdb_assert (sizeof (*iar) == register_size (current_gdbarch, PC_REGNUM));
+ gdb_assert (sizeof (*iar) == register_size
+ (current_gdbarch,
+ gdbarch_pc_regnum (current_gdbarch)));
- if (regcache_valid_p (regcache, PC_REGNUM))
- regcache_raw_collect (regcache, PC_REGNUM, iar);
+ if (regcache_valid_p (regcache, gdbarch_pc_regnum (current_gdbarch)))
+ regcache_raw_collect (regcache, gdbarch_pc_regnum (current_gdbarch), iar);
if (regcache_valid_p (regcache, tdep->ppc_ps_regnum))
regcache_raw_collect (regcache, tdep->ppc_ps_regnum, msr);
if (regcache_valid_p (regcache, tdep->ppc_cr_regnum))
they're not, then either GDB has been built incorrectly, or
there's some other kind of internal error. To be really safe,
we should check all of the sizes. */
- gdb_assert (sizeof (*iar) == register_size (current_gdbarch, PC_REGNUM));
+ gdb_assert (sizeof (*iar) == register_size (current_gdbarch,
+ gdbarch_pc_regnum
+ (current_gdbarch)));
- if (regcache_valid_p (regcache, PC_REGNUM))
- regcache_raw_collect (regcache, PC_REGNUM, iar);
+ if (regcache_valid_p (regcache, gdbarch_pc_regnum (current_gdbarch)))
+ regcache_raw_collect (regcache, gdbarch_pc_regnum (current_gdbarch), iar);
if (regcache_valid_p (regcache, tdep->ppc_ps_regnum))
regcache_raw_collect (regcache, tdep->ppc_ps_regnum, msr);
if (regcache_valid_p (regcache, tdep->ppc_cr_regnum))
fill_sprs32 (regcache, &tmp_iar, &tmp_msr, &tmp_cr, &tmp_lr, &tmp_ctr,
&tmp_xer, &tmp_fpscr);
- if (regcache_valid_p (regcache, PC_REGNUM))
+ if (regcache_valid_p (regcache, gdbarch_pc_regnum (current_gdbarch)))
ctx.iar = tmp_iar;
if (regcache_valid_p (regcache, tdep->ppc_ps_regnum))
ctx.msr = tmp_msr;
static CORE_ADDR
alpha_linux_register_u_offset (struct gdbarch *gdbarch, int regno, int store_p)
{
- if (regno == PC_REGNUM)
+ if (regno == gdbarch_pc_regnum (current_gdbarch))
return PC;
if (regno == ALPHA_UNIQUE_REGNUM)
return ALPHA_UNIQUE_PTRACE_ADDR;
- if (regno < FP0_REGNUM)
+ if (regno < gdbarch_fp0_regnum (current_gdbarch))
return GPR_BASE + regno;
else
- return FPR_BASE + regno - FP0_REGNUM;
+ return FPR_BASE + regno - gdbarch_fp0_regnum (current_gdbarch);
}
void _initialialize_alpha_linux_nat (void);
case 0x33: /* FBLE */
case 0x32: /* FBLT */
case 0x35: /* FBNE */
- regno += FP0_REGNUM;
+ regno += gdbarch_fp0_regnum (current_gdbarch);
}
rav = get_frame_register_signed (frame, regno);
return;
}
- if (regno == -1 || regno >= FP0_REGNUM)
+ if (regno == -1 || regno >= gdbarch_fp0_regnum (current_gdbarch))
{
struct fpreg fpregs;
return;
}
- if (regno == -1 || regno >= FP0_REGNUM)
+ if (regno == -1 || regno >= gdbarch_fp0_regnum (current_gdbarch))
{
struct fpreg fpregs;
CORE_ADDR sp;
gdb_byte buf[8];
- frame_unwind_register (next_frame, SP_REGNUM, buf);
+ frame_unwind_register (next_frame, gdbarch_sp_regnum (current_gdbarch), buf);
sp = extract_unsigned_integer (buf, 8);
/* The sigcontext structure is part of the user context. A pointer
gdb_assert (regnum >= 0);
- if (regnum == SP_REGNUM && cache->saved_sp)
+ if (regnum == gdbarch_sp_regnum (current_gdbarch) && cache->saved_sp)
{
*optimizedp = 0;
*lvalp = not_lval;
if (DEPRECATED_FP_REGNUM >= 0
&& DEPRECATED_FP_REGNUM < gdbarch_num_regs (current_gdbarch))
*frame_regnum = DEPRECATED_FP_REGNUM;
- else if (SP_REGNUM >= 0 && SP_REGNUM < gdbarch_num_regs (current_gdbarch))
- *frame_regnum = SP_REGNUM;
+ else if (gdbarch_sp_regnum (current_gdbarch) >= 0
+ && gdbarch_sp_regnum (current_gdbarch)
+ < gdbarch_num_regs (current_gdbarch))
+ *frame_regnum = gdbarch_sp_regnum (current_gdbarch);
else
/* Should this be an internal error? I guess so, it is reflecting
an architectural limitation in the current design. */
else
{
memcpy (&fpregset, core_reg_sect, sizeof (fpregset));
- if (FP0_REGNUM >= 0)
+ if (gdbarch_fp0_regnum (current_gdbarch) >= 0)
supply_fpregset (regcache, (const gdb_fpregset_t *) &fpregset);
}
break;
ARG2_REGNUM Contains the second parameter to a function.
ARG3_REGNUM Contains the third parameter to a function.
ARG4_REGNUM Contains the fourth parameter to a function. Rest on stack.
- SP_REGNUM Contains address of top of stack.
- PC_REGNUM Contains address of next instruction.
+ gdbarch_sp_regnum Contains address of top of stack.
+ gdbarch_pc_regnum Contains address of next instruction.
SRP_REGNUM Subroutine return pointer register.
BRP_REGNUM Breakpoint return pointer register. */
CORE_ADDR sp;
char buf[4];
- frame_unwind_register (next_frame, SP_REGNUM, buf);
+ frame_unwind_register (next_frame, gdbarch_sp_regnum (current_gdbarch), buf);
sp = extract_unsigned_integer (buf, 4);
/* Look for normal sigtramp frame first. */
info->return_pc = 0;
info->leaf_function = 0;
- frame_unwind_register (next_frame, SP_REGNUM, buf);
+ frame_unwind_register (next_frame, gdbarch_sp_regnum (current_gdbarch), buf);
info->base = extract_unsigned_integer (buf, 4);
addr = cris_sigcontext_addr (next_frame);
it though since that will mean that the backtrace will show a PC
different from what is shown when stopped. */
info->saved_regs[IRP_REGNUM].addr = addr + (19 * 4);
- info->saved_regs[PC_REGNUM] = info->saved_regs[IRP_REGNUM];
- info->saved_regs[SP_REGNUM].addr = addr + (24 * 4);
+ info->saved_regs[gdbarch_pc_regnum (current_gdbarch)]
+ = info->saved_regs[IRP_REGNUM];
+ info->saved_regs[gdbarch_sp_regnum (current_gdbarch)].addr
+ = addr + (24 * 4);
}
else
{
This could be solved by a couple of read_memory_unsigned_integer and a
trad_frame_set_value. */
- info->saved_regs[PC_REGNUM] = info->saved_regs[ERP_REGNUM];
+ info->saved_regs[gdbarch_pc_regnum (current_gdbarch)]
+ = info->saved_regs[ERP_REGNUM];
- info->saved_regs[SP_REGNUM].addr = addr + (25 * 4);
+ info->saved_regs[gdbarch_sp_regnum (current_gdbarch)].addr
+ = addr + (25 * 4);
}
return info;
}
/* Finally, update the SP register. */
- regcache_cooked_write_unsigned (regcache, SP_REGNUM, sp);
+ regcache_cooked_write_unsigned (regcache,
+ gdbarch_sp_regnum (current_gdbarch), sp);
return sp;
}
}
continue;
}
- else if (cris_get_operand2 (insn) == SP_REGNUM
+ else if (cris_get_operand2 (insn) == gdbarch_sp_regnum (current_gdbarch)
&& cris_get_mode (insn) == 0x0000
&& cris_get_opcode (insn) == 0x000A)
{
else if (cris_get_mode (insn) == 0x0002
&& cris_get_opcode (insn) == 0x000F
&& cris_get_size (insn) == 0x0003
- && cris_get_operand1 (insn) == SP_REGNUM)
+ && cris_get_operand1 (insn) == gdbarch_sp_regnum
+ (current_gdbarch))
{
/* movem r<regsave>,[sp] */
regsave = cris_get_operand2 (insn);
}
- else if (cris_get_operand2 (insn) == SP_REGNUM
+ else if (cris_get_operand2 (insn) == gdbarch_sp_regnum (current_gdbarch)
&& ((insn & 0x0F00) >> 8) == 0x0001
&& (cris_get_signed_offset (insn) < 0))
{
if (cris_get_mode (insn_next) == PREFIX_ASSIGN_MODE
&& cris_get_opcode (insn_next) == 0x000F
&& cris_get_size (insn_next) == 0x0003
- && cris_get_operand1 (insn_next) == SP_REGNUM)
+ && cris_get_operand1 (insn_next) == gdbarch_sp_regnum
+ (current_gdbarch))
{
regsave = cris_get_operand2 (insn_next);
}
insn_next = read_memory_unsigned_integer (pc, 2);
pc += 2;
regno = cris_get_operand2 (insn_next);
- if ((regno >= 0 && regno < SP_REGNUM)
+ if ((regno >= 0 && regno < gdbarch_sp_regnum (current_gdbarch))
&& cris_get_mode (insn_next) == PREFIX_OFFSET_MODE
&& cris_get_opcode (insn_next) == 0x000F)
{
insn_next = read_memory_unsigned_integer (pc, 2);
pc += 2;
regno = cris_get_operand2 (insn_next);
- if ((regno >= 0 && regno < SP_REGNUM)
+ if ((regno >= 0 && regno < gdbarch_sp_regnum (current_gdbarch))
&& cris_get_mode (insn_next) == PREFIX_OFFSET_MODE
&& cris_get_opcode (insn_next) == 0x0009
&& cris_get_operand1 (insn_next) == regno)
ULONGEST this_base;
/* Assume that the FP is this frame's SP but with that pushed
stack space added back. */
- frame_unwind_unsigned_register (next_frame, SP_REGNUM, &this_base);
+ frame_unwind_unsigned_register (next_frame,
+ gdbarch_sp_regnum (current_gdbarch),
+ &this_base);
info->base = this_base;
info->prev_sp = info->base + info->size;
}
/* The previous frame's SP needed to be computed. Save the computed
value. */
- trad_frame_set_value (info->saved_regs, SP_REGNUM, info->prev_sp);
+ trad_frame_set_value (info->saved_regs,
+ gdbarch_sp_regnum (current_gdbarch), info->prev_sp);
if (!info->leaf_function)
{
}
/* The PC is found in SRP (the actual register or located on the stack). */
- info->saved_regs[PC_REGNUM] = info->saved_regs[SRP_REGNUM];
+ info->saved_regs[gdbarch_pc_regnum (current_gdbarch)]
+ = info->saved_regs[SRP_REGNUM];
return pc;
}
}
/* The SP is assumed to be unaltered. */
- frame_unwind_unsigned_register (next_frame, SP_REGNUM, &this_base);
+ frame_unwind_unsigned_register (next_frame,
+ gdbarch_sp_regnum (current_gdbarch),
+ &this_base);
info->base = this_base;
info->prev_sp = this_base;
/* The PC is assumed to be found in SRP. */
- info->saved_regs[PC_REGNUM] = info->saved_regs[SRP_REGNUM];
+ info->saved_regs[gdbarch_pc_regnum (current_gdbarch)]
+ = info->saved_regs[SRP_REGNUM];
return pc;
}
cris_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
{
ULONGEST pc;
- frame_unwind_unsigned_register (next_frame, PC_REGNUM, &pc);
+ frame_unwind_unsigned_register (next_frame,
+ gdbarch_pc_regnum (current_gdbarch), &pc);
return pc;
}
cris_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
{
ULONGEST sp;
- frame_unwind_unsigned_register (next_frame, SP_REGNUM, &sp);
+ frame_unwind_unsigned_register (next_frame,
+ gdbarch_sp_regnum (current_gdbarch), &sp);
return sp;
}
/* Special register not applicable to this CRIS version. */
return 0;
}
- else if (regno >= PC_REGNUM && regno < gdbarch_num_regs (current_gdbarch))
+ else if (regno >= gdbarch_pc_regnum (current_gdbarch)
+ && regno < gdbarch_num_regs (current_gdbarch))
{
/* This will apply to CRISv32 only where there are additional registers
after the special registers (pseudo PC and support registers). */
static struct type *
cris_register_type (struct gdbarch *gdbarch, int regno)
{
- if (regno == PC_REGNUM)
+ if (regno == gdbarch_pc_regnum (current_gdbarch))
return builtin_type_void_func_ptr;
- else if (regno == SP_REGNUM || regno == CRIS_FP_REGNUM)
+ else if (regno == gdbarch_sp_regnum (current_gdbarch)
+ || regno == CRIS_FP_REGNUM)
return builtin_type_void_data_ptr;
- else if ((regno >= 0 && regno < SP_REGNUM)
+ else if ((regno >= 0 && regno < gdbarch_sp_regnum (current_gdbarch))
|| (regno >= MOF_REGNUM && regno <= USP_REGNUM))
/* Note: R8 taken care of previous clause. */
return builtin_type_uint32;
static struct type *
crisv32_register_type (struct gdbarch *gdbarch, int regno)
{
- if (regno == PC_REGNUM)
+ if (regno == gdbarch_pc_regnum (current_gdbarch))
return builtin_type_void_func_ptr;
- else if (regno == SP_REGNUM || regno == CRIS_FP_REGNUM)
+ else if (regno == gdbarch_sp_regnum (current_gdbarch)
+ || regno == CRIS_FP_REGNUM)
return builtin_type_void_data_ptr;
else if ((regno >= 0 && regno <= ACR_REGNUM)
|| (regno >= EXS_REGNUM && regno <= SPC_REGNUM)
{
return cris_special_register_name (regno);
}
- else if (regno == PC_REGNUM)
+ else if (regno == gdbarch_pc_regnum (current_gdbarch))
{
return "pc";
}
struct frame_info *next_frame)
{
/* The return address column. */
- if (regnum == PC_REGNUM)
+ if (regnum == gdbarch_pc_regnum (current_gdbarch))
reg->how = DWARF2_FRAME_REG_RA;
/* The call frame address. */
- else if (regnum == SP_REGNUM)
+ else if (regnum == gdbarch_sp_regnum (current_gdbarch))
reg->how = DWARF2_FRAME_REG_CFA;
}
do
{
/* Read an instruction from the client. */
- insn = read_memory_unsigned_integer (inst_env->reg[PC_REGNUM], 2);
+ insn = read_memory_unsigned_integer
+ (inst_env->reg[gdbarch_pc_regnum (current_gdbarch)], 2);
/* If the instruction is not in a delay slot the new content of the
PC is [PC] + 2. If the instruction is in a delay slot it is not
Just make sure it is a valid instruction. */
if (!inst_env->delay_slot_pc_active)
{
- inst_env->reg[PC_REGNUM] += 2;
+ inst_env->reg[gdbarch_pc_regnum (current_gdbarch)] += 2;
}
else
{
inst_env->delay_slot_pc_active = 0;
- inst_env->reg[PC_REGNUM] = inst_env->delay_slot_pc;
+ inst_env->reg[gdbarch_pc_regnum (current_gdbarch)]
+ = inst_env->delay_slot_pc;
}
/* Analyse the present instruction. */
i = find_cris_op (insn, inst_env);
{
/* Insert at most two breakpoints. One for the next PC content
and possibly another one for a branch, jump, etc. */
- CORE_ADDR next_pc = (CORE_ADDR) inst_env.reg[PC_REGNUM];
+ CORE_ADDR next_pc =
+ (CORE_ADDR) inst_env.reg[gdbarch_pc_regnum (current_gdbarch)];
insert_single_step_breakpoint (next_pc);
if (inst_env.branch_found
&& (CORE_ADDR) inst_env.branch_break_address != next_pc)
/* Needed to set pseudo-register PC for CRISv32. */
/* FIXME: If ERP is in a delay slot at this point then the PC will
be wrong. Issue a warning to alert the user. */
- regcache_raw_supply (regcache, PC_REGNUM,
+ regcache_raw_supply (regcache, gdbarch_pc_regnum (current_gdbarch),
(char *)®p[ERP_REGNUM]);
if (*(char *)®p[ERP_REGNUM] & 0x1)
case 'S':
if (regname[1] != 'R')
return;
- regno = PS_REGNUM;
+ regno = gdbarch_ps_regnum (current_gdbarch);
break;
case 'P':
if (regname[1] != 'C')
return;
- regno = PC_REGNUM;
+ regno = gdbarch_pc_regnum (current_gdbarch);
break;
case 'D':
if (regname[1] < '0' || regname[1] > '7')
(e.g. IBM S/390 and zSeries). Those architectures should provide
their own architecture-specific initialization function. */
- if (regnum == PC_REGNUM)
+ if (regnum == gdbarch_pc_regnum (current_gdbarch))
reg->how = DWARF2_FRAME_REG_RA;
- else if (regnum == SP_REGNUM)
+ else if (regnum == gdbarch_sp_regnum (current_gdbarch))
reg->how = DWARF2_FRAME_REG_CFA;
}
method set the same lval and location information as
frame_register_unwind. */
if (this_frame->level > 0
- && PC_REGNUM >= 0
+ && gdbarch_pc_regnum (current_gdbarch) >= 0
&& get_frame_type (this_frame) == NORMAL_FRAME
&& get_frame_type (this_frame->next) == NORMAL_FRAME)
{
enum lval_type lval, nlval;
CORE_ADDR addr, naddr;
- frame_register_unwind_location (this_frame, PC_REGNUM, &optimized,
- &lval, &addr, &realnum);
- frame_register_unwind_location (get_next_frame (this_frame), PC_REGNUM,
+ frame_register_unwind_location (this_frame,
+ gdbarch_pc_regnum (current_gdbarch),
+ &optimized, &lval, &addr, &realnum);
+ frame_register_unwind_location (get_next_frame (this_frame),
+ gdbarch_pc_regnum (current_gdbarch),
&optimized, &nlval, &naddr, &realnum);
if (lval == lval_memory && lval == nlval && addr == naddr)
if (gdbarch_unwind_sp_p (current_gdbarch))
return gdbarch_unwind_sp (current_gdbarch, next_frame);
/* Now things are really are grim. Hope that the value returned by
- the SP_REGNUM register is meaningful. */
- if (SP_REGNUM >= 0)
+ the gdbarch_sp_regnum register is meaningful. */
+ if (gdbarch_sp_regnum (current_gdbarch) >= 0)
{
ULONGEST sp;
- frame_unwind_unsigned_register (next_frame, SP_REGNUM, &sp);
+ frame_unwind_unsigned_register (next_frame,
+ gdbarch_sp_regnum (current_gdbarch), &sp);
return sp;
}
internal_error (__FILE__, __LINE__, _("Missing unwind SP method"));
fprintf_unfiltered (file,
"gdbarch_dump: float_format = %s\n",
pformat (current_gdbarch->float_format));
-#ifdef FP0_REGNUM
- fprintf_unfiltered (file,
- "gdbarch_dump: FP0_REGNUM # %s\n",
- XSTRING (FP0_REGNUM));
-#endif
fprintf_unfiltered (file,
"gdbarch_dump: fp0_regnum = %s\n",
paddr_d (current_gdbarch->fp0_regnum));
fprintf_unfiltered (file,
"gdbarch_dump: overlay_update = <0x%lx>\n",
(long) current_gdbarch->overlay_update);
-#ifdef PC_REGNUM
- fprintf_unfiltered (file,
- "gdbarch_dump: PC_REGNUM # %s\n",
- XSTRING (PC_REGNUM));
-#endif
fprintf_unfiltered (file,
"gdbarch_dump: pc_regnum = %s\n",
paddr_d (current_gdbarch->pc_regnum));
fprintf_unfiltered (file,
"gdbarch_dump: print_vector_info = <0x%lx>\n",
(long) current_gdbarch->print_vector_info);
-#ifdef PS_REGNUM
- fprintf_unfiltered (file,
- "gdbarch_dump: PS_REGNUM # %s\n",
- XSTRING (PS_REGNUM));
-#endif
fprintf_unfiltered (file,
"gdbarch_dump: ps_regnum = %s\n",
paddr_d (current_gdbarch->ps_regnum));
fprintf_unfiltered (file,
"gdbarch_dump: software_single_step = <0x%lx>\n",
(long) current_gdbarch->software_single_step);
-#ifdef SP_REGNUM
- fprintf_unfiltered (file,
- "gdbarch_dump: SP_REGNUM # %s\n",
- XSTRING (SP_REGNUM));
-#endif
fprintf_unfiltered (file,
"gdbarch_dump: sp_regnum = %s\n",
paddr_d (current_gdbarch->sp_regnum));
/* GDB's standard (or well known) register numbers. These can map onto
a real register or a pseudo (computed) register or not be defined at
all (-1).
- SP_REGNUM will hopefully be replaced by UNWIND_SP. */
+ gdbarch_sp_regnum will hopefully be replaced by UNWIND_SP. */
extern int gdbarch_sp_regnum (struct gdbarch *gdbarch);
extern void set_gdbarch_sp_regnum (struct gdbarch *gdbarch, int sp_regnum);
-#if !defined (GDB_TM_FILE) && defined (SP_REGNUM)
-#error "Non multi-arch definition of SP_REGNUM"
-#endif
-#if !defined (SP_REGNUM)
-#define SP_REGNUM (gdbarch_sp_regnum (current_gdbarch))
-#endif
extern int gdbarch_pc_regnum (struct gdbarch *gdbarch);
extern void set_gdbarch_pc_regnum (struct gdbarch *gdbarch, int pc_regnum);
-#if !defined (GDB_TM_FILE) && defined (PC_REGNUM)
-#error "Non multi-arch definition of PC_REGNUM"
-#endif
-#if !defined (PC_REGNUM)
-#define PC_REGNUM (gdbarch_pc_regnum (current_gdbarch))
-#endif
extern int gdbarch_ps_regnum (struct gdbarch *gdbarch);
extern void set_gdbarch_ps_regnum (struct gdbarch *gdbarch, int ps_regnum);
-#if !defined (GDB_TM_FILE) && defined (PS_REGNUM)
-#error "Non multi-arch definition of PS_REGNUM"
-#endif
-#if !defined (PS_REGNUM)
-#define PS_REGNUM (gdbarch_ps_regnum (current_gdbarch))
-#endif
extern int gdbarch_fp0_regnum (struct gdbarch *gdbarch);
extern void set_gdbarch_fp0_regnum (struct gdbarch *gdbarch, int fp0_regnum);
-#if !defined (GDB_TM_FILE) && defined (FP0_REGNUM)
-#error "Non multi-arch definition of FP0_REGNUM"
-#endif
-#if !defined (FP0_REGNUM)
-#define FP0_REGNUM (gdbarch_fp0_regnum (current_gdbarch))
-#endif
/* Convert stab register number (from `r' declaration) to a gdb REGNUM. */
# GDB's standard (or well known) register numbers. These can map onto
# a real register or a pseudo (computed) register or not be defined at
# all (-1).
-# SP_REGNUM will hopefully be replaced by UNWIND_SP.
-v:=:int:sp_regnum:::-1:-1::0
-v:=:int:pc_regnum:::-1:-1::0
-v:=:int:ps_regnum:::-1:-1::0
-v:=:int:fp0_regnum:::0:-1::0
+# gdbarch_sp_regnum will hopefully be replaced by UNWIND_SP.
+v::int:sp_regnum:::-1:-1::0
+v::int:pc_regnum:::-1:-1::0
+v::int:ps_regnum:::-1:-1::0
+v::int:fp0_regnum:::0:-1::0
# Convert stab register number (from \`r\' declaration) to a gdb REGNUM.
f::int:stab_reg_to_regnum:int stab_regnr:stab_regnr::no_op_reg_to_regnum::0
# Provide a default mapping from a ecoff register number to a gdb REGNUM.
static void
fetch_register (struct regcache *regcache, int regno)
{
- if (regno < FP0_REGNUM)
+ if (regno < gdbarch_fp0_regnum (current_gdbarch))
regcache_raw_supply (regcache, regno,
(char *) &a_tss + regno_mapping[regno].tss_ofs);
else if (i386_fp_regnum_p (regno) || i386_fpc_regnum_p (regno))
fetch_register (regcache, regno);
else
{
- for (regno = 0; regno < FP0_REGNUM; regno++)
+ for (regno = 0; regno < gdbarch_fp0_regnum (current_gdbarch); regno++)
fetch_register (regcache, regno);
i387_supply_fsave (regcache, -1, &npx);
}
static void
store_register (const struct regcache *regcache, int regno)
{
- if (regno < FP0_REGNUM)
+ if (regno < gdbarch_fp0_regnum (current_gdbarch))
regcache_raw_collect (regcache, regno,
(char *) &a_tss + regno_mapping[regno].tss_ofs);
else if (i386_fp_regnum_p (regno) || i386_fpc_regnum_p (regno))
store_register (regcache, regno);
else
{
- for (r = 0; r < FP0_REGNUM; r++)
+ for (r = 0; r < gdbarch_fp0_regnum (current_gdbarch); r++)
store_register (regcache, r);
i387_collect_fsave (regcache, -1, &npx);
}
request = PTRACE_SINGLESTEP;
- regcache_cooked_read_unsigned (regcache, PC_REGNUM, &pc);
+ regcache_cooked_read_unsigned (regcache,
+ gdbarch_pc_regnum (current_gdbarch), &pc);
/* Returning from a signal trampoline is done by calling a
special system call (sigreturn or rt_sigreturn, see
if (regno == -1)
return regset_size;
- *off = (regno - FP0_REGNUM) * regsize + off_adjust;
+ *off = (regno - gdbarch_fp0_regnum (current_gdbarch))
+ * regsize + off_adjust;
return 10;
/* Why 10 instead of regsize? GDB only stores 10 bytes per FP
register so if we're sending a register back to the target,
{
gdb_byte buf[8];
- frame_unwind_register (next_frame, PC_REGNUM, buf);
+ frame_unwind_register (next_frame, gdbarch_pc_regnum (current_gdbarch), buf);
return extract_typed_address (buf, builtin_type_void_func_ptr);
}
\f
/* Don't use I386_ESP_REGNUM here, since this function is also used
for AMD64. */
- get_frame_register (frame, SP_REGNUM, buf);
+ get_frame_register (frame, gdbarch_sp_regnum (current_gdbarch), buf);
sp = extract_typed_address (buf, builtin_type_void_data_ptr);
if (target_read_memory (sp + len, buf, len))
return 0;
- SSE control register
The general purpose registers for the x86-64 architecture are quite
- different from IA-32. Therefore, the FP0_REGNUM target macro
+ different from IA-32. Therefore, gdbarch_fp0_regnum
determines the register number at which the FPU data registers
start. The number of FPU data and control registers is the same
for both architectures. The number of SSE registers however,
void
supply_fpregset (struct regcache *regcache, const fpregset_t *fpregsetp)
{
- if (FP0_REGNUM == 0)
+ if (gdbarch_fp0_regnum (current_gdbarch) == 0)
return;
i387_supply_fsave (regcache, -1, fpregsetp);
fill_fpregset (const struct regcache *regcache,
fpregset_t *fpregsetp, int regno)
{
- if (FP0_REGNUM == 0)
+ if (gdbarch_fp0_regnum (current_gdbarch) == 0)
return;
i387_collect_fsave (regcache, regno, fpregsetp);
memset (valuep, 0, register_size (current_gdbarch, regnum));
- if (regnum == SP_REGNUM)
+ if (regnum == gdbarch_sp_regnum (current_gdbarch))
{
/* Handle SP values for all frames but the topmost. */
store_unsigned_integer (valuep, register_size (current_gdbarch, regnum),
*(regp + regi) = extract_signed_integer (buf, size);
}
- if ((regno == -1) || (regno == PC_REGNUM))
+ if ((regno == -1) || (regno == gdbarch_pc_regnum (current_gdbarch)))
{
regi = mips_regnum (current_gdbarch)->pc;
size = register_size (current_gdbarch, regi);
/*
* Now we do the same thing for floating-point registers.
- * We don't bother to condition on FP0_REGNUM since any
+ * We don't bother to condition on gdbarch_fp0_regnum since any
* reasonable MIPS configuration has an R3010 in it.
*
* Again, see the comments in m68k-tdep.c.
/* FIXME, this is wrong for the N32 ABI which has 64 bit FP regs. */
for (regi = 0; regi < 32; regi++)
- regcache_raw_supply (regcache, FP0_REGNUM + regi,
+ regcache_raw_supply (regcache, gdbarch_fp0_regnum (current_gdbarch) + regi,
(const char *) &fpregsetp->fp_r.fp_regs[regi]);
/* We can't supply the FSR register directly to the regcache,
/* FIXME, this is wrong for the N32 ABI which has 64 bit FP regs. */
- for (regi = FP0_REGNUM; regi < FP0_REGNUM + 32; regi++)
+ for (regi = gdbarch_fp0_regnum (current_gdbarch);
+ regi < gdbarch_fp0_regnum (current_gdbarch) + 32; regi++)
{
if ((regno == -1) || (regno == regi))
{
- to = (char *) &(fpregsetp->fp_r.fp_regs[regi - FP0_REGNUM]);
+ to = (char *) &(fpregsetp->fp_r.fp_regs[regi - gdbarch_fp0_regnum
+ (current_gdbarch)]);
regcache_raw_collect (regcache, regi, to);
}
}
}
/* To get base address, get sp from previous frame. */
- uw_sp_regnum = descr->gdb2uw (SP_REGNUM);
+ uw_sp_regnum = descr->gdb2uw (gdbarch_sp_regnum (current_gdbarch));
ret = unw_get_reg_p (&cache->cursor, uw_sp_regnum, &fp);
if (ret < 0)
{
stackmode = psw & 0x80;
if (regno == SPI_REGNUM && !stackmode) /* SP == SPI */
- monitor_supply_register (regcache, SP_REGNUM, val);
+ monitor_supply_register (regcache,
+ gdbarch_sp_regnum (current_gdbarch), val);
else if (regno == SPU_REGNUM && stackmode) /* SP == SPU */
- monitor_supply_register (regcache, SP_REGNUM, val);
+ monitor_supply_register (regcache,
+ gdbarch_sp_regnum (current_gdbarch), val);
}
}
}
if (tdep->fpregs_present)
{
- if (regnum >= FP0_REGNUM && regnum <= FP0_REGNUM + 7)
+ if (regnum >= gdbarch_fp0_regnum (current_gdbarch)
+ && regnum <= gdbarch_fp0_regnum (current_gdbarch) + 7)
{
if (tdep->flavour == m68k_coldfire_flavour)
return builtin_type (gdbarch)->builtin_double;
return builtin_type_int0;
}
- if (regnum == PC_REGNUM)
+ if (regnum == gdbarch_pc_regnum (current_gdbarch))
return builtin_type_void_func_ptr;
if (regnum >= M68K_A0_REGNUM && regnum <= M68K_A0_REGNUM + 7)
{
gdb_byte buf[8];
- frame_unwind_register (next_frame, PC_REGNUM, buf);
+ frame_unwind_register (next_frame, gdbarch_pc_regnum (current_gdbarch), buf);
return extract_typed_address (buf, builtin_type_void_func_ptr);
}
\f
}
buf = alloca (gdbarch_ptr_bit (current_gdbarch) / TARGET_CHAR_BIT);
- sp = get_frame_register_unsigned (frame, SP_REGNUM);
+ sp = get_frame_register_unsigned (frame, gdbarch_sp_regnum (current_gdbarch));
if (target_read_memory (sp + SP_ARG0, /* Offset of first arg on stack */
buf,
int
getfpregs_supplies (int regno)
{
- return FP0_REGNUM <= regno && regno <= M68K_FPI_REGNUM;
+ return gdbarch_fp0_regnum (current_gdbarch) <= regno
+ && regno <= M68K_FPI_REGNUM;
}
/* Does the current host support the GETREGS request? */
const elf_greg_t *regp = (const elf_greg_t *) gregsetp;
int regi;
- for (regi = M68K_D0_REGNUM; regi <= SP_REGNUM; regi++)
+ for (regi = M68K_D0_REGNUM;
+ regi <= gdbarch_sp_regnum (current_gdbarch);
+ regi++)
regcache_raw_supply (regcache, regi, ®p[regmap[regi]]);
- regcache_raw_supply (regcache, PS_REGNUM, ®p[PT_SR]);
- regcache_raw_supply (regcache, PC_REGNUM, ®p[PT_PC]);
+ regcache_raw_supply (regcache, gdbarch_ps_regnum (current_gdbarch),
+ ®p[PT_SR]);
+ regcache_raw_supply (regcache,
+ gdbarch_pc_regnum (current_gdbarch), ®p[PT_PC]);
}
/* Fill register REGNO (if it is a general-purpose register) in
{
int regi;
- for (regi = FP0_REGNUM; regi < FP0_REGNUM + 8; regi++)
+ for (regi = gdbarch_fp0_regnum (current_gdbarch);
+ regi < gdbarch_fp0_regnum (current_gdbarch) + 8; regi++)
regcache_raw_supply (regcache, regi,
- FPREG_ADDR (fpregsetp, regi - FP0_REGNUM));
+ FPREG_ADDR (fpregsetp,
+ regi - gdbarch_fp0_regnum
+ (current_gdbarch)));
regcache_raw_supply (regcache, M68K_FPC_REGNUM, &fpregsetp->fpcntl[0]);
regcache_raw_supply (regcache, M68K_FPS_REGNUM, &fpregsetp->fpcntl[1]);
regcache_raw_supply (regcache, M68K_FPI_REGNUM, &fpregsetp->fpcntl[2]);
int i;
/* Fill in the floating-point registers. */
- for (i = FP0_REGNUM; i < FP0_REGNUM + 8; i++)
+ for (i = gdbarch_fp0_regnum (current_gdbarch);
+ i < gdbarch_fp0_regnum (current_gdbarch) + 8; i++)
if (regno == -1 || regno == i)
regcache_raw_collect (regcache, i,
- FPREG_ADDR (fpregsetp, i - FP0_REGNUM));
+ FPREG_ADDR (fpregsetp,
+ i - gdbarch_fp0_regnum
+ (current_gdbarch)));
/* Fill in the floating-point control registers. */
for (i = M68K_FPC_REGNUM; i <= M68K_FPI_REGNUM; i++)
regaddr = regno;
else if ((regno >= mips_regnum (gdbarch)->fp0)
&& (regno < mips_regnum (gdbarch)->fp0 + 32))
- regaddr = MIPS64_FPR_BASE + (regno - FP0_REGNUM);
+ regaddr = MIPS64_FPR_BASE + (regno - gdbarch_fp0_regnum (current_gdbarch));
else if (regno == mips_regnum (gdbarch)->pc)
regaddr = MIPS64_PC;
else if (regno == mips_regnum (gdbarch)->cause)
memset (zerobuf, 0, MAX_REGISTER_SIZE);
for (regi = 0; regi < 32; regi++)
- regcache_raw_supply (regcache, FP0_REGNUM + regi, *fpregsetp + regi);
+ regcache_raw_supply (regcache,
+ gdbarch_fp0_regnum (current_gdbarch) + regi,
+ *fpregsetp + regi);
regcache_raw_supply (regcache,
mips_regnum (current_gdbarch)->fp_control_status,
{
char *from, *to;
- if ((regno >= FP0_REGNUM) && (regno < FP0_REGNUM + 32))
+ if ((regno >= gdbarch_fp0_regnum (current_gdbarch))
+ && (regno < gdbarch_fp0_regnum (current_gdbarch) + 32))
{
- to = (char *) (*fpregsetp + regno - FP0_REGNUM);
+ to = (char *) (*fpregsetp + regno - gdbarch_fp0_regnum (current_gdbarch));
regcache_raw_collect (regcache, regno, to);
}
else if (regno == mips_regnum (current_gdbarch)->fp_control_status)
int regi;
for (regi = 0; regi < 32; regi++)
- mips_fill_fpregset (regcache, fpregsetp, FP0_REGNUM + regi);
+ mips_fill_fpregset (regcache, fpregsetp,
+ gdbarch_fp0_regnum (current_gdbarch) + regi);
mips_fill_fpregset (regcache, fpregsetp,
mips_regnum (current_gdbarch)->fp_control_status);
}
/* See mips_linux_o32_sigframe_init for a description of the
peculiar FP register layout. */
- if (register_size (current_gdbarch, FP0_REGNUM) == 4)
+ if (register_size (current_gdbarch,
+ gdbarch_fp0_regnum (current_gdbarch)) == 4)
for (regi = 0; regi < 32; regi++)
{
const gdb_byte *reg_ptr = (const gdb_byte *)(*fpregsetp + (regi & ~1));
if ((gdbarch_byte_order (current_gdbarch)
== BFD_ENDIAN_BIG) != (regi & 1))
reg_ptr += 4;
- regcache_raw_supply (regcache, FP0_REGNUM + regi, reg_ptr);
+ regcache_raw_supply (regcache,
+ gdbarch_fp0_regnum (current_gdbarch) + regi,
+ reg_ptr);
}
else
for (regi = 0; regi < 32; regi++)
- regcache_raw_supply (regcache, FP0_REGNUM + regi,
+ regcache_raw_supply (regcache,
+ gdbarch_fp0_regnum (current_gdbarch) + regi,
(const char *)(*fpregsetp + regi));
supply_32bit_reg (regcache, mips_regnum (current_gdbarch)->fp_control_status,
{
gdb_byte *to;
- if ((regno >= FP0_REGNUM) && (regno < FP0_REGNUM + 32))
+ if ((regno >= gdbarch_fp0_regnum (current_gdbarch))
+ && (regno < gdbarch_fp0_regnum (current_gdbarch) + 32))
{
/* See mips_linux_o32_sigframe_init for a description of the
peculiar FP register layout. */
if (register_size (current_gdbarch, regno) == 4)
{
- int regi = regno - FP0_REGNUM;
+ int regi = regno - gdbarch_fp0_regnum (current_gdbarch);
to = (gdb_byte *) (*fpregsetp + (regi & ~1));
if ((gdbarch_byte_order (current_gdbarch)
}
else
{
- to = (gdb_byte *) (*fpregsetp + regno - FP0_REGNUM);
+ to = (gdb_byte *) (*fpregsetp + regno
+ - gdbarch_fp0_regnum (current_gdbarch));
regcache_raw_collect (regcache, regno, to);
}
}
int regi;
for (regi = 0; regi < 32; regi++)
- mips64_fill_fpregset (regcache, fpregsetp, FP0_REGNUM + regi);
+ mips64_fill_fpregset (regcache, fpregsetp,
+ gdbarch_fp0_regnum (current_gdbarch) + regi);
mips64_fill_fpregset (regcache, fpregsetp,
mips_regnum (current_gdbarch)->fp_control_status);
mips64_fill_fpregset (regcache, fpregsetp,
static void
mips_linux_write_pc (struct regcache *regcache, CORE_ADDR pc)
{
- regcache_cooked_write_unsigned (regcache, PC_REGNUM, pc);
+ regcache_cooked_write_unsigned (regcache,
+ gdbarch_pc_regnum (current_gdbarch), pc);
/* Clear the syscall restart flag. */
if (mips_linux_restart_reg_p (current_gdbarch))
mips16_scan_prologue (start_addr, pc, next_frame, *this_cache);
}
- /* SP_REGNUM, contains the value and not the address. */
+ /* gdbarch_sp_regnum contains the value and not the address. */
trad_frame_set_value (cache->saved_regs, gdbarch_num_regs (current_gdbarch)
+ MIPS_SP_REGNUM, cache->base);
mips32_scan_prologue (start_addr, pc, next_frame, *this_cache);
}
- /* SP_REGNUM, contains the value and not the address. */
+ /* gdbarch_sp_regnum contains the value and not the address. */
trad_frame_set_value (cache->saved_regs,
gdbarch_num_regs (current_gdbarch) + MIPS_SP_REGNUM,
cache->base);
(*this_cache) = this_trad_cache;
/* The return address is in the link register. */
- trad_frame_set_reg_realreg (this_trad_cache, PC_REGNUM, MIPS_RA_REGNUM);
+ trad_frame_set_reg_realreg (this_trad_cache,
+ gdbarch_pc_regnum (current_gdbarch),
+ MIPS_RA_REGNUM);
/* Frame ID, since it's a frameless / stackless function, no stack
space is allocated and SP on entry is the current SP. */
else
reg_names = mips_generic_reg_names;
}
- /* FIXME: cagney/2003-11-15: For MIPS, hasn't PC_REGNUM been
+ /* FIXME: cagney/2003-11-15: For MIPS, hasn't gdbarch_pc_regnum been
replaced by read_pc? */
set_gdbarch_pc_regnum (gdbarch, regnum->pc + num_regs);
set_gdbarch_sp_regnum (gdbarch, MIPS_SP_REGNUM + num_regs);
static int
getregs_supplies (int regno)
{
- return ((regno) >= MIPS_ZERO_REGNUM && (regno) <= PC_REGNUM);
+ return ((regno) >= MIPS_ZERO_REGNUM
+ && (regno) <= gdbarch_pc_regnum (current_gdbarch));
}
static void
return;
}
- if (regno == -1 || regno >= FP0_REGNUM)
+ if (regno == -1 || regno >= gdbarch_fp0_regnum (current_gdbarch))
{
struct fpreg fpregs;
return;
}
- if (regno == -1 || regno >= FP0_REGNUM)
+ if (regno == -1 || regno >= gdbarch_fp0_regnum (current_gdbarch))
{
struct fpreg fpregs;
{
int i;
- for (i = 0; i <= PC_REGNUM; i++)
+ for (i = 0; i <= gdbarch_pc_regnum (current_gdbarch); i++)
{
if (regno == i || regno == -1)
{
{
int i;
- for (i = 0; i <= PC_REGNUM; i++)
+ for (i = 0; i <= gdbarch_pc_regnum (current_gdbarch); i++)
if ((regno == i || regno == -1)
&& ! gdbarch_cannot_store_register (current_gdbarch, i))
regcache_raw_collect (regcache, i,
{
int i;
- for (i = FP0_REGNUM;
+ for (i = gdbarch_fp0_regnum (current_gdbarch);
i <= mips_regnum (current_gdbarch)->fp_implementation_revision;
i++)
{
regcache_raw_supply (regcache, i, NULL);
else
regcache_raw_supply (regcache, i,
- fpregs + ((i - FP0_REGNUM) * mips_isa_regsize (current_gdbarch)));
+ fpregs
+ + ((i - gdbarch_fp0_regnum (current_gdbarch))
+ * mips_isa_regsize (current_gdbarch)));
}
}
}
{
int i;
- for (i = FP0_REGNUM; i <= mips_regnum (current_gdbarch)->fp_control_status;
+ for (i = gdbarch_fp0_regnum (current_gdbarch);
+ i <= mips_regnum (current_gdbarch)->fp_control_status;
i++)
if ((regno == i || regno == -1)
&& ! gdbarch_cannot_store_register (current_gdbarch, i))
regcache_raw_collect (regcache, i,
- fpregs + ((i - FP0_REGNUM) * mips_isa_regsize (current_gdbarch)));
+ fpregs + ((i - gdbarch_fp0_regnum
+ (current_gdbarch))
+ * mips_isa_regsize (current_gdbarch)));
}
/* Under NetBSD/mips, signal handler invocations can be identified by the
u_addr = (PT_FPR0 * wordsize) + ((regno - tdep->ppc_fp0_regnum) * 8);
/* UISA special purpose registers: 1 slot each */
- if (regno == PC_REGNUM)
+ if (regno == gdbarch_pc_regnum (current_gdbarch))
u_addr = PT_NIP * wordsize;
if (regno == tdep->ppc_lr_regnum)
u_addr = PT_LNK * wordsize;
if (tdep->ppc_fp0_regnum >= 0)
for (i = 0; i < ppc_num_fprs; i++)
fetch_register (regcache, tid, tdep->ppc_fp0_regnum + i);
- fetch_register (regcache, tid, PC_REGNUM);
+ fetch_register (regcache, tid, gdbarch_pc_regnum (current_gdbarch));
if (tdep->ppc_ps_regnum != -1)
fetch_register (regcache, tid, tdep->ppc_ps_regnum);
if (tdep->ppc_cr_regnum != -1)
if (tdep->ppc_fp0_regnum >= 0)
for (i = 0; i < ppc_num_fprs; i++)
store_register (regcache, tid, tdep->ppc_fp0_regnum + i);
- store_register (regcache, tid, PC_REGNUM);
+ store_register (regcache, tid, gdbarch_pc_regnum (current_gdbarch));
if (tdep->ppc_ps_regnum != -1)
store_register (regcache, tid, tdep->ppc_ps_regnum);
if (tdep->ppc_cr_regnum != -1)
(regp + PT_R0 + regi));
}
- if ((regno == -1) || regno == PC_REGNUM)
- right_fill_reg (regcache, PC_REGNUM, regp + PT_NIP);
+ if ((regno == -1) || regno == gdbarch_pc_regnum (current_gdbarch))
+ right_fill_reg (regcache, gdbarch_pc_regnum (current_gdbarch),
+ regp + PT_NIP);
if ((regno == -1) || regno == tdep->ppc_lr_regnum)
right_fill_reg (regcache, tdep->ppc_lr_regnum, regp + PT_LNK);
if ((regno == -1) || regno == tdep->ppc_cr_regnum)
struct gdbarch *gdbarch = get_frame_arch (next_frame);
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
- base = frame_unwind_register_unsigned (next_frame, SP_REGNUM);
+ base = frame_unwind_register_unsigned (next_frame,
+ gdbarch_sp_regnum (current_gdbarch));
if (bias > 0 && frame_pc_unwind (next_frame) != func)
/* See below, some signal trampolines increment the stack as their
first instruction, need to compensate for that. */
int regnum = i + tdep->ppc_gp0_regnum;
trad_frame_set_reg_addr (this_cache, regnum, gpregs + i * tdep->wordsize);
}
- trad_frame_set_reg_addr (this_cache, PC_REGNUM, gpregs + 32 * tdep->wordsize);
+ trad_frame_set_reg_addr (this_cache,
+ gdbarch_pc_regnum (current_gdbarch),
+ gpregs + 32 * tdep->wordsize);
trad_frame_set_reg_addr (this_cache, tdep->ppc_ctr_regnum,
gpregs + 35 * tdep->wordsize);
trad_frame_set_reg_addr (this_cache, tdep->ppc_lr_regnum,
/* Floating point registers. */
for (i = 0; i < 32; i++)
{
- int regnum = i + FP0_REGNUM;
+ int regnum = i + gdbarch_fp0_regnum (current_gdbarch);
trad_frame_set_reg_addr (this_cache, regnum,
fpregs + i * tdep->wordsize);
}
int argspace = 0; /* 0 is an initial wrong guess. */
int write_pass;
- regcache_cooked_read_unsigned (regcache, SP_REGNUM, &saved_sp);
+ regcache_cooked_read_unsigned (regcache,
+ gdbarch_sp_regnum (current_gdbarch),
+ &saved_sp);
/* Go through the argument list twice.
}
/* Update %sp. */
- regcache_cooked_write_signed (regcache, SP_REGNUM, sp);
+ regcache_cooked_write_signed (regcache,
+ gdbarch_sp_regnum (current_gdbarch), sp);
/* Write the backchain (it occupies WORDSIZED bytes). */
write_memory_signed_integer (sp, tdep->wordsize, saved_sp);
/* By this stage in the proceedings, SP has been decremented by "red
zone size" + "struct return size". Fetch the stack-pointer from
before this and use that as the BACK_CHAIN. */
- regcache_cooked_read_unsigned (regcache, SP_REGNUM, &back_chain);
+ regcache_cooked_read_unsigned (regcache,
+ gdbarch_sp_regnum (current_gdbarch),
+ &back_chain);
/* Go through the argument list twice.
}
/* Update %sp. */
- regcache_cooked_write_signed (regcache, SP_REGNUM, sp);
+ regcache_cooked_write_signed (regcache,
+ gdbarch_sp_regnum (current_gdbarch), sp);
/* Write the backchain (it occupies WORDSIZED bytes). */
write_memory_signed_integer (sp, tdep->wordsize, back_chain);
|| regnum == tdep->ppc_cr_regnum
|| regnum == tdep->ppc_xer_regnum
|| regnum == tdep->ppc_ctr_regnum
- || regnum == PC_REGNUM);
+ || regnum == gdbarch_pc_regnum (current_gdbarch));
}
/* Like above, but for PT_GETFPREGS. */
read_memory(cf.sp, (gdb_byte *)&cf, sizeof(cf));
regcache_raw_supply (regcache, tdep->ppc_lr_regnum, &cf.lr);
- regcache_raw_supply (regcache, PC_REGNUM, &cf.lr);
+ regcache_raw_supply (regcache, gdbarch_pc_regnum (current_gdbarch), &cf.lr);
return 1;
}
CORE_ADDR addr, base;
int i;
- base = frame_unwind_register_unsigned (next_frame, SP_REGNUM);
+ base = frame_unwind_register_unsigned (next_frame,
+ gdbarch_sp_regnum (current_gdbarch));
if (self == &ppcnbsd2_sigtramp)
addr = base + 0x10 + 2 * tdep->wordsize;
else
addr += tdep->wordsize;
trad_frame_set_reg_addr (this_cache, tdep->ppc_ctr_regnum, addr);
addr += tdep->wordsize;
- trad_frame_set_reg_addr (this_cache, PC_REGNUM, addr); /* SRR0? */
+ trad_frame_set_reg_addr (this_cache,
+ gdbarch_pc_regnum (current_gdbarch),
+ addr); /* SRR0? */
addr += tdep->wordsize;
/* Construct the frame ID using the function start. */
return 0;
read_memory (pcb->pcb_sp, (gdb_byte *)&sf, sizeof sf);
- regcache_raw_supply (regcache, SP_REGNUM, &sf.sp);
+ regcache_raw_supply (regcache, gdbarch_sp_regnum (current_gdbarch), &sf.sp);
regcache_raw_supply (regcache, tdep->ppc_cr_regnum, &sf.cr);
regcache_raw_supply (regcache, tdep->ppc_gp0_regnum + 2, &sf.fixreg2);
for (i = 0, regnum = tdep->ppc_gp0_regnum + 13; i < 19; i++, regnum++)
regcache_raw_supply (regcache, regnum, &sf.fixreg[i]);
read_memory (sf.sp, (gdb_byte *)&cf, sizeof cf);
- regcache_raw_supply (regcache, PC_REGNUM, &cf.lr);
+ regcache_raw_supply (regcache, gdbarch_pc_regnum (current_gdbarch), &cf.lr);
regcache_raw_supply (regcache, tdep->ppc_gp0_regnum + 30, &cf.r30);
regcache_raw_supply (regcache, tdep->ppc_gp0_regnum + 31, &cf.r31);
insn = extract_unsigned_integer (buf, PPC_INSN_SIZE);
sigcontext_offset = (0x10000 - (insn & 0x0000ffff)) + 8;
- base = frame_unwind_register_unsigned (next_frame, SP_REGNUM);
+ base = frame_unwind_register_unsigned (next_frame,
+ gdbarch_sp_regnum (current_gdbarch));
addr = base + sigcontext_offset + 2 * tdep->wordsize;
for (i = 0; i < ppc_num_gprs; i++, addr += tdep->wordsize)
{
addr += tdep->wordsize;
trad_frame_set_reg_addr (cache, tdep->ppc_ctr_regnum, addr);
addr += tdep->wordsize;
- trad_frame_set_reg_addr (cache, PC_REGNUM, addr); /* SRR0? */
+ trad_frame_set_reg_addr (cache, gdbarch_pc_regnum (current_gdbarch), addr);
+ /* SRR0? */
addr += tdep->wordsize;
/* Construct the frame ID using the function start. */
supply_gregset (regcache, (const gdb_gregset_t *) gregs);
- if (FP0_REGNUM >= 0) /* Do we have an FPU? */
+ if (gdbarch_fp0_regnum (current_gdbarch) >= 0) /* Do we have an FPU? */
{
gdb_fpregset_t *fpregs;
- if ((regnum >= 0 && regnum < FP0_REGNUM)
- || regnum == PC_REGNUM
- || regnum == SP_REGNUM)
+ if ((regnum >= 0 && regnum < gdbarch_fp0_regnum (current_gdbarch))
+ || regnum == gdbarch_pc_regnum (current_gdbarch)
+ || regnum == gdbarch_sp_regnum (current_gdbarch))
return; /* Not a floating point register. */
fpregs = proc_get_fpregs (pi);
if (!proc_set_gregs (pi))
proc_error (pi, "store_registers, set_gregs", __LINE__);
- if (FP0_REGNUM >= 0) /* Do we have an FPU? */
+ if (gdbarch_fp0_regnum (current_gdbarch) >= 0) /* Do we have an FPU? */
{
gdb_fpregset_t *fpregs;
- if ((regnum >= 0 && regnum < FP0_REGNUM)
- || regnum == PC_REGNUM
- || regnum == SP_REGNUM)
+ if ((regnum >= 0 && regnum < gdbarch_fp0_regnum (current_gdbarch))
+ || regnum == gdbarch_pc_regnum (current_gdbarch)
+ || regnum == gdbarch_sp_regnum (current_gdbarch))
return; /* Not a floating point register. */
fpregs = proc_get_fpregs (pi);
if (!proc_set_gregs (pi)) /* flush gregs cache */
proc_warn (pi, "target_resume, set_gregs",
__LINE__);
- if (FP0_REGNUM >= 0)
+ if (gdbarch_fp0_regnum (current_gdbarch) >= 0)
if (pi->fpregs_dirty)
if (parent == NULL ||
proc_get_current_thread (parent) != pi->tid)
if (gdbarch_read_pc_p (gdbarch))
pc_val = gdbarch_read_pc (gdbarch, regcache);
/* Else use per-frame method on get_current_frame. */
- else if (PC_REGNUM >= 0)
+ else if (gdbarch_pc_regnum (current_gdbarch) >= 0)
{
ULONGEST raw_val;
- regcache_cooked_read_unsigned (regcache, PC_REGNUM, &raw_val);
+ regcache_cooked_read_unsigned (regcache,
+ gdbarch_pc_regnum (current_gdbarch),
+ &raw_val);
pc_val = gdbarch_addr_bits_remove (current_gdbarch, raw_val);
}
else
if (gdbarch_write_pc_p (gdbarch))
gdbarch_write_pc (gdbarch, regcache, pc);
- else if (PC_REGNUM >= 0)
- regcache_cooked_write_unsigned (regcache, PC_REGNUM, pc);
+ if (gdbarch_pc_regnum (current_gdbarch) >= 0)
+ regcache_cooked_write_unsigned (regcache,
+ gdbarch_pc_regnum (current_gdbarch), pc);
else
internal_error (__FILE__, __LINE__,
_("write_pc_pid: Unable to update PC"));
struct regcache *regcache = get_current_regcache ();
char buf[MAX_REGISTER_SIZE];
- store_unsigned_integer (buf, register_size (current_gdbarch, PC_REGNUM), rpc);
- regcache_raw_supply (regcache, PC_REGNUM, buf);
-
- store_unsigned_integer (buf, register_size (current_gdbarch, PC_REGNUM), rfp);
+ store_unsigned_integer (buf,
+ register_size
+ (current_gdbarch, gdbarch_pc_regnum
+ (current_gdbarch)), rpc);
+ regcache_raw_supply (regcache, gdbarch_pc_regnum (current_gdbarch), buf);
+
+ store_unsigned_integer
+ (buf, register_size (current_gdbarch,
+ gdbarch_pc_regnum (current_gdbarch)), rfp);
regcache_raw_supply (regcache, 30, buf); /* This register they are avoiding and so it is unnamed */
- store_unsigned_integer (buf, register_size (current_gdbarch, SP_REGNUM), rsp);
- regcache_raw_supply (regcache, SP_REGNUM, buf);
+ store_unsigned_integer (buf, register_size (current_gdbarch,
+ gdbarch_sp_regnum (current_gdbarch)), rsp);
+ regcache_raw_supply (regcache, gdbarch_sp_regnum (current_gdbarch), buf);
store_unsigned_integer (buf, register_size (current_gdbarch, DEPRECATED_FP_REGNUM), 0);
regcache_raw_supply (regcache, DEPRECATED_FP_REGNUM, buf);
/* Work around problem where PMON monitor updates the PC after a load
to a different value than GDB thinks it has. The following ensures
that the write_pc() WILL update the PC value: */
- deprecated_register_valid[PC_REGNUM] = 0;
+ deprecated_register_valid[gdbarch_pc_regnum (current_gdbarch)] = 0;
}
if (exec_bfd)
write_pc (bfd_get_start_address (exec_bfd));
*isfloat = 1;
return regno - tdep->ppc_fp0_regnum + FPR0;
}
- else if (regno == PC_REGNUM)
+ else if (regno == gdbarch_pc_regnum (current_gdbarch))
return IAR;
else if (regno == tdep->ppc_ps_regnum)
return MSR;
/* Fixed-point registers. */
else
{
- if (regno == SP_REGNUM)
+ if (regno == gdbarch_sp_regnum (current_gdbarch))
/* Execute one dummy instruction (which is a breakpoint) in inferior
process to give kernel a chance to do internal housekeeping.
Otherwise the following ptrace(2) calls will mess up user stack
fetch_register (regcache, tdep->ppc_fp0_regnum + regno);
/* Read special registers. */
- fetch_register (regcache, PC_REGNUM);
+ fetch_register (regcache, gdbarch_pc_regnum (current_gdbarch));
fetch_register (regcache, tdep->ppc_ps_regnum);
fetch_register (regcache, tdep->ppc_cr_regnum);
fetch_register (regcache, tdep->ppc_lr_regnum);
store_register (regcache, tdep->ppc_fp0_regnum + regno);
/* Write special registers. */
- store_register (regcache, PC_REGNUM);
+ store_register (regcache, gdbarch_pc_regnum (current_gdbarch));
store_register (regcache, tdep->ppc_ps_regnum);
store_register (regcache, tdep->ppc_cr_regnum);
store_register (regcache, tdep->ppc_lr_regnum);
ppc_supply_reg (regcache, i, gregs, offset);
}
- if (regnum == -1 || regnum == PC_REGNUM)
- ppc_supply_reg (regcache, PC_REGNUM, gregs, offsets->pc_offset);
+ if (regnum == -1 || regnum == gdbarch_pc_regnum (current_gdbarch))
+ ppc_supply_reg (regcache, gdbarch_pc_regnum (current_gdbarch),
+ gregs, offsets->pc_offset);
if (regnum == -1 || regnum == tdep->ppc_ps_regnum)
ppc_supply_reg (regcache, tdep->ppc_ps_regnum,
gregs, offsets->ps_offset);
ppc_collect_reg (regcache, i, gregs, offset);
}
- if (regnum == -1 || regnum == PC_REGNUM)
- ppc_collect_reg (regcache, PC_REGNUM, gregs, offsets->pc_offset);
+ if (regnum == -1 || regnum == gdbarch_pc_regnum (current_gdbarch))
+ ppc_collect_reg (regcache, gdbarch_pc_regnum (current_gdbarch),
+ gregs, offsets->pc_offset);
if (regnum == -1 || regnum == tdep->ppc_ps_regnum)
ppc_collect_reg (regcache, tdep->ppc_ps_regnum,
gregs, offsets->ps_offset);
ran_out_of_registers_for_arguments:
- regcache_cooked_read_unsigned (regcache, SP_REGNUM, &saved_sp);
+ regcache_cooked_read_unsigned (regcache,
+ gdbarch_sp_regnum (current_gdbarch),
+ &saved_sp);
/* Location for 8 parameters are always reserved. */
sp -= wordsize * 8;
to use this area. So, update %sp first before doing anything
else. */
- regcache_raw_write_signed (regcache, SP_REGNUM, sp);
+ regcache_raw_write_signed (regcache,
+ gdbarch_sp_regnum (current_gdbarch), sp);
/* If the last argument copied into the registers didn't fit there
completely, push the rest of it into stack. */
Not doing this can lead to conflicts with the kernel which thinks
that it still has control over this not-yet-allocated stack
region. */
- regcache_raw_write_signed (regcache, SP_REGNUM, sp);
+ regcache_raw_write_signed (regcache, gdbarch_sp_regnum (current_gdbarch), sp);
/* Set back chain properly. */
store_unsigned_integer (tmp_buffer, wordsize, saved_sp);
|| regnum == tdep->ppc_lr_regnum
|| regnum == tdep->ppc_ctr_regnum
|| regnum == tdep->ppc_xer_regnum
- || regnum == PC_REGNUM);
+ || regnum == gdbarch_pc_regnum (current_gdbarch));
if (group == general_reggroup)
return general_p;
static CORE_ADDR
rs6000_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
{
- return frame_unwind_register_unsigned (next_frame, PC_REGNUM);
+ return frame_unwind_register_unsigned (next_frame,
+ gdbarch_pc_regnum (current_gdbarch));
}
static struct frame_id
rs6000_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *next_frame)
{
- return frame_id_build (frame_unwind_register_unsigned (next_frame,
- SP_REGNUM),
- frame_pc_unwind (next_frame));
+ return frame_id_build (frame_unwind_register_unsigned
+ (next_frame, gdbarch_sp_regnum (current_gdbarch)),
+ frame_pc_unwind (next_frame));
}
struct rs6000_frame_cache
->frame pointed to the outer-most address of the frame. In
the mean time, the address of the prev frame is used as the
base address of this frame. */
- cache->base = frame_unwind_register_unsigned (next_frame, SP_REGNUM);
+ cache->base = frame_unwind_register_unsigned
+ (next_frame, gdbarch_sp_regnum (current_gdbarch));
/* If the function appears to be frameless, check a couple of likely
indicators that we have simply failed to find the frame setup.
/* Frameless really means stackless. */
cache->base = read_memory_addr (cache->base, wordsize);
- trad_frame_set_value (cache->saved_regs, SP_REGNUM, cache->base);
+ trad_frame_set_value (cache->saved_regs,
+ gdbarch_sp_regnum (current_gdbarch), cache->base);
/* if != -1, fdata.saved_fpr is the smallest number of saved_fpr.
All fpr's from saved_fpr to fp31 are saved. */
if (fdata.lr_offset != 0)
cache->saved_regs[tdep->ppc_lr_regnum].addr = cache->base + fdata.lr_offset;
/* The PC is found in the link register. */
- cache->saved_regs[PC_REGNUM] = cache->saved_regs[tdep->ppc_lr_regnum];
+ cache->saved_regs[gdbarch_pc_regnum (current_gdbarch)] =
+ cache->saved_regs[tdep->ppc_lr_regnum];
/* If != 0, fdata.vrsave_offset is the offset from the frame that
holds the VRSAVE. */
if (fdata.alloca_reg < 0)
/* If no alloca register used, then fi->frame is the value of the
%sp for this frame, and it is good enough. */
- cache->initial_sp = frame_unwind_register_unsigned (next_frame, SP_REGNUM);
+ cache->initial_sp = frame_unwind_register_unsigned
+ (next_frame, gdbarch_sp_regnum (current_gdbarch));
else
cache->initial_sp = frame_unwind_register_unsigned (next_frame,
fdata.alloca_reg);
regcache_cooked_write_unsigned (regcache, PR_REGNUM, bp_addr);
/* Update stack pointer. */
- regcache_cooked_write_unsigned (regcache, SP_REGNUM, sp);
+ regcache_cooked_write_unsigned (regcache,
+ gdbarch_sp_regnum (current_gdbarch), sp);
return sp;
}
regcache_cooked_write_unsigned (regcache, PR_REGNUM, bp_addr);
/* Update stack pointer. */
- regcache_cooked_write_unsigned (regcache, SP_REGNUM, sp);
+ regcache_cooked_write_unsigned (regcache,
+ gdbarch_sp_regnum (current_gdbarch), sp);
return sp;
}
if (sh_treat_as_flt_p (type))
{
int len = TYPE_LENGTH (type);
- int i, regnum = FP0_REGNUM;
+ int i, regnum = gdbarch_fp0_regnum (current_gdbarch);
for (i = 0; i < len; i += 4)
if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_LITTLE)
regcache_raw_read (regcache, regnum++, (char *) valbuf + len - 4 - i);
if (sh_treat_as_flt_p (type))
{
int len = TYPE_LENGTH (type);
- int i, regnum = FP0_REGNUM;
+ int i, regnum = gdbarch_fp0_regnum (current_gdbarch);
for (i = 0; i < len; i += 4)
if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_LITTLE)
regcache_raw_write (regcache, regnum++,
{
printf_filtered
(" PC %s SR %08lx PR %08lx MACH %08lx\n",
- paddr (get_frame_register_unsigned (frame, PC_REGNUM)),
+ paddr (get_frame_register_unsigned (frame,
+ gdbarch_pc_regnum (current_gdbarch))),
(long) get_frame_register_unsigned (frame, SR_REGNUM),
(long) get_frame_register_unsigned (frame, PR_REGNUM),
(long) get_frame_register_unsigned (frame, MACH_REGNUM));
{
printf_filtered
(" PC %s SR %08lx PR %08lx MACH %08lx\n",
- paddr (get_frame_register_unsigned (frame, PC_REGNUM)),
+ paddr (get_frame_register_unsigned (frame,
+ gdbarch_pc_regnum (current_gdbarch))),
(long) get_frame_register_unsigned (frame, SR_REGNUM),
(long) get_frame_register_unsigned (frame, PR_REGNUM),
(long) get_frame_register_unsigned (frame, MACH_REGNUM));
{
printf_filtered
(" PC %s SR %08lx PR %08lx MACH %08lx\n",
- paddr (get_frame_register_unsigned (frame, PC_REGNUM)),
+ paddr (get_frame_register_unsigned (frame,
+ gdbarch_pc_regnum (current_gdbarch))),
(long) get_frame_register_unsigned (frame, SR_REGNUM),
(long) get_frame_register_unsigned (frame, PR_REGNUM),
(long) get_frame_register_unsigned (frame, MACH_REGNUM));
printf_filtered
("FP0-FP7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 0),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 1),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 2),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 3),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 4),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 5),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 6),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 7));
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 0),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 1),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 2),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 3),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 4),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 5),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 6),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 7));
printf_filtered
("FP8-FP15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 8),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 9),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 10),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 11),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 12),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 13),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 14),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 15));
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 8),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 9),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 10),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 11),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 12),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 13),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 14),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 15));
}
static void
printf_filtered
(" PC %s SR %08lx PR %08lx MACH %08lx\n",
- paddr (get_frame_register_unsigned (frame, PC_REGNUM)),
+ paddr (get_frame_register_unsigned (frame,
+ gdbarch_pc_regnum (current_gdbarch))),
(long) get_frame_register_unsigned (frame, SR_REGNUM),
(long) get_frame_register_unsigned (frame, PR_REGNUM),
(long) get_frame_register_unsigned (frame, MACH_REGNUM));
printf_filtered
(pr ? "DR0-DR6 %08lx%08lx %08lx%08lx %08lx%08lx %08lx%08lx\n"
: "FP0-FP7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 0),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 1),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 2),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 3),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 4),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 5),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 6),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 7));
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 0),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 1),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 2),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 3),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 4),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 5),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 6),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 7));
printf_filtered
(pr ? "DR8-DR14 %08lx%08lx %08lx%08lx %08lx%08lx %08lx%08lx\n"
: "FP8-FP15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 8),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 9),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 10),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 11),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 12),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 13),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 14),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 15));
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 8),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 9),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 10),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 11),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 12),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 13),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 14),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 15));
printf_filtered
("BANK=%-3d\n", (int) get_frame_register_unsigned (frame, BANK_REGNUM));
printf_filtered
printf_filtered
(" PC %s SR %08lx PR %08lx MACH %08lx\n",
- paddr (get_frame_register_unsigned (frame, PC_REGNUM)),
+ paddr (get_frame_register_unsigned (frame,
+ gdbarch_pc_regnum (current_gdbarch))),
(long) get_frame_register_unsigned (frame, SR_REGNUM),
(long) get_frame_register_unsigned (frame, PR_REGNUM),
(long) get_frame_register_unsigned (frame, MACH_REGNUM));
{
printf_filtered
(" PC %s SR %08lx PR %08lx MACH %08lx\n",
- paddr (get_frame_register_unsigned (frame, PC_REGNUM)),
+ paddr (get_frame_register_unsigned (frame,
+ gdbarch_pc_regnum (current_gdbarch))),
(long) get_frame_register_unsigned (frame, SR_REGNUM),
(long) get_frame_register_unsigned (frame, PR_REGNUM),
(long) get_frame_register_unsigned (frame, MACH_REGNUM));
printf_filtered
("FP0-FP7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 0),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 1),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 2),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 3),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 4),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 5),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 6),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 7));
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 0),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 1),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 2),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 3),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 4),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 5),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 6),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 7));
printf_filtered
("FP8-FP15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 8),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 9),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 10),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 11),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 12),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 13),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 14),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 15));
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 8),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 9),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 10),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 11),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 12),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 13),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 14),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 15));
}
static void
{
printf_filtered
(" PC %s SR %08lx PR %08lx MACH %08lx\n",
- paddr (get_frame_register_unsigned (frame, PC_REGNUM)),
+ paddr (get_frame_register_unsigned (frame,
+ gdbarch_pc_regnum (current_gdbarch))),
(long) get_frame_register_unsigned (frame, SR_REGNUM),
(long) get_frame_register_unsigned (frame, PR_REGNUM),
(long) get_frame_register_unsigned (frame, MACH_REGNUM));
printf_filtered
(" PC %s SR %08lx PR %08lx MACH %08lx\n",
- paddr (get_frame_register_unsigned (frame, PC_REGNUM)),
+ paddr (get_frame_register_unsigned (frame,
+ gdbarch_pc_regnum (current_gdbarch))),
(long) get_frame_register_unsigned (frame, SR_REGNUM),
(long) get_frame_register_unsigned (frame, PR_REGNUM),
(long) get_frame_register_unsigned (frame, MACH_REGNUM));
printf_filtered
(pr ? "DR0-DR6 %08lx%08lx %08lx%08lx %08lx%08lx %08lx%08lx\n"
: "FP0-FP7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 0),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 1),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 2),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 3),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 4),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 5),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 6),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 7));
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 0),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 1),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 2),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 3),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 4),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 5),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 6),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 7));
printf_filtered
(pr ? "DR8-DR14 %08lx%08lx %08lx%08lx %08lx%08lx %08lx%08lx\n"
: "FP8-FP15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 8),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 9),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 10),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 11),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 12),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 13),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 14),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + 15));
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 8),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 9),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 10),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 11),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 12),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 13),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 14),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + 15));
}
static void
{
printf_filtered
(" PC %s SR %08lx PR %08lx MACH %08lx\n",
- paddr (get_frame_register_unsigned (frame, PC_REGNUM)),
+ paddr (get_frame_register_unsigned (frame,
+ gdbarch_pc_regnum (current_gdbarch))),
(long) get_frame_register_unsigned (frame, SR_REGNUM),
(long) get_frame_register_unsigned (frame, PR_REGNUM),
(long) get_frame_register_unsigned (frame, MACH_REGNUM));
{
printf_filtered
(" PC %s SR %08lx PR %08lx MACH %08lx\n",
- paddr (get_frame_register_unsigned (frame, PC_REGNUM)),
+ paddr (get_frame_register_unsigned (frame,
+ gdbarch_pc_regnum (current_gdbarch))),
(long) get_frame_register_unsigned (frame, SR_REGNUM),
(long) get_frame_register_unsigned (frame, PR_REGNUM),
(long) get_frame_register_unsigned (frame, MACH_REGNUM));
static struct type *
sh_sh2a_register_type (struct gdbarch *gdbarch, int reg_nr)
{
- if ((reg_nr >= FP0_REGNUM
+ if ((reg_nr >= gdbarch_fp0_regnum (current_gdbarch)
&& (reg_nr <= FP_LAST_REGNUM)) || (reg_nr == FPUL_REGNUM))
return builtin_type_float;
else if (reg_nr >= DR0_REGNUM && reg_nr <= DR_LAST_REGNUM)
static struct type *
sh_sh3e_register_type (struct gdbarch *gdbarch, int reg_nr)
{
- if ((reg_nr >= FP0_REGNUM
+ if ((reg_nr >= gdbarch_fp0_regnum (current_gdbarch)
&& (reg_nr <= FP_LAST_REGNUM)) || (reg_nr == FPUL_REGNUM))
return builtin_type_float;
else
static struct type *
sh_sh4_register_type (struct gdbarch *gdbarch, int reg_nr)
{
- if ((reg_nr >= FP0_REGNUM
+ if ((reg_nr >= gdbarch_fp0_regnum (current_gdbarch)
&& (reg_nr <= FP_LAST_REGNUM)) || (reg_nr == FPUL_REGNUM))
return builtin_type_float;
else if (reg_nr >= DR0_REGNUM && reg_nr <= DR_LAST_REGNUM)
{
int fp_regnum;
- fp_regnum = FP0_REGNUM + (fv_regnum - FV0_REGNUM) * 4;
+ fp_regnum = gdbarch_fp0_regnum (current_gdbarch)
+ + (fv_regnum - FV0_REGNUM) * 4;
return fp_regnum;
}
{
int fp_regnum;
- fp_regnum = FP0_REGNUM + (dr_regnum - DR0_REGNUM) * 2;
+ fp_regnum = gdbarch_fp0_regnum (current_gdbarch)
+ + (dr_regnum - DR0_REGNUM) * 2;
return fp_regnum;
}
struct frame_info *next_frame)
{
/* Mark the PC as the destination for the return address. */
- if (regnum == PC_REGNUM)
+ if (regnum == gdbarch_pc_regnum (current_gdbarch))
reg->how = DWARF2_FRAME_REG_RA;
/* Mark the stack pointer as the call frame address. */
- else if (regnum == SP_REGNUM)
+ else if (regnum == gdbarch_sp_regnum (current_gdbarch))
reg->how = DWARF2_FRAME_REG_CFA;
/* The above was taken from the default init_reg in dwarf2-frame.c
setup yet. Try to reconstruct the base address for the stack
frame by looking at the stack pointer. For truly "frameless"
functions this might work too. */
- cache->base = frame_unwind_register_unsigned (next_frame, SP_REGNUM);
+ cache->base = frame_unwind_register_unsigned
+ (next_frame, gdbarch_sp_regnum (current_gdbarch));
}
/* Now that we have the base address for the stack frame we can
gdb_assert (regnum >= 0);
- if (regnum == SP_REGNUM && cache->saved_sp)
+ if (regnum == gdbarch_sp_regnum (current_gdbarch) && cache->saved_sp)
{
*optimizedp = 0;
*lvalp = not_lval;
/* The PC of the previous frame is stored in the PR register of
the current frame. Frob regnum so that we pull the value from
the correct place. */
- if (regnum == PC_REGNUM)
+ if (regnum == gdbarch_pc_regnum (current_gdbarch))
regnum = PR_REGNUM;
if (regnum < SH_NUM_REGS && cache->saved_regs[regnum] != -1)
static CORE_ADDR
sh_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
{
- return frame_unwind_register_unsigned (next_frame, SP_REGNUM);
+ return frame_unwind_register_unsigned (next_frame,
+ gdbarch_sp_regnum (current_gdbarch));
}
static CORE_ADDR
sh_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
{
- return frame_unwind_register_unsigned (next_frame, PC_REGNUM);
+ return frame_unwind_register_unsigned (next_frame,
+ gdbarch_pc_regnum (current_gdbarch));
}
static struct frame_id
DR0_REGNUM = 141,
DR_LAST_REGNUM = 172,
/* FPP stands for Floating Point Pair, to avoid confusion with
- GDB's FP0_REGNUM, which is the number of the first Floating
+ GDB's gdbarch_fp0_regnum, which is the number of the first Floating
point register. Unfortunately on the sh5, the floating point
registers are called FR, and the floating point pairs are called FP. */
FPP0_REGNUM = 173,
{
int fp_regnum;
- fp_regnum = FP0_REGNUM +
+ fp_regnum = gdbarch_fp0_regnum (current_gdbarch) +
(fv_regnum - FV0_REGNUM) * 4;
return fp_regnum;
}
{
int fp_regnum;
- fp_regnum = FP0_REGNUM +
+ fp_regnum = gdbarch_fp0_regnum (current_gdbarch) +
(dr_regnum - DR0_REGNUM) * 2;
return fp_regnum;
}
{
int fp_regnum;
- fp_regnum = FP0_REGNUM +
+ fp_regnum = gdbarch_fp0_regnum (current_gdbarch) +
(fpp_regnum - FPP0_REGNUM) * 2;
return fp_regnum;
}
/* floating point register N maps to floating point register N */
else if (reg_nr >= FP0_C_REGNUM
&& reg_nr <= FP_LAST_C_REGNUM)
- base_regnum = reg_nr - FP0_C_REGNUM + FP0_REGNUM;
+ base_regnum = reg_nr - FP0_C_REGNUM + gdbarch_fp0_regnum (current_gdbarch);
/* double prec register N maps to base regnum for double prec register N */
else if (reg_nr >= DR0_C_REGNUM
base_regnum = sh64_fv_reg_base_num (FV0_REGNUM + reg_nr - FV0_C_REGNUM);
else if (reg_nr == PC_C_REGNUM)
- base_regnum = PC_REGNUM;
+ base_regnum = gdbarch_pc_regnum (current_gdbarch);
else if (reg_nr == GBR_C_REGNUM)
base_regnum = 16;
base_regnum = FPSCR_REGNUM; /*???? this register is a mess. */
else if (reg_nr == FPUL_C_REGNUM)
- base_regnum = FP0_REGNUM + 32;
+ base_regnum = gdbarch_fp0_regnum (current_gdbarch) + 32;
return base_regnum;
}
in eight registers available. Loop thru args from first to last. */
int_argreg = ARG0_REGNUM;
- float_argreg = FP0_REGNUM;
+ float_argreg = gdbarch_fp0_regnum (current_gdbarch);
double_argreg = DR0_REGNUM;
for (argnum = 0, stack_offset = 0; argnum < nargs; argnum++)
{
/* Goes in FR0...FR11 */
regcache_cooked_write (regcache,
- FP0_REGNUM + float_arg_index,
+ gdbarch_fp0_regnum (current_gdbarch)
+ + float_arg_index,
val);
fp_args[float_arg_index] = 1;
/* Skip the corresponding general argument register. */
regcache_cooked_write_unsigned (regcache, PR_REGNUM, bp_addr);
/* Update stack pointer. */
- regcache_cooked_write_unsigned (regcache, SP_REGNUM, sp);
+ regcache_cooked_write_unsigned (regcache,
+ gdbarch_sp_regnum (current_gdbarch), sp);
return sp;
}
{
if (len == 4)
{
- /* Return value stored in FP0_REGNUM */
- regcache_raw_read (regcache, FP0_REGNUM, valbuf);
+ /* Return value stored in gdbarch_fp0_regnum */
+ regcache_raw_read (regcache,
+ gdbarch_fp0_regnum (current_gdbarch), valbuf);
}
else if (len == 8)
{
if (TYPE_CODE (type) == TYPE_CODE_FLT)
{
- int i, regnum = FP0_REGNUM;
+ int i, regnum = gdbarch_fp0_regnum (current_gdbarch);
for (i = 0; i < len; i += 4)
if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_LITTLE)
regcache_raw_write (regcache, regnum++,
printf_filtered
("PC=%s SR=%016llx \n",
- paddr (get_frame_register_unsigned (frame, PC_REGNUM)),
+ paddr (get_frame_register_unsigned (frame,
+ gdbarch_pc_regnum (current_gdbarch))),
(long long) get_frame_register_unsigned (frame, SR_REGNUM));
printf_filtered
printf_filtered
("FR%d-FR%d %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
i, i + 7,
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + i + 0),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + i + 1),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + i + 2),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + i + 3),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + i + 4),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + i + 5),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + i + 6),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + i + 7));
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + i + 0),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + i + 1),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + i + 2),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + i + 3),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + i + 4),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + i + 5),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + i + 6),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + i + 7));
}
static void
printf_filtered
("FR%d-FR%d %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
i, i + 7,
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + i + 0),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + i + 1),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + i + 2),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + i + 3),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + i + 4),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + i + 5),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + i + 6),
- (long) get_frame_register_unsigned (frame, FP0_REGNUM + i + 7));
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + i + 0),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + i + 1),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + i + 2),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + i + 3),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + i + 4),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + i + 5),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + i + 6),
+ (long) get_frame_register_unsigned
+ (frame, gdbarch_fp0_regnum (current_gdbarch) + i + 7));
}
/* FIXME!!! This only shows the registers for shmedia, excluding the
static struct type *
sh64_register_type (struct gdbarch *gdbarch, int reg_nr)
{
- if ((reg_nr >= FP0_REGNUM
+ if ((reg_nr >= gdbarch_fp0_regnum (current_gdbarch)
&& reg_nr <= FP_LAST_REGNUM)
|| (reg_nr >= FP0_C_REGNUM
&& reg_nr <= FP_LAST_C_REGNUM))
int j;
/* Allocate space for the float. */
- raw_buffer = (unsigned char *) alloca (register_size (gdbarch, FP0_REGNUM));
+ raw_buffer = (unsigned char *) alloca
+ (register_size (gdbarch,
+ gdbarch_fp0_regnum
+ (current_gdbarch)));
/* Get the data in raw format. */
if (!frame_register_read (frame, regnum, raw_buffer))
regnum ++;
}
else
- regnum += FP_LAST_REGNUM - FP0_REGNUM; /* skip FP regs */
+ regnum += FP_LAST_REGNUM - gdbarch_fp0_regnum (current_gdbarch);
+ /* skip FP regs */
}
else
{
setup yet. Try to reconstruct the base address for the stack
frame by looking at the stack pointer. For truly "frameless"
functions this might work too. */
- cache->base = frame_unwind_register_unsigned (next_frame, SP_REGNUM);
+ cache->base = frame_unwind_register_unsigned
+ (next_frame, gdbarch_sp_regnum (current_gdbarch));
}
/* Now that we have the base address for the stack frame we can
gdb_assert (regnum >= 0);
- if (regnum == SP_REGNUM && cache->saved_sp)
+ if (regnum == gdbarch_sp_regnum (current_gdbarch) && cache->saved_sp)
{
*optimizedp = 0;
*lvalp = not_lval;
{
/* Store the value. */
store_unsigned_integer (valuep,
- register_size (current_gdbarch, SP_REGNUM),
+ register_size (current_gdbarch,
+ gdbarch_sp_regnum (current_gdbarch)),
cache->saved_sp);
}
return;
/* The PC of the previous frame is stored in the PR register of
the current frame. Frob regnum so that we pull the value from
the correct place. */
- if (regnum == PC_REGNUM)
+ if (regnum == gdbarch_pc_regnum (current_gdbarch))
regnum = PR_REGNUM;
if (regnum < SIM_SH64_NR_REGS && cache->saved_regs[regnum] != -1)
static CORE_ADDR
sh64_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
{
- return frame_unwind_register_unsigned (next_frame, SP_REGNUM);
+ return frame_unwind_register_unsigned (next_frame,
+ gdbarch_sp_regnum (current_gdbarch));
}
static CORE_ADDR
sh64_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
{
- return frame_unwind_register_unsigned (next_frame, PC_REGNUM);
+ return frame_unwind_register_unsigned (next_frame,
+ gdbarch_pc_regnum (current_gdbarch));
}
static struct frame_id
/* Determine if PT_GETREGS fetches this register. */
#define GETREGS_SUPPLIES(regno) \
(((regno) >= R0_REGNUM && (regno) <= (R0_REGNUM + 15)) \
-|| (regno) == PC_REGNUM || (regno) == PR_REGNUM \
+|| (regno) == gdbarch_pc_regnum (current_gdbarch) || (regno) == PR_REGNUM \
|| (regno) == MACH_REGNUM || (regno) == MACL_REGNUM \
|| (regno) == SR_REGNUM)
gdb_assert (len >= SHNBSD_SIZEOF_GREGS);
- if (regnum == PC_REGNUM || regnum == -1)
- regcache_raw_supply (regcache, PC_REGNUM, regs + (0 * 4));
+ if (regnum == gdbarch_pc_regnum (current_gdbarch) || regnum == -1)
+ regcache_raw_supply (regcache,
+ gdbarch_pc_regnum (current_gdbarch),
+ regs + (0 * 4));
if (regnum == SR_REGNUM || regnum == -1)
regcache_raw_supply (regcache, SR_REGNUM, regs + (1 * 4));
gdb_assert (len >= SHNBSD_SIZEOF_GREGS);
- if (regnum == PC_REGNUM || regnum == -1)
- regcache_raw_collect (regcache, PC_REGNUM, regs + (0 * 4));
+ if (regnum == gdbarch_pc_regnum (current_gdbarch) || regnum == -1)
+ regcache_raw_collect (regcache, gdbarch_pc_regnum (current_gdbarch),
+ regs + (0 * 4));
if (regnum == SR_REGNUM || regnum == -1)
regcache_raw_collect (regcache, SR_REGNUM, regs + (1 * 4));
gdbarch_num_regs (current_gdbarch)
+ gdbarch_num_pseudo_regs (current_gdbarch),
SYMBOL_PRINT_NAME (sym));
- SYMBOL_VALUE (sym) = SP_REGNUM; /* Known safe, though useless */
+ SYMBOL_VALUE (sym) = gdbarch_sp_regnum (current_gdbarch);
+ /* Known safe, though useless */
}
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, &local_symbols);
gdbarch_num_regs (current_gdbarch)
+ gdbarch_num_pseudo_regs (current_gdbarch),
SYMBOL_PRINT_NAME (sym));
- SYMBOL_VALUE (sym) = SP_REGNUM; /* Known safe, though useless */
+ SYMBOL_VALUE (sym) = gdbarch_sp_regnum (current_gdbarch);
+ /* Known safe, though useless */
}
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
if (within_function)
gdbarch_num_regs (current_gdbarch)
+ gdbarch_num_pseudo_regs (current_gdbarch),
SYMBOL_PRINT_NAME (sym));
- SYMBOL_VALUE (sym) = SP_REGNUM; /* Known safe, though useless */
+ SYMBOL_VALUE (sym) = gdbarch_sp_regnum (current_gdbarch);
+ /* Known safe, though useless */
}
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, &local_symbols);
/* Name of the value returned by get_frame_pc(). Per comments, "pc"
is not a good name. */
- if (PC_REGNUM >= 0)
- /* OK, this is weird. The PC_REGNUM hardware register's value can
+ if (gdbarch_pc_regnum (current_gdbarch) >= 0)
+ /* OK, this is weird. The gdbarch_pc_regnum hardware register's value can
easily not match that of the internal value returned by
get_frame_pc(). */
- pc_regname = gdbarch_register_name (current_gdbarch, PC_REGNUM);
+ pc_regname = gdbarch_register_name (current_gdbarch,
+ gdbarch_pc_regnum (current_gdbarch));
else
- /* But then, this is weird to. Even without PC_REGNUM, an
+ /* But then, this is weird to. Even without gdbarch_pc_regnum, an
architectures will often have a hardware register called "pc",
and that register's value, again, can easily not match
get_frame_pc(). */
at one stage the frame cached the previous frame's SP instead
of its address, hence it was easiest to just display the cached
value. */
- if (SP_REGNUM >= 0)
+ if (gdbarch_sp_regnum (current_gdbarch) >= 0)
{
/* Find out the location of the saved stack pointer with out
actually evaluating it. */
- frame_register_unwind (fi, SP_REGNUM, &optimized, &lval, &addr,
+ frame_register_unwind (fi, gdbarch_sp_regnum (current_gdbarch),
+ &optimized, &lval, &addr,
&realnum, NULL);
if (!optimized && lval == not_lval)
{
gdb_byte value[MAX_REGISTER_SIZE];
CORE_ADDR sp;
- frame_register_unwind (fi, SP_REGNUM, &optimized, &lval, &addr,
+ frame_register_unwind (fi, gdbarch_sp_regnum (current_gdbarch),
+ &optimized, &lval, &addr,
&realnum, value);
/* NOTE: cagney/2003-05-22: This is assuming that the
stack pointer was packed as an unsigned integer. That
may or may not be valid. */
- sp = extract_unsigned_integer (value, register_size (current_gdbarch, SP_REGNUM));
+ sp = extract_unsigned_integer (value,
+ register_size (current_gdbarch,
+ gdbarch_sp_regnum (current_gdbarch)));
printf_filtered (" Previous frame's sp is ");
deprecated_print_address_numeric (sp, 1, gdb_stdout);
printf_filtered ("\n");
numregs = gdbarch_num_regs (current_gdbarch)
+ gdbarch_num_pseudo_regs (current_gdbarch);
for (i = 0; i < numregs; i++)
- if (i != SP_REGNUM
+ if (i != gdbarch_sp_regnum (current_gdbarch)
&& gdbarch_register_reggroup_p (current_gdbarch, i, all_reggroup))
{
/* Find out the location of the saved register without
static struct value *
value_of_builtin_frame_pc_reg (struct frame_info *frame, const void *baton)
{
- if (PC_REGNUM >= 0)
- return value_of_register (PC_REGNUM, frame);
+ if (gdbarch_pc_regnum (current_gdbarch) >= 0)
+ return value_of_register (gdbarch_pc_regnum (current_gdbarch), frame);
else
{
struct value *val = allocate_value (builtin_type_void_data_ptr);
static struct value *
value_of_builtin_frame_sp_reg (struct frame_info *frame, const void *baton)
{
-#ifdef SP_REGNUM
- if (SP_REGNUM >= 0)
- return value_of_register (SP_REGNUM, frame);
-#endif
+ if (gdbarch_sp_regnum (current_gdbarch) >= 0)
+ return value_of_register (gdbarch_sp_regnum (current_gdbarch), frame);
error (_("Standard register ``$sp'' is not available for this target"));
}
static struct value *
value_of_builtin_frame_ps_reg (struct frame_info *frame, const void *baton)
{
-#ifdef PS_REGNUM
- if (PS_REGNUM >= 0)
- return value_of_register (PS_REGNUM, frame);
-#endif
+ if (gdbarch_ps_regnum (current_gdbarch) >= 0)
+ return value_of_register (gdbarch_ps_regnum (current_gdbarch), frame);
error (_("Standard register ``$ps'' is not available for this target"));
}
static CORE_ADDR
v850_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
{
- return frame_unwind_register_unsigned (next_frame, SP_REGNUM);
+ return frame_unwind_register_unsigned (next_frame,
+ gdbarch_sp_regnum (current_gdbarch));
}
static CORE_ADDR
v850_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
{
- return frame_unwind_register_unsigned (next_frame, PC_REGNUM);
+ return frame_unwind_register_unsigned (next_frame,
+ gdbarch_pc_regnum (current_gdbarch));
}
static struct frame_id
if (step)
{
/* Single step by setting t bit */
- win32_fetch_inferior_registers (get_current_regcache (), PS_REGNUM);
+ win32_fetch_inferior_registers (get_current_regcache (),
+ gdbarch_ps_regnum (current_gdbarch));
th->context.EFlags |= FLAG_TRACE_BIT;
}
if (step)
{
/* Single step by setting t bit */
- win32_fetch_inferior_registers (get_current_regcache (), PS_REGNUM);
+ win32_fetch_inferior_registers (get_current_regcache (),
+ gdbarch_ps_regnum (current_gdbarch));
th->context.EFlags |= FLAG_TRACE_BIT;
}
|| (regnum >= A0_BASE && regnum < A0_BASE + 16))
return builtin_type_int;
- if (regnum == PC_REGNUM || regnum == A1_REGNUM)
+ if (regnum == gdbarch_pc_regnum (current_gdbarch) || regnum == A1_REGNUM)
return lookup_pointer_type (builtin_type_void);
/* Return the stored type for all other registers. */
DEBUGTRACE ("xtensa_supply_gregset (..., regnum==%d, ...) \n", regnum);
- if (regnum == PC_REGNUM || regnum == -1)
- regcache_raw_supply (rc, PC_REGNUM, (char *) ®s->pc);
- if (regnum == PS_REGNUM || regnum == -1)
- regcache_raw_supply (rc, PS_REGNUM, (char *) ®s->ps);
+ if (regnum == gdbarch_pc_regnum (current_gdbarch) || regnum == -1)
+ regcache_raw_supply (rc,
+ gdbarch_pc_regnum (current_gdbarch),
+ (char *) ®s->pc);
+ if (regnum == gdbarch_ps_regnum (current_gdbarch) || regnum == -1)
+ regcache_raw_supply (rc, gdbarch_ps_regnum (current_gdbarch),
+ (char *) ®s->ps);
if (regnum == WB_REGNUM || regnum == -1)
regcache_raw_supply (rc, WB_REGNUM, (char *) ®s->windowbase);
if (regnum == WS_REGNUM || regnum == -1)
DEBUGTRACE ("xtensa_unwind_pc (next_frame = %p)\n", next_frame);
- frame_unwind_register (next_frame, PC_REGNUM, buf);
+ frame_unwind_register (next_frame, gdbarch_pc_regnum (current_gdbarch), buf);
DEBUGINFO ("[xtensa_unwind_pc] pc = 0x%08x\n", (unsigned int)
extract_typed_address (buf, builtin_type_void_func_ptr));
/* Get windowbase, windowstart, ps, and pc. */
wb = frame_unwind_register_unsigned (next_frame, WB_REGNUM);
ws = frame_unwind_register_unsigned (next_frame, WS_REGNUM);
- ps = frame_unwind_register_unsigned (next_frame, PS_REGNUM);
- pc = frame_unwind_register_unsigned (next_frame, PC_REGNUM);
+ ps = frame_unwind_register_unsigned (next_frame,
+ gdbarch_ps_regnum (current_gdbarch));
+ pc = frame_unwind_register_unsigned (next_frame,
+ gdbarch_pc_regnum (current_gdbarch));
op1 = read_memory_integer (pc, 1);
if (XTENSA_IS_ENTRY (op1) || !windowing_enabled (ps))
}
else if (regnum == WB_REGNUM)
saved_reg = cache->wb;
- else if (regnum == PC_REGNUM)
+ else if (regnum == gdbarch_pc_regnum (current_gdbarch))
saved_reg = cache->pc;
- else if (regnum == PS_REGNUM)
+ else if (regnum == gdbarch_ps_regnum (current_gdbarch))
saved_reg = cache->ps;
else
done = 0;
gdb_assert(len > 0);
/* First, we have to find the caller window in the register file. */
- regcache_raw_read_unsigned (regcache, PC_REGNUM, &pc);
+ regcache_raw_read_unsigned (regcache,
+ gdbarch_pc_regnum (current_gdbarch), &pc);
callsize = extract_call_winsize (pc);
/* On Xtensa, we can return up to 4 words (or 2 when called by call12). */
DEBUGTRACE ("xtensa_store_return_value (...)\n");
regcache_raw_read_unsigned (regcache, WB_REGNUM, &wb);
- regcache_raw_read_unsigned (regcache, PC_REGNUM, &pc);
+ regcache_raw_read_unsigned (regcache,
+ gdbarch_pc_regnum (current_gdbarch), &pc);
callsize = extract_call_winsize (pc);
if (len > (callsize > 8 ? 8 : 16))
saved in the dummy frame, so we can savely overwrite A0 here. */
ra = (bp_addr & 0x3fffffff) | 0x40000000;
- regcache_raw_read (regcache, PS_REGNUM, buf);
+ regcache_raw_read (regcache, gdbarch_ps_regnum (current_gdbarch), buf);
ps = extract_unsigned_integer (buf, 4) & ~0x00030000;
regcache_cooked_write_unsigned (regcache, A4_REGNUM, ra);
- regcache_cooked_write_unsigned (regcache, PS_REGNUM, ps | 0x00010000);
+ regcache_cooked_write_unsigned (regcache,
+ gdbarch_ps_regnum (current_gdbarch),
+ ps | 0x00010000);
/* Set new stack pointer and return it. */
regcache_cooked_write_unsigned (regcache, A1_REGNUM, sp);