/* Target-dependent code for the Matsushita MN10300 for GDB, the GNU debugger.
- Copyright (C) 1996-2015 Free Software Foundation, Inc.
+ Copyright (C) 1996-2017 Free Software Foundation, Inc.
This file is part of GDB.
case TYPE_CODE_FLT:
case TYPE_CODE_PTR:
case TYPE_CODE_REF:
+ case TYPE_CODE_RVALUE_REF:
return TYPE_LENGTH (type);
case TYPE_CODE_COMPLEX:
The Matsushita mn10x00 processors have single byte instructions
so we need a single byte breakpoint. Matsushita hasn't defined
one, so we defined it ourselves. */
+constexpr gdb_byte mn10300_break_insn[] = {0xff};
-static const unsigned char *
-mn10300_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *bp_addr,
- int *bp_size)
-{
- static gdb_byte breakpoint[] = {0xff};
- *bp_size = 1;
- return breakpoint;
-}
+typedef BP_MANIPULATION (mn10300_break_insn) mn10300_breakpoint;
/* Model the semantics of pushing a register onto the stack. This
is a helper function for mn10300_analyze_prologue, below. */
stop_addr = func_start;
mn10300_analyze_prologue (get_frame_arch (this_frame),
- func_start, stop_addr, *this_prologue_cache);
+ func_start, stop_addr,
+ ((struct mn10300_prologue *)
+ *this_prologue_cache));
}
- return *this_prologue_cache;
+ return (struct mn10300_prologue *) *this_prologue_cache;
}
/* Given the next frame and a prologue cache, return this frame's
mn10300_frame_prev_register (struct frame_info *this_frame,
void **this_prologue_cache, int regnum)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (get_frame_arch (this_frame));
struct mn10300_prologue *p
= mn10300_analyze_frame_prologue (this_frame, this_prologue_cache);
CORE_ADDR frame_base = mn10300_frame_base (this_frame, this_prologue_cache);
- int reg_size = register_size (get_frame_arch (this_frame), regnum);
if (regnum == E_SP_REGNUM)
return frame_unwind_got_constant (this_frame, regnum, frame_base);
if (dwarf2 < 0
|| dwarf2 >= ARRAY_SIZE (dwarf2_to_gdb))
- {
- warning (_("Bogus register number in debug info: %d"), dwarf2);
- return -1;
- }
+ return -1;
return dwarf2_to_gdb[dwarf2];
}
/* Stack unwinding. */
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
/* Breakpoints. */
- set_gdbarch_breakpoint_from_pc (gdbarch, mn10300_breakpoint_from_pc);
+ set_gdbarch_breakpoint_kind_from_pc (gdbarch,
+ mn10300_breakpoint::kind_from_pc);
+ set_gdbarch_sw_breakpoint_from_kind (gdbarch,
+ mn10300_breakpoint::bp_from_kind);
/* decr_pc_after_break? */
/* Disassembly. */
set_gdbarch_print_insn (gdbarch, print_insn_mn10300);