which is unused in that case. */
#define cfa_exp_len cfa_reg
-/* Assert that the register set RS is large enough to store NUM_REGS
+/* Assert that the register set RS is large enough to store gdbarch_num_regs
columns. If necessary, enlarge the register set. */
static void
int regnum;
gdb_byte *buf;
- regnum = DWARF2_REG_TO_REGNUM (reg);
+ regnum = gdbarch_dwarf2_reg_to_regnum (current_gdbarch, reg);
buf = alloca (register_size (gdbarch, regnum));
frame_unwind_register (next_frame, regnum, buf);
complaint (&symfile_complaints, _("\
incomplete CFI data; DW_CFA_restore unspecified\n\
register %s (#%d) at 0x%s"),
- REGISTER_NAME(DWARF2_REG_TO_REGNUM(reg)),
- DWARF2_REG_TO_REGNUM(reg), paddr (fs->pc));
+ gdbarch_register_name
+ (current_gdbarch, gdbarch_dwarf2_reg_to_regnum
+ (current_gdbarch, reg)),
+ gdbarch_dwarf2_reg_to_regnum (current_gdbarch, reg),
+ paddr (fs->pc));
}
else
{
(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;
}
{
struct cleanup *old_chain;
struct gdbarch *gdbarch = get_frame_arch (next_frame);
- const int num_regs = NUM_REGS + NUM_PSEUDO_REGS;
+ const int num_regs = gdbarch_num_regs (current_gdbarch)
+ + gdbarch_num_pseudo_regs (current_gdbarch);
struct dwarf2_frame_cache *cache;
struct dwarf2_frame_state *fs;
struct dwarf2_fde *fde;
return address column; it's perfectly all right for it to
correspond to a real register. If it doesn't correspond to a
real register, or if we shouldn't treat it as such,
- DWARF2_REG_TO_REGNUM should be defined to return a number outside
- the range [0, NUM_REGS). */
+ gdbarch_dwarf2_reg_to_regnum should be defined to return a number outside
+ the range [0, gdbarch_num_regs). */
{
int column; /* CFI speak for "register number". */
for (column = 0; column < fs->regs.num_regs; column++)
{
/* Use the GDB register number as the destination index. */
- int regnum = DWARF2_REG_TO_REGNUM (column);
+ int regnum = gdbarch_dwarf2_reg_to_regnum (current_gdbarch, column);
/* If there's no corresponding GDB register, ignore it. */
if (regnum < 0 || regnum >= num_regs)
*optimizedp = 0;
*lvalp = lval_register;
*addrp = 0;
- *realnump = DWARF2_REG_TO_REGNUM (cache->reg[regnum].loc.reg);
+ *realnump = gdbarch_dwarf2_reg_to_regnum
+ (current_gdbarch, cache->reg[regnum].loc.reg);
if (valuep)
frame_unwind_register (next_frame, (*realnump), valuep);
break;
*addrp = 0;
*realnump = -1;
if (valuep)
- {
- /* Store the value. */
- store_typed_address (valuep, builtin_type_void_data_ptr, cache->cfa);
- }
+ pack_long (valuep, register_type (gdbarch, regnum), cache->cfa);
break;
case DWARF2_FRAME_REG_CFA_OFFSET:
*addrp = 0;
*realnump = -1;
if (valuep)
- {
- /* Store the value. */
- store_typed_address (valuep, builtin_type_void_data_ptr,
- cache->cfa + cache->reg[regnum].loc.offset);
- }
+ pack_long (valuep, register_type (gdbarch, regnum),
+ cache->cfa + cache->reg[regnum].loc.offset);
break;
case DWARF2_FRAME_REG_RA_OFFSET:
{
CORE_ADDR pc = cache->reg[regnum].loc.offset;
- regnum = DWARF2_REG_TO_REGNUM (cache->retaddr_reg.loc.reg);
+ regnum = gdbarch_dwarf2_reg_to_regnum
+ (current_gdbarch, cache->retaddr_reg.loc.reg);
pc += frame_unwind_register_unsigned (next_frame, regnum);
- store_typed_address (valuep, builtin_type_void_func_ptr, pc);
+ pack_long (valuep, register_type (gdbarch, regnum), pc);
}
break;