/* 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->next = NULL;
dummy->prev = NULL;
- dummy->pc = pc;
+ deprecated_update_frame_pc_hack (dummy, pc);
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;
}
}
/* Use the PC in the frame if it's provided to look up the
start of this function. */
- pc = (fi ? fi->pc : pc);
+ pc = (fi ? get_frame_pc (fi) : pc);
/* Find the start of this function. */
status = find_pc_partial_function (pc, &name, &func_addr, &func_end);
{
if (fi->next == NULL)
fi->frame = read_sp ();
- return fi->pc;
+ return get_frame_pc (fi);
}
/* Similarly if we're stopped on the first insn of a prologue as our
frame hasn't been allocated yet. */
- if (fi && fi->pc == func_addr)
+ if (fi && get_frame_pc (fi) == func_addr)
{
if (fi->next == NULL)
fi->frame = read_sp ();
- return fi->pc;
+ return get_frame_pc (fi);
}
/* Figure out where to stop scanning. */
- stop = fi ? fi->pc : func_end;
+ stop = fi ? get_frame_pc (fi) : func_end;
/* Don't walk off the end of the function. */
stop = stop > func_end ? func_end : stop;
/* 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);
}
registers. Most of the work is done in mn10300_analyze_prologue().
Note that when we are called for the last frame (currently active frame),
- that fi->pc and fi->frame will already be setup. However, fi->frame will
+ that get_frame_pc (fi) and fi->frame will already be setup. However, fi->frame will
be valid only if this routine uses FP. For previous frames, fi-frame will
always be correct. mn10300_analyze_prologue will fix fi->frame if
it's not valid.
mn10300_init_extra_frame_info (int fromleaf, struct frame_info *fi)
{
if (fi->next)
- fi->pc = FRAME_SAVED_PC (fi->next);
+ deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (fi->next));
frame_saved_regs_zalloc (fi);
fi->extra_info = (struct frame_extra_info *)
printf_filtered ("%s: ", name);
/* Get the data */
- if (!frame_register_read (selected_frame, regnum, raw_buffer))
+ if (!frame_register_read (deprecated_selected_frame, regnum, raw_buffer))
{
printf_filtered ("[invalid]");
return;
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_init_frame_pc (gdbarch, init_frame_pc_noop);
+ set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_noop);
set_gdbarch_frame_init_saved_regs (gdbarch, mn10300_frame_init_saved_regs);
set_gdbarch_frame_chain (gdbarch, mn10300_frame_chain);
set_gdbarch_frame_saved_pc (gdbarch, mn10300_frame_saved_pc);
set_gdbarch_call_dummy_length (gdbarch, 0);
set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
set_gdbarch_call_dummy_start_offset (gdbarch, 0);
- set_gdbarch_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point);
+ set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point);
set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame);
set_gdbarch_push_arguments (gdbarch, mn10300_push_arguments);
set_gdbarch_reg_struct_has_addr (gdbarch, mn10300_reg_struct_has_addr);