diff options
author | Yao Qi <yao.qi@linaro.org> | 2016-11-03 14:35:13 +0000 |
---|---|---|
committer | Yao Qi <yao.qi@linaro.org> | 2016-11-03 14:35:13 +0000 |
commit | 598cc9dc84aeaa66e4a77efa9dc8ff03d5532620 (patch) | |
tree | 893c53ac4f0f6e383420bc890802b740f493e091 /gdb/m88k-tdep.c | |
parent | 8b55a7e4e5b30877e924e4b0ed0437d16ccdcedf (diff) | |
download | gdb-598cc9dc84aeaa66e4a77efa9dc8ff03d5532620.zip gdb-598cc9dc84aeaa66e4a77efa9dc8ff03d5532620.tar.gz gdb-598cc9dc84aeaa66e4a77efa9dc8ff03d5532620.tar.bz2 |
GDBARCH_BREAKPOINT_MANIPULATION and SET_GDBARCH_BREAKPOINT_MANIPULATION
Many archs have only one kind of breakpoint, so their breakpoint_from_pc
implementations are quite similar. This patch uses macro
GDBARCH_BREAKPOINT_MANIPULATION and SET_GDBARCH_BREAKPOINT_MANIPULATION
for breakpoint_from_pc, so that we can easily switch from
breakpoint_from_pc to breakpoint_kind_from_pc and sw_breakpoint_from_kind
later.
gdb:
2016-11-03 Yao Qi <yao.qi@linaro.org>
* arch-utils.h (GDBARCH_BREAKPOINT_MANIPULATION): New macro.
(SET_GDBARCH_BREAKPOINT_MANIPULATION): New macro.
aarch64-tdep.c (aarch64_breakpoint_from_pc): Remove. Use
GDBARCH_BREAKPOINT_MANIPULATION.
(aarch64_gdbarch_init): Replace set_gdbarch_breakpoint_from_pc
with SET_GDBARCH_BREAKPOINT_MANIPULATION.
* alpha-tdep.c: Likewise.
* avr-tdep.c: Likewise.
* frv-tdep.c: Likewise.
* ft32-tdep.c: Likewise.
* h8300-tdep.c: Likewise.
* hppa-tdep.c: Likewise.
* i386-tdep.c: Likewise.
* lm32-tdep.c: Likewise.
* m32c-tdep.c: Likewise.
* m68hc11-tdep.c: Likewise.
* m68k-tdep.c: Likewise.
* m88k-tdep.c: Likewise.
* mep-tdep.c: Likewise.
* microblaze-tdep.c: Likewise.
* mn10300-tdep.c: Likewise.
* moxie-tdep.c: Likewise.
* msp430-tdep.c: Likewise.
* rl78-tdep.c: Likewise.
* rx-tdep.c: Likewise.
* s390-linux-tdep.c: Likewise.
* sparc-tdep.c: Likewise.
* spu-tdep.c: Likewise.
* tilegx-tdep.c: Likewise.
* vax-tdep.c: Likewise.
* xstormy16-tdep.c: Likewise.
Diffstat (limited to 'gdb/m88k-tdep.c')
-rw-r--r-- | gdb/m88k-tdep.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/gdb/m88k-tdep.c b/gdb/m88k-tdep.c index e8e19df..48deb53 100644 --- a/gdb/m88k-tdep.c +++ b/gdb/m88k-tdep.c @@ -97,16 +97,11 @@ m88k_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr) encode a breakpoint instruction, store the length of the string in *LEN and optionally adjust *PC to point to the correct memory location for inserting the breakpoint. */ - -static const gdb_byte * -m88k_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pc, int *len) -{ - /* tb 0,r0,511 */ - static gdb_byte break_insn[] = { 0xf0, 0x00, 0xd1, 0xff }; - *len = sizeof (break_insn); - return break_insn; -} +/* tb 0,r0,511 */ +static gdb_byte break_insn[] = { 0xf0, 0x00, 0xd1, 0xff }; + +GDBARCH_BREAKPOINT_MANIPULATION (m88k, break_insn) static CORE_ADDR m88k_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) @@ -857,7 +852,7 @@ m88k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_return_value (gdbarch, m88k_return_value); set_gdbarch_addr_bits_remove (gdbarch, m88k_addr_bits_remove); - set_gdbarch_breakpoint_from_pc (gdbarch, m88k_breakpoint_from_pc); + SET_GDBARCH_BREAKPOINT_MANIPULATION (m88k); set_gdbarch_unwind_pc (gdbarch, m88k_unwind_pc); set_gdbarch_write_pc (gdbarch, m88k_write_pc); |