aboutsummaryrefslogtreecommitdiff
path: root/gdb/sh-tdep.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/sh-tdep.c')
-rw-r--r--gdb/sh-tdep.c36
1 files changed, 21 insertions, 15 deletions
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
index 12aedbb..6100d92 100644
--- a/gdb/sh-tdep.c
+++ b/gdb/sh-tdep.c
@@ -418,11 +418,16 @@ sh_sh4al_dsp_register_name (struct gdbarch *gdbarch, int reg_nr)
return register_names[reg_nr];
}
-static const unsigned char *
-sh_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
+static int
+sh_breakpoint_kind_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr)
{
- /* 0xc3c3 is trapa #c3, and it works in big and little endian modes. */
- static unsigned char breakpoint[] = { 0xc3, 0xc3 };
+ return 2;
+}
+
+static const gdb_byte *
+sh_sw_breakpoint_from_kind (struct gdbarch *gdbarch, int kind, int *size)
+{
+ *size = kind;
/* For remote stub targets, trapa #20 is used. */
if (strcmp (target_shortname, "remote") == 0)
@@ -431,21 +436,22 @@ sh_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
static unsigned char little_remote_breakpoint[] = { 0x20, 0xc3 };
if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
- {
- *lenptr = sizeof (big_remote_breakpoint);
- return big_remote_breakpoint;
- }
+ return big_remote_breakpoint;
else
- {
- *lenptr = sizeof (little_remote_breakpoint);
- return little_remote_breakpoint;
- }
+ return little_remote_breakpoint;
}
+ else
+ {
+ /* 0xc3c3 is trapa #c3, and it works in big and little endian
+ modes. */
+ static unsigned char breakpoint[] = { 0xc3, 0xc3 };
- *lenptr = sizeof (breakpoint);
- return breakpoint;
+ return breakpoint;
+ }
}
+GDBARCH_BREAKPOINT_FROM_PC (sh)
+
/* Prologue looks like
mov.l r14,@-r15
sts.l pr,@-r15
@@ -2274,7 +2280,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_register_type (gdbarch, sh_default_register_type);
set_gdbarch_register_reggroup_p (gdbarch, sh_register_reggroup_p);
- set_gdbarch_breakpoint_from_pc (gdbarch, sh_breakpoint_from_pc);
+ SET_GDBARCH_BREAKPOINT_MANIPULATION (sh);
set_gdbarch_print_insn (gdbarch, print_insn_sh);
set_gdbarch_register_sim_regno (gdbarch, legacy_register_sim_regno);