/* Target-dependent code for the Matsushita MN10300 for GDB, the GNU debugger.
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software
Foundation, Inc.
This file is part of GDB.
dummy->frame = frame;
dummy->extra_info->status = 0;
dummy->extra_info->stack_size = 0;
- memset (dummy->saved_regs, '\000', SIZEOF_FRAME_SAVED_REGS);
+ memset (get_frame_saved_regs (dummy), '\000', SIZEOF_FRAME_SAVED_REGS);
mn10300_analyze_prologue (dummy, 0);
return dummy;
}
/* The `other' bit leaves a blank area of four bytes at the
beginning of its block of saved registers, making it 32 bytes
long in total. */
- fi->saved_regs[LAR_REGNUM] = fi->frame + offset + 4;
- fi->saved_regs[LIR_REGNUM] = fi->frame + offset + 8;
- fi->saved_regs[MDR_REGNUM] = fi->frame + offset + 12;
- fi->saved_regs[A0_REGNUM + 1] = fi->frame + offset + 16;
- fi->saved_regs[A0_REGNUM] = fi->frame + offset + 20;
- fi->saved_regs[D0_REGNUM + 1] = fi->frame + offset + 24;
- fi->saved_regs[D0_REGNUM] = fi->frame + offset + 28;
+ get_frame_saved_regs (fi)[LAR_REGNUM] = fi->frame + offset + 4;
+ get_frame_saved_regs (fi)[LIR_REGNUM] = fi->frame + offset + 8;
+ get_frame_saved_regs (fi)[MDR_REGNUM] = fi->frame + offset + 12;
+ get_frame_saved_regs (fi)[A0_REGNUM + 1] = fi->frame + offset + 16;
+ get_frame_saved_regs (fi)[A0_REGNUM] = fi->frame + offset + 20;
+ get_frame_saved_regs (fi)[D0_REGNUM + 1] = fi->frame + offset + 24;
+ get_frame_saved_regs (fi)[D0_REGNUM] = fi->frame + offset + 28;
offset += 32;
}
if (movm_args & movm_a3_bit)
{
- fi->saved_regs[A3_REGNUM] = fi->frame + offset;
+ get_frame_saved_regs (fi)[A3_REGNUM] = fi->frame + offset;
offset += 4;
}
if (movm_args & movm_a2_bit)
{
- fi->saved_regs[A2_REGNUM] = fi->frame + offset;
+ get_frame_saved_regs (fi)[A2_REGNUM] = fi->frame + offset;
offset += 4;
}
if (movm_args & movm_d3_bit)
{
- fi->saved_regs[D3_REGNUM] = fi->frame + offset;
+ get_frame_saved_regs (fi)[D3_REGNUM] = fi->frame + offset;
offset += 4;
}
if (movm_args & movm_d2_bit)
{
- fi->saved_regs[D2_REGNUM] = fi->frame + offset;
+ get_frame_saved_regs (fi)[D2_REGNUM] = fi->frame + offset;
offset += 4;
}
if (AM33_MODE)
{
if (movm_args & movm_exother_bit)
{
- fi->saved_regs[MCVF_REGNUM] = fi->frame + offset;
- fi->saved_regs[MCRL_REGNUM] = fi->frame + offset + 4;
- fi->saved_regs[MCRH_REGNUM] = fi->frame + offset + 8;
- fi->saved_regs[MDRQ_REGNUM] = fi->frame + offset + 12;
- fi->saved_regs[E0_REGNUM + 1] = fi->frame + offset + 16;
- fi->saved_regs[E0_REGNUM + 0] = fi->frame + offset + 20;
+ get_frame_saved_regs (fi)[MCVF_REGNUM] = fi->frame + offset;
+ get_frame_saved_regs (fi)[MCRL_REGNUM] = fi->frame + offset + 4;
+ get_frame_saved_regs (fi)[MCRH_REGNUM] = fi->frame + offset + 8;
+ get_frame_saved_regs (fi)[MDRQ_REGNUM] = fi->frame + offset + 12;
+ get_frame_saved_regs (fi)[E0_REGNUM + 1] = fi->frame + offset + 16;
+ get_frame_saved_regs (fi)[E0_REGNUM + 0] = fi->frame + offset + 20;
offset += 24;
}
if (movm_args & movm_exreg1_bit)
{
- fi->saved_regs[E0_REGNUM + 7] = fi->frame + offset;
- fi->saved_regs[E0_REGNUM + 6] = fi->frame + offset + 4;
- fi->saved_regs[E0_REGNUM + 5] = fi->frame + offset + 8;
- fi->saved_regs[E0_REGNUM + 4] = fi->frame + offset + 12;
+ get_frame_saved_regs (fi)[E0_REGNUM + 7] = fi->frame + offset;
+ get_frame_saved_regs (fi)[E0_REGNUM + 6] = fi->frame + offset + 4;
+ get_frame_saved_regs (fi)[E0_REGNUM + 5] = fi->frame + offset + 8;
+ get_frame_saved_regs (fi)[E0_REGNUM + 4] = fi->frame + offset + 12;
offset += 16;
}
if (movm_args & movm_exreg0_bit)
{
- fi->saved_regs[E0_REGNUM + 3] = fi->frame + offset;
- fi->saved_regs[E0_REGNUM + 2] = fi->frame + offset + 4;
+ get_frame_saved_regs (fi)[E0_REGNUM + 3] = fi->frame + offset;
+ get_frame_saved_regs (fi)[E0_REGNUM + 2] = fi->frame + offset + 4;
offset += 8;
}
}
/* Reserve four bytes for every register saved. */
for (i = 0; i < NUM_REGS; i++)
- if (fi->saved_regs[i])
+ if (get_frame_saved_regs (fi)[i])
adjust += 4;
/* If we saved LIR, then it's most likely we used a `movm'
instruction with the `other' bit set, in which case the SP is
decremented by an extra four bytes, "to simplify calculation
of the transfer area", according to the processor manual. */
- if (fi->saved_regs[LIR_REGNUM])
+ if (get_frame_saved_regs (fi)[LIR_REGNUM])
adjust += 4;
return adjust;
{
/* Our caller has a frame pointer. So find the frame in $a3 or
in the stack. */
- if (fi->saved_regs[A3_REGNUM])
- return (read_memory_integer (fi->saved_regs[A3_REGNUM], REGISTER_SIZE));
+ if (get_frame_saved_regs (fi)[A3_REGNUM])
+ return (read_memory_integer (get_frame_saved_regs (fi)[A3_REGNUM], REGISTER_SIZE));
else
return read_register (A3_REGNUM);
}
/* Restore any saved registers. */
for (regnum = 0; regnum < NUM_REGS; regnum++)
- if (frame->saved_regs[regnum] != 0)
+ if (get_frame_saved_regs (frame)[regnum] != 0)
{
ULONGEST value;
- value = read_memory_unsigned_integer (frame->saved_regs[regnum],
+ value = read_memory_unsigned_integer (get_frame_saved_regs (frame)[regnum],
REGISTER_RAW_SIZE (regnum));
write_register (regnum, value);
}
set_gdbarch_decr_pc_after_break (gdbarch, 0);
/* Stack unwinding. */
- set_gdbarch_frame_chain_valid (gdbarch, generic_file_frame_chain_valid);
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
- set_gdbarch_frame_chain_valid (gdbarch, generic_file_frame_chain_valid);
set_gdbarch_saved_pc_after_call (gdbarch, mn10300_saved_pc_after_call);
set_gdbarch_init_extra_frame_info (gdbarch, mn10300_init_extra_frame_info);
set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_noop);