mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 17:18:55 +00:00
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.
This commit is contained in:
@@ -913,14 +913,9 @@ avr_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
|
||||
it as a NOP. Thus, it should be ok. Since the avr is currently a remote
|
||||
only target, this shouldn't be a problem (I hope). TRoth/2003-05-14 */
|
||||
|
||||
static const unsigned char *
|
||||
avr_breakpoint_from_pc (struct gdbarch *gdbarch,
|
||||
CORE_ADDR *pcptr, int *lenptr)
|
||||
{
|
||||
static const unsigned char avr_break_insn [] = { 0x98, 0x95 };
|
||||
*lenptr = sizeof (avr_break_insn);
|
||||
return avr_break_insn;
|
||||
}
|
||||
static const unsigned char avr_break_insn [] = { 0x98, 0x95 };
|
||||
|
||||
GDBARCH_BREAKPOINT_MANIPULATION (avr, avr_break_insn)
|
||||
|
||||
/* Determine, for architecture GDBARCH, how a return value of TYPE
|
||||
should be returned. If it is supposed to be returned in registers,
|
||||
@@ -1514,7 +1509,7 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
||||
set_gdbarch_skip_prologue (gdbarch, avr_skip_prologue);
|
||||
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
|
||||
|
||||
set_gdbarch_breakpoint_from_pc (gdbarch, avr_breakpoint_from_pc);
|
||||
SET_GDBARCH_BREAKPOINT_MANIPULATION (avr);
|
||||
|
||||
frame_unwind_append_unwinder (gdbarch, &avr_frame_unwind);
|
||||
frame_base_set_default (gdbarch, &avr_frame_base);
|
||||
|
||||
Reference in New Issue
Block a user