aboutsummaryrefslogtreecommitdiff
path: root/gdb/iq2000-tdep.c
diff options
context:
space:
mode:
authorYao Qi <yao.qi@linaro.org>2016-11-03 14:35:13 +0000
committerYao Qi <yao.qi@linaro.org>2016-11-03 14:35:13 +0000
commitd19280adb5b2d1470dc39756ccac8a8fa2af8321 (patch)
treec452ae7ecd2c45f4dfbfe404eb4bd5a7c99aaf28 /gdb/iq2000-tdep.c
parent44f1c4d7b0160a51ecf7fe1af42416f1d2a71356 (diff)
downloadgdb-d19280adb5b2d1470dc39756ccac8a8fa2af8321.zip
gdb-d19280adb5b2d1470dc39756ccac8a8fa2af8321.tar.gz
gdb-d19280adb5b2d1470dc39756ccac8a8fa2af8321.tar.bz2
Split breakpoint_from_pc to breakpoint_kind_from_pc and sw_breakpoint_from_kind
We convert each ARCH_breakpoint_from_pc to ARCH_breakpoint_kind_from_pc and ARCH_sw_breakpoint_from_kind. Note that gdbarch doesn't have methods breakpoint_kind_from_pc and sw_breakpoint_from_kind so far. gdb: 2016-11-03 Yao Qi <yao.qi@linaro.org> * arch-utils.h (GDBARCH_BREAKPOINT_FROM_PC): New macro. (GDBARCH_BREAKPOINT_MANIPULATION_ENDIAN): New macro. * arm-tdep.c (arm_breakpoint_from_pc): Remove. (arm_breakpoint_kind_from_pc): New function. (arm_sw_breakpoint_from_kind): New function. (arm_breakpoint_from_pc): Call arm_breakpoint_kind_from_pc and arm_sw_breakpoint_from_kind. Use GDBARCH_BREAKPOINT_FROM_PC. (arm_remote_breakpoint_from_pc): Call arm_breakpoint_kind_from_pc. (arm_gdbarch_init): Replace set_gdbarch_breakpoint_from_pc with SET_GDBARCH_BREAKPOINT_MANIPULATION. * arc-tdep.c: Likewise. * bfin-tdep.c: Likewise. * cris-tdep.c: Likewise. * iq2000-tdep.c: Likewise. * m32r-tdep.c: Likewise. * mips-tdep.c: Likewise. * mt-tdep.c: Likewise. * nios2-tdep.c: Likewise. * rs6000-tdep.c: Likewise. * score-tdep.c: Likewise. * sh-tdep.c: Likewise. * sh64-tdep.c: Likewise. * tic6x-tdep.c: Likewise. * v850-tdep.c: Likewise. * xtensa-tdep.c: Likewise.
Diffstat (limited to 'gdb/iq2000-tdep.c')
-rw-r--r--gdb/iq2000-tdep.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/gdb/iq2000-tdep.c b/gdb/iq2000-tdep.c
index 600d70a..ecd9074 100644
--- a/gdb/iq2000-tdep.c
+++ b/gdb/iq2000-tdep.c
@@ -469,22 +469,29 @@ static const struct frame_base iq2000_frame_base = {
iq2000_frame_base_address
};
-static const unsigned char *
-iq2000_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr,
- int *lenptr)
+static int
+iq2000_breakpoint_kind_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr)
{
- static const unsigned char big_breakpoint[] = { 0x00, 0x00, 0x00, 0x0d };
- static const unsigned char little_breakpoint[] = { 0x0d, 0x00, 0x00, 0x00 };
-
if ((*pcptr & 3) != 0)
error (_("breakpoint_from_pc: invalid breakpoint address 0x%lx"),
(long) *pcptr);
- *lenptr = 4;
+ return 4;
+}
+
+static const gdb_byte *
+iq2000_sw_breakpoint_from_kind (struct gdbarch *gdbarch, int kind, int *size)
+{
+ static const unsigned char big_breakpoint[] = { 0x00, 0x00, 0x00, 0x0d };
+ static const unsigned char little_breakpoint[] = { 0x0d, 0x00, 0x00, 0x00 };
+ *size = kind;
+
return (gdbarch_byte_order (gdbarch)
== BFD_ENDIAN_BIG) ? big_breakpoint : little_breakpoint;
}
+GDBARCH_BREAKPOINT_FROM_PC (iq2000)
+
/* Target function return value methods: */
/* Function: store_return_value
@@ -826,7 +833,7 @@ iq2000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_double_format (gdbarch, floatformats_ieee_double);
set_gdbarch_long_double_format (gdbarch, floatformats_ieee_double);
set_gdbarch_return_value (gdbarch, iq2000_return_value);
- set_gdbarch_breakpoint_from_pc (gdbarch, iq2000_breakpoint_from_pc);
+ SET_GDBARCH_BREAKPOINT_MANIPULATION (iq2000);
set_gdbarch_frame_args_skip (gdbarch, 0);
set_gdbarch_skip_prologue (gdbarch, iq2000_skip_prologue);
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);