summaryrefslogtreecommitdiff
path: root/gdb/cris-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/cris-tdep.c
parent44f1c4d7b0160a51ecf7fe1af42416f1d2a71356 (diff)
downloadbinutils-gdb-d19280adb5b2d1470dc39756ccac8a8fa2af8321.tar.gz
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/cris-tdep.c')
-rw-r--r--gdb/cris-tdep.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c
index 1d2952472b4..bee95cfc702 100644
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -1391,20 +1391,20 @@ cris_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
return sp;
}
-/* Use the program counter to determine the contents and size of a breakpoint
- instruction. It returns a pointer to a string of bytes that encode a
- breakpoint instruction, stores the length of the string to *lenptr, and
- adjusts pcptr (if necessary) to point to the actual memory location where
- the breakpoint should be inserted. */
+static int
+cris_breakpoint_kind_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr)
+{
+ return 2;
+}
-static const unsigned char *
-cris_breakpoint_from_pc (struct gdbarch *gdbarch,
- CORE_ADDR *pcptr, int *lenptr)
+static const gdb_byte *
+cris_sw_breakpoint_from_kind (struct gdbarch *gdbarch, int kind, int *size)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
static unsigned char break8_insn[] = {0x38, 0xe9};
static unsigned char break15_insn[] = {0x3f, 0xe9};
- *lenptr = 2;
+
+ *size = kind;
if (tdep->cris_mode == cris_mode_guru)
return break15_insn;
@@ -1412,6 +1412,14 @@ cris_breakpoint_from_pc (struct gdbarch *gdbarch,
return break8_insn;
}
+/* Use the program counter to determine the contents and size of a breakpoint
+ instruction. It returns a pointer to a string of bytes that encode a
+ breakpoint instruction, stores the length of the string to *lenptr, and
+ adjusts pcptr (if necessary) to point to the actual memory location where
+ the breakpoint should be inserted. */
+
+GDBARCH_BREAKPOINT_FROM_PC (cris)
+
/* Returns 1 if spec_reg is applicable to the current gdbarch's CRIS version,
0 otherwise. */
@@ -4123,7 +4131,7 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* The stack grows downward. */
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
- set_gdbarch_breakpoint_from_pc (gdbarch, cris_breakpoint_from_pc);
+ SET_GDBARCH_BREAKPOINT_MANIPULATION (cris);
set_gdbarch_unwind_pc (gdbarch, cris_unwind_pc);
set_gdbarch_unwind_sp (gdbarch, cris_unwind_sp);