return sp + SP_ALIGNMENT;
}
+/* Implement the breakpoint_kind_from_pc gdbarch method. */
+
static int
xtensa_breakpoint_kind_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr)
{
#define DENSITY_BIG_BREAKPOINT { 0xd2, 0x0f }
#define DENSITY_LITTLE_BREAKPOINT { 0x2d, 0xf0 }
+/* Implement the sw_breakpoint_from_kind gdbarch method. */
+
static const gdb_byte *
xtensa_sw_breakpoint_from_kind (struct gdbarch *gdbarch, int kind, int *size)
{
}
}
-GDBARCH_BREAKPOINT_FROM_PC (xtensa)
-
/* Call0 ABI support routines. */
/* Return true, if PC points to "ret" or "ret.n". */
arg was not supplied to avoid probing beyond the end of valid memory.
If memory is full of garbage that classifies as c0opc_uninteresting.
If this fails (eg. if no symbols) pc ends up 0 as it was.
- Intialize the Call0 frame and register tracking info.
+ Initialize the Call0 frame and register tracking info.
Assume it's Call0 until an 'entry' instruction is encountered.
Assume we may be in the prologue until we hit a flow control instr. */
struct ui_file *log;
struct cleanup *cleanups;
struct gdbarch_tdep *tdep;
- long length;
- char *buf;
tdep = gdbarch_tdep (gdbarch);
log = mem_fileopen ();
if (tdep->a0_base == -1)
fprintf_unfiltered (log, _("\n\ta0_base: No Ax registers"));
- buf = ui_file_xstrdup (log, &length);
- make_cleanup (xfree, buf);
- if (length > 0)
+ std::string buf = ui_file_as_string (log);
+ if (!buf.empty ())
internal_error (__FILE__, __LINE__,
- _("the following are invalid: %s"), buf);
+ _("the following are invalid: %s"), buf.c_str ());
do_cleanups (cleanups);
}
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
/* Set breakpoints. */
- SET_GDBARCH_BREAKPOINT_MANIPULATION (xtensa);
+ set_gdbarch_breakpoint_kind_from_pc (gdbarch,
+ xtensa_breakpoint_kind_from_pc);
+ set_gdbarch_sw_breakpoint_from_kind (gdbarch,
+ xtensa_sw_breakpoint_from_kind);
/* After breakpoint instruction or illegal instruction, pc still
points at break instruction, so don't decrement. */