From 22f13eb869197fc45a0da2a8a96b03d39809862e Mon Sep 17 00:00:00 2001 From: Yao Qi Date: Thu, 3 Nov 2016 14:35:14 +0000 Subject: 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 * 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. --- gdb/mips-tdep.c | 9 --------- 1 file changed, 9 deletions(-) (limited to 'gdb/mips-tdep.c') diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 6a254f5..9eb2de1 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -7122,15 +7122,6 @@ mips_sw_breakpoint_from_kind (struct gdbarch *gdbarch, int kind, int *size) }; } -/* This function implements gdbarch_breakpoint_from_pc. It uses the - program counter value to determine whether a 16- or 32-bit breakpoint - should be used. It returns a pointer to a string of bytes that encode a - breakpoint instruction, stores the length of the string to *lenptr, and - adjusts pc (if necessary) to point to the actual memory location where - the breakpoint should be inserted. */ - -GDBARCH_BREAKPOINT_FROM_PC (mips) - /* Return non-zero if the standard MIPS instruction INST has a branch delay slot (i.e. it is a jump or branch instruction). This function is based on mips32_next_pc. */ -- cgit v1.1