aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.c
diff options
context:
space:
mode:
authorYao Qi <yao.qi@linaro.org>2016-11-03 14:35:14 +0000
committerYao Qi <yao.qi@linaro.org>2016-11-03 14:35:14 +0000
commit22f13eb869197fc45a0da2a8a96b03d39809862e (patch)
tree599a43da86c343773d10954267d7efbe516dff76 /gdb/gdbarch.c
parentc0f4a997c26760d2584946196ee5c411d1a632a6 (diff)
downloadgdb-22f13eb869197fc45a0da2a8a96b03d39809862e.zip
gdb-22f13eb869197fc45a0da2a8a96b03d39809862e.tar.gz
gdb-22f13eb869197fc45a0da2a8a96b03d39809862e.tar.bz2
Add default_breakpoint_from_pc
This patch adds the default implementation of gdbarch breakpoint_from_pc, which is, const gdb_byte * default_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr) { int kind = gdbarch_breakpoint_kind_from_pc (gdbarch, pcptr); return gdbarch_sw_breakpoint_from_kind (gdbarch, kind, lenptr); } so gdbarch can only defines sw_breakpoint_from_kind and breakpoint_kind_from_pc. gdb: 2016-11-03 Yao Qi <yao.qi@linaro.org> * arch-utils.c (default_breakpoint_from_pc): New function. * arch-utils.h (GDBARCH_BREAKPOINT_FROM_PC): Remove. (GDBARCH_BREAKPOINT_MANIPULATION): Don't use GDBARCH_BREAKPOINT_FROM_PC. (SET_GDBARCH_BREAKPOINT_MANIPULATION): Don't call set_gdbarch_breakpoint_from_pc. (default_breakpoint_from_pc): Remove declaration. * gdbarch.sh (breakpoint_from_pc): Add its default implementation. * gdbarch.c, gdbarch.h: Regenerate. * arm-tdep.c: Don't use GDBARCH_BREAKPOINT_FROM_PC. * arc-tdep.c, bfin-tdep.c, cris-tdep.c, iq2000-tdep.c: Likewise. * m32r-tdep.c, mips-tdep.c, mt-tdep.c: Likewise. * nios2-tdep.c, score-tdep.c, sh-tdep.c: Likewise. * sh64-tdep.c, tic6x-tdep.c, v850-tdep.c, xtensa-tdep.c: Likewise.
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r--gdb/gdbarch.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index a1e311b..1a3acab 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -404,6 +404,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
gdbarch->pointer_to_address = unsigned_pointer_to_address;
gdbarch->address_to_pointer = unsigned_address_to_pointer;
gdbarch->return_in_first_hidden_param_p = default_return_in_first_hidden_param_p;
+ gdbarch->breakpoint_from_pc = default_breakpoint_from_pc;
gdbarch->sw_breakpoint_from_kind = NULL;
gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
@@ -582,8 +583,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of skip_entrypoint, has predicate. */
if (gdbarch->inner_than == 0)
fprintf_unfiltered (log, "\n\tinner_than");
- if (gdbarch->breakpoint_from_pc == 0)
- fprintf_unfiltered (log, "\n\tbreakpoint_from_pc");
+ /* Skip verify of breakpoint_from_pc, invalid_p == 0 */
if (gdbarch->breakpoint_kind_from_pc == 0)
fprintf_unfiltered (log, "\n\tbreakpoint_kind_from_pc");
/* Skip verify of sw_breakpoint_from_kind, invalid_p == 0 */