diff options
author | Yao Qi <yao.qi@linaro.org> | 2016-11-03 14:35:14 +0000 |
---|---|---|
committer | Yao Qi <yao.qi@linaro.org> | 2016-11-03 14:35:14 +0000 |
commit | 22f13eb869197fc45a0da2a8a96b03d39809862e (patch) | |
tree | 599a43da86c343773d10954267d7efbe516dff76 /gdb/arch-utils.h | |
parent | c0f4a997c26760d2584946196ee5c411d1a632a6 (diff) | |
download | gdb-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/arch-utils.h')
-rw-r--r-- | gdb/arch-utils.h | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h index ab558e2..791725d 100644 --- a/gdb/arch-utils.h +++ b/gdb/arch-utils.h @@ -26,17 +26,6 @@ struct minimal_symbol; struct type; struct gdbarch_info; -#define GDBARCH_BREAKPOINT_FROM_PC(ARCH) \ - static const gdb_byte * \ - ARCH##_breakpoint_from_pc (struct gdbarch *gdbarch, \ - CORE_ADDR *pcptr, \ - int *lenptr) \ - { \ - int kind = ARCH##_breakpoint_kind_from_pc (gdbarch, pcptr); \ - \ - return ARCH##_sw_breakpoint_from_kind (gdbarch, kind, lenptr); \ - } - #define GDBARCH_BREAKPOINT_MANIPULATION(ARCH,BREAK_INSN) \ static int \ ARCH##_breakpoint_kind_from_pc (struct gdbarch *gdbarch, \ @@ -50,11 +39,9 @@ struct gdbarch_info; { \ *size = kind; \ return BREAK_INSN; \ - } \ - GDBARCH_BREAKPOINT_FROM_PC (ARCH) + } #define SET_GDBARCH_BREAKPOINT_MANIPULATION(ARCH) \ - set_gdbarch_breakpoint_from_pc (gdbarch, ARCH##_breakpoint_from_pc); \ set_gdbarch_breakpoint_kind_from_pc (gdbarch, \ ARCH##_breakpoint_kind_from_pc); \ set_gdbarch_sw_breakpoint_from_kind (gdbarch, \ @@ -80,8 +67,7 @@ struct gdbarch_info; return BIG_BREAK_INSN; \ else \ return LITTLE_BREAK_INSN; \ - } \ - GDBARCH_BREAKPOINT_FROM_PC (ARCH) + } /* An implementation of gdbarch_displaced_step_copy_insn for processors that don't need to modify the instruction before @@ -228,6 +214,10 @@ extern int default_has_shared_address_space (struct gdbarch *); extern int default_fast_tracepoint_valid_at (struct gdbarch *gdbarch, CORE_ADDR addr, char **msg); +extern const gdb_byte *default_breakpoint_from_pc (struct gdbarch *gdbarch, + CORE_ADDR *pcptr, + int *lenptr); + extern void default_gen_return_address (struct gdbarch *gdbarch, struct agent_expr *ax, struct axs_value *value, |