aboutsummaryrefslogtreecommitdiff
path: root/gdb/alpha-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
commit598cc9dc84aeaa66e4a77efa9dc8ff03d5532620 (patch)
tree893c53ac4f0f6e383420bc890802b740f493e091 /gdb/alpha-tdep.c
parent8b55a7e4e5b30877e924e4b0ed0437d16ccdcedf (diff)
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/alpha-tdep.c')
-rw-r--r--gdb/alpha-tdep.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c
index 8716fd860f..58e6ee323f 100644
--- a/gdb/alpha-tdep.c
+++ b/gdb/alpha-tdep.c
@@ -645,14 +645,10 @@ alpha_return_in_memory_always (struct type *type)
return 1;
}
-static const gdb_byte *
-alpha_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pc, int *len)
-{
- static const gdb_byte break_insn[] = { 0x80, 0, 0, 0 }; /* call_pal bpt */
- *len = sizeof(break_insn);
- return break_insn;
-}
+static const gdb_byte break_insn[] = { 0x80, 0, 0, 0 }; /* call_pal bpt */
+
+GDBARCH_BREAKPOINT_MANIPULATION (alpha, break_insn)
/* This returns the PC of the first insn after the prologue.
@@ -1822,7 +1818,7 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
- set_gdbarch_breakpoint_from_pc (gdbarch, alpha_breakpoint_from_pc);
+ SET_GDBARCH_BREAKPOINT_MANIPULATION (alpha);
set_gdbarch_decr_pc_after_break (gdbarch, ALPHA_INSN_SIZE);
set_gdbarch_cannot_step_breakpoint (gdbarch, 1);