/* Target-dependent code for Xilinx MicroBlaze.
- Copyright (C) 2009-2015 Free Software Foundation, Inc.
+ Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of GDB.
\f
static unsigned int microblaze_debug_flag = 0;
-static void
+static void ATTRIBUTE_PRINTF (1, 2)
microblaze_debug (const char *fmt, ...)
{
if (microblaze_debug_flag)
return extract_unsigned_integer (buf, 4, byte_order);
}
\f
-static const gdb_byte *
-microblaze_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pc,
- int *len)
-{
- static gdb_byte break_insn[] = MICROBLAZE_BREAKPOINT;
+constexpr gdb_byte microblaze_break_insn[] = MICROBLAZE_BREAKPOINT;
+
+typedef BP_MANIPULATION (microblaze_break_insn) microblaze_breakpoint;
- *len = sizeof (break_insn);
- return break_insn;
-}
\f
/* Allocate and initialize a frame cache. */
{
struct microblaze_frame_cache *cache;
struct gdbarch *gdbarch = get_frame_arch (next_frame);
- CORE_ADDR func;
int rn;
if (*this_cache)
for (rn = 0; rn < gdbarch_num_regs (gdbarch); rn++)
cache->register_offsets[rn] = -1;
- func = get_frame_func (next_frame);
+ /* Call for side effects. */
+ get_frame_func (next_frame);
cache->pc = get_frame_address_in_block (next_frame);
}
/* Allocate space for the new architecture. */
- tdep = XNEW (struct gdbarch_tdep);
+ tdep = XCNEW (struct gdbarch_tdep);
gdbarch = gdbarch_alloc (&info, tdep);
set_gdbarch_long_double_bit (gdbarch, 128);
/* Stack grows downward. */
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
- set_gdbarch_breakpoint_from_pc (gdbarch, microblaze_breakpoint_from_pc);
+ set_gdbarch_breakpoint_kind_from_pc (gdbarch,
+ microblaze_breakpoint::kind_from_pc);
+ set_gdbarch_sw_breakpoint_from_kind (gdbarch,
+ microblaze_breakpoint::bp_from_kind);
set_gdbarch_frame_args_skip (gdbarch, 8);
- set_gdbarch_print_insn (gdbarch, print_insn_microblaze);
-
set_gdbarch_write_pc (gdbarch, microblaze_write_pc);
set_gdbarch_unwind_pc (gdbarch, microblaze_unwind_pc);
return gdbarch;
}
-/* Provide a prototype to silence -Wmissing-prototypes. */
-void _initialize_microblaze_tdep (void);
-
void
_initialize_microblaze_tdep (void)
{