Remove GDBARCH_BREAKPOINT_MANIPULATION and SET_GDBARCH_BREAKPOINT_MANIPULATION
authorYao Qi <yao.qi@linaro.org>
Thu, 3 Nov 2016 14:35:14 +0000 (14:35 +0000)
committerYao Qi <yao.qi@linaro.org>
Thu, 3 Nov 2016 14:35:14 +0000 (14:35 +0000)
Both of them are used in conversion.  We can remove them since the
conversion is done.

There are many architectures only have one breakpoint instruction,
so their gdbarch methods breakpoint_kind_from_pc and
sw_breakpoint_from_kind look very similar.  Instead of macro, we
use template "template <size_t, const gdb_byte *> struct bp_manipulation"
for these architectures.  In order to use template, I also change
breakpoint instruction of type "static const gdb_byte[]" to
"constexpr gdb_byte[]", and rename them to ARCH_break_insn.

gdb:

2016-11-03  Yao Qi  <yao.qi@linaro.org>
    Pedro Alves <palves@redhat.com>

* aarch64-tdep.c (aarch64_default_breakpoint): Change it to
constexpr.  Don't use GDBARCH_BREAKPOINT_MANIPULATION.
(aarch64_gdbarch_init): Don't use
SET_GDBARCH_BREAKPOINT_MANIPULATION.
* alpha-tdep.c (break_insn): Rename to alpha_break_insn.
Don't use GDBARCH_BREAKPOINT_MANIPULATION.
(alpha_gdbarch_init): Don't use
SET_GDBARCH_BREAKPOINT_MANIPULATION.
* arc-tdep.c (arc_gdbarch_init): Don't use
SET_GDBARCH_BREAKPOINT_MANIPULATION.
* arch-utils.h (GDBARCH_BREAKPOINT_MANIPULATION): Remove.
(struct bp_manipulation): New.
(SET_GDBARCH_BREAKPOINT_MANIPULATION): Remove.
(struct bp_manipulation_endian): New.
(BP_MANIPULATION): New.
(BP_MANIPULATION_ENDIAN): New.
* arm-tdep.c (arm_gdbarch_init): Don't use
SET_GDBARCH_BREAKPOINT_MANIPULATION.
* avr-tdep.c (avr_break_insn): Change it constexpr.
(avr_gdbarch_init): Don't use
SET_GDBARCH_BREAKPOINT_MANIPULATION.
* bfin-tdep.c (bfin_gdbarch_init): Likewise.
* cris-tdep.c (cris_gdbarch_init): Likewise.
* frv-tdep.c (breakpoint): Rename it to frv_break_insn, and
change its type to constexpr.  Don't use
GDBARCH_BREAKPOINT_MANIPULATION.
(frv_gdbarch_init): Don't use
SET_GDBARCH_BREAKPOINT_MANIPULATION.
* ft32-tdep.c (breakpoint): Rename it to ft32_break_insn and
change its type to constexpr.  Don't use
GDBARCH_BREAKPOINT_MANIPULATION.
(ft32_gdbarch_init): Don't use
SET_GDBARCH_BREAKPOINT_MANIPULATION.
* h8300-tdep.c (breakpoint): Rename it to h8300_break_insn.
Don't use GDBARCH_BREAKPOINT_MANIPULATION.
(h8300_gdbarch_init): Don't use
SET_GDBARCH_BREAKPOINT_MANIPULATION.
* hppa-tdep.c (breakpoint): Rename it to h8300_break_insn.
Don't use GDBARCH_BREAKPOINT_MANIPULATION.
(hppa_gdbarch_init): Don't use
SET_GDBARCH_BREAKPOINT_MANIPULATION.
* i386-tdep.c (break_insn): Rename it to i386_break_insn.
Don't use GDBARCH_BREAKPOINT_MANIPULATION.
(i386_gdbarch_init): Don't use
SET_GDBARCH_BREAKPOINT_MANIPULATION.
* iq2000-tdep.c (iq2000_gdbarch_init): Don't use
SET_GDBARCH_BREAKPOINT_MANIPULATION.
* lm32-tdep.c (breakpoint): Rename it to lm32_break_insn and
change its type to constexpr.  Don't use
GDBARCH_BREAKPOINT_MANIPULATION.
(lm32_gdbarch_init): Don't use
SET_GDBARCH_BREAKPOINT_MANIPULATION.
* m32c-tdep.c (break_insn): Rename it to m32c_break_insn and change
its type to constexpr.  Don't use GDBARCH_BREAKPOINT_MANIPULATION.
(m32c_gdbarch_init): Don't use
SET_GDBARCH_BREAKPOINT_MANIPULATION.
* m32r-tdep.c (m32r_gdbarch_init): Likewise.
* m68hc11-tdep.c (breakpoint): Rename it to m68hc11_break_insn and
change its type to constexpr.  Don't use GDBARCH_BREAKPOINT_MANIPULATION.
(m68hc11_gdbarch_init): Don't use SET_GDBARCH_BREAKPOINT_MANIPULATION.
* m68k-tdep.c (break_insn): Rename it to m68k_break_insn and change
its type to constexpr.  Don't use GDBARCH_BREAKPOINT_MANIPULATION.
(m68k_gdbarch_init):  Don't use
SET_GDBARCH_BREAKPOINT_MANIPULATION.
* m88k-tdep.c (break_insn): Rename it to m88k_break_insn and change
its type to constexpr.  Don't use GDBARCH_BREAKPOINT_MANIPULATION.
(m88k_gdbarch_init): Don't use
SET_GDBARCH_BREAKPOINT_MANIPULATION.
* mep-tdep.c (breakpoint): Rename it to mep_break_insn and change
its type to constexpr.  Don't use GDBARCH_BREAKPOINT_MANIPULATION.
(mep_gdbarch_init): Don't use
SET_GDBARCH_BREAKPOINT_MANIPULATION.
* microblaze-tdep.c (break_insn): Rename it to
microblaze_break_insn and change its type to constexpr.  Don't use
GDBARCH_BREAKPOINT_MANIPULATION.
(microblaze_gdbarch_init): Don't use
SET_GDBARCH_BREAKPOINT_MANIPULATION.
* mips-tdep.c (mips_gdbarch_init): Likewise.
* mn10300-tdep.c (breakpoint): Rename it to mn10300_break_insn and
change its type to constexpr.  Don't use
GDBARCH_BREAKPOINT_MANIPULATION.
(mn10300_gdbarch_init): Don't use
SET_GDBARCH_BREAKPOINT_MANIPULATION.
* moxie-tdep.c (breakpoint): Rename it to moxie_break_insn and
change its type to constexpr.  Don't use
GDBARCH_BREAKPOINT_MANIPULATION.
(moxie_gdbarch_init): Don't use
SET_GDBARCH_BREAKPOINT_MANIPULATION.
* msp430-tdep.c (breakpoint): Rename it to msp430_break_insn
and change its type to constexpr.  Don't use
GDBARCH_BREAKPOINT_MANIPULATION.
(msp430_gdbarch_init): Don't use
SET_GDBARCH_BREAKPOINT_MANIPULATION.
* mt-tdep.c (mt_gdbarch_init): Likewise.
* nds32-tdep.c (break_insn): Rename it to nds32_break_insn
and change its type to constexpr.  Don't use
GDBARCH_BREAKPOINT_MANIPULATION.
(nds32_gdbarch_init): Don't use
SET_GDBARCH_BREAKPOINT_MANIPULATION.
* nios2-tdep.c (nios2_gdbarch_init): Likewise.
* rl78-tdep.c (breakpoint): Rename it to rl78_break_ins
and change its type to rl78_break_insn.  Don't use
GDBARCH_BREAKPOINT_MANIPULATION.
(rl78_gdbarch_init): Don't use
SET_GDBARCH_BREAKPOINT_MANIPULATION.
* rs6000-tdep.c (big_breakpoint): Change its type to
constexpr.
(little_breakpoint): Likewise.
Don't use GDBARCH_BREAKPOINT_MANIPULATION_ENDIAN.
(rs6000_gdbarch_init): Don't use
SET_GDBARCH_BREAKPOINT_MANIPULATION.
* rx-tdep.c (breakpoint): Rename it to rx_break_insn and
change its type to constexpr.  Don't use
GDBARCH_BREAKPOINT_MANIPULATION.
(rx_gdbarch_init): Don't use
SET_GDBARCH_BREAKPOINT_MANIPULATION.
* s390-linux-tdep.c (breakpoint): Rename it to s390_break_insn
and change its type to constexpr.  Don't use
GDBARCH_BREAKPOINT_MANIPULATION
(s390_gdbarch_init): Don't use
SET_GDBARCH_BREAKPOINT_MANIPULATION.
* score-tdep.c (score_gdbarch_init): Likewise.
* sh-tdep.c (sh_gdbarch_init): Likewise.
* sh64-tdep.c (sh64_gdbarch_init): Likewise.
* sparc-tdep.c (break_insn): Rename it to sparc_break_insn
and change its type to constexpr.  Don't use
GDBARCH_BREAKPOINT_MANIPULATION.
(sparc32_gdbarch_init): Don't use
SET_GDBARCH_BREAKPOINT_MANIPULATION.
* spu-tdep.c (breakpoint): Rename it to spu_break_insn and change
its type to constexpr.  Don't use
GDBARCH_BREAKPOINT_MANIPULATION.
(spu_gdbarch_init): Don't use
SET_GDBARCH_BREAKPOINT_MANIPULATION.
* tic6x-tdep.c (tic6x_gdbarch_init): Likewise.
* tilegx-tdep.c (breakpoint): Rename it to tilegx_break_insn
and change its type to constexpr.  Don't use
GDBARCH_BREAKPOINT_MANIPULATION.
(tilegx_gdbarch_init): Don't use
SET_GDBARCH_BREAKPOINT_MANIPULATION.
* v850-tdep.c (v850_gdbarch_init): Likewise.
* vax-tdep.c (break_insn): Rename it to vax_break_insn and
change its type to constexpr.
Don't use GDBARCH_BREAKPOINT_MANIPULATION.
(vax_gdbarch_init): Don't use
SET_GDBARCH_BREAKPOINT_MANIPULATION.
* xstormy16-tdep.c (breakpoint): Rename it to
xstormy16_break_insn and change its type to constexpr.
Don't use GDBARCH_BREAKPOINT_MANIPULATION.
(xstormy16_gdbarch_init): Don't use
SET_GDBARCH_BREAKPOINT_MANIPULATION.
* xtensa-tdep.c (xtensa_gdbarch_init): Likewise.

45 files changed:
gdb/ChangeLog
gdb/aarch64-tdep.c
gdb/alpha-tdep.c
gdb/arc-tdep.c
gdb/arch-utils.h
gdb/arm-tdep.c
gdb/avr-tdep.c
gdb/bfin-tdep.c
gdb/cris-tdep.c
gdb/frv-tdep.c
gdb/ft32-tdep.c
gdb/h8300-tdep.c
gdb/hppa-tdep.c
gdb/i386-tdep.c
gdb/iq2000-tdep.c
gdb/lm32-tdep.c
gdb/m32c-tdep.c
gdb/m32r-tdep.c
gdb/m68hc11-tdep.c
gdb/m68k-tdep.c
gdb/m88k-tdep.c
gdb/mep-tdep.c
gdb/microblaze-tdep.c
gdb/mips-tdep.c
gdb/mn10300-tdep.c
gdb/moxie-tdep.c
gdb/msp430-tdep.c
gdb/mt-tdep.c
gdb/nds32-tdep.c
gdb/nios2-tdep.c
gdb/rl78-tdep.c
gdb/rs6000-tdep.c
gdb/rx-tdep.c
gdb/s390-linux-tdep.c
gdb/score-tdep.c
gdb/sh-tdep.c
gdb/sh64-tdep.c
gdb/sparc-tdep.c
gdb/spu-tdep.c
gdb/tic6x-tdep.c
gdb/tilegx-tdep.c
gdb/v850-tdep.c
gdb/vax-tdep.c
gdb/xstormy16-tdep.c
gdb/xtensa-tdep.c

index b9b43d758634b0def693a8b40fcab3dbb45ac74d..c1339517e07ad0beb0b499b9140bfedea073d23e 100644 (file)
@@ -1,3 +1,160 @@
+2016-11-03  Yao Qi  <yao.qi@linaro.org>
+           Pedro Alves <palves@redhat.com>
+
+       * aarch64-tdep.c (aarch64_default_breakpoint): Change it to
+       constexpr.  Don't use GDBARCH_BREAKPOINT_MANIPULATION.
+       (aarch64_gdbarch_init): Don't use
+       SET_GDBARCH_BREAKPOINT_MANIPULATION.
+       * alpha-tdep.c (break_insn): Rename to alpha_break_insn.
+       Don't use GDBARCH_BREAKPOINT_MANIPULATION.
+       (alpha_gdbarch_init): Don't use
+       SET_GDBARCH_BREAKPOINT_MANIPULATION.
+       * arc-tdep.c (arc_gdbarch_init): Don't use
+       SET_GDBARCH_BREAKPOINT_MANIPULATION.
+       * arch-utils.h (GDBARCH_BREAKPOINT_MANIPULATION): Remove.
+       (struct bp_manipulation): New.
+       (SET_GDBARCH_BREAKPOINT_MANIPULATION): Remove.
+       (struct bp_manipulation_endian): New.
+       (BP_MANIPULATION): New.
+       (BP_MANIPULATION_ENDIAN): New.
+       * arm-tdep.c (arm_gdbarch_init): Don't use
+       SET_GDBARCH_BREAKPOINT_MANIPULATION.
+       * avr-tdep.c (avr_break_insn): Change it constexpr.
+       (avr_gdbarch_init): Don't use
+       SET_GDBARCH_BREAKPOINT_MANIPULATION.
+       * bfin-tdep.c (bfin_gdbarch_init): Likewise.
+       * cris-tdep.c (cris_gdbarch_init): Likewise.
+       * frv-tdep.c (breakpoint): Rename it to frv_break_insn, and
+       change its type to constexpr.  Don't use
+       GDBARCH_BREAKPOINT_MANIPULATION.
+       (frv_gdbarch_init): Don't use
+       SET_GDBARCH_BREAKPOINT_MANIPULATION.
+       * ft32-tdep.c (breakpoint): Rename it to ft32_break_insn and
+       change its type to constexpr.  Don't use
+       GDBARCH_BREAKPOINT_MANIPULATION.
+       (ft32_gdbarch_init): Don't use
+       SET_GDBARCH_BREAKPOINT_MANIPULATION.
+       * h8300-tdep.c (breakpoint): Rename it to h8300_break_insn.
+       Don't use GDBARCH_BREAKPOINT_MANIPULATION.
+       (h8300_gdbarch_init): Don't use
+       SET_GDBARCH_BREAKPOINT_MANIPULATION.
+       * hppa-tdep.c (breakpoint): Rename it to h8300_break_insn.
+       Don't use GDBARCH_BREAKPOINT_MANIPULATION.
+       (hppa_gdbarch_init): Don't use
+       SET_GDBARCH_BREAKPOINT_MANIPULATION.
+       * i386-tdep.c (break_insn): Rename it to i386_break_insn.
+       Don't use GDBARCH_BREAKPOINT_MANIPULATION.
+       (i386_gdbarch_init): Don't use
+       SET_GDBARCH_BREAKPOINT_MANIPULATION.
+       * iq2000-tdep.c (iq2000_gdbarch_init): Don't use
+       SET_GDBARCH_BREAKPOINT_MANIPULATION.
+       * lm32-tdep.c (breakpoint): Rename it to lm32_break_insn and
+       change its type to constexpr.  Don't use
+       GDBARCH_BREAKPOINT_MANIPULATION.
+       (lm32_gdbarch_init): Don't use
+       SET_GDBARCH_BREAKPOINT_MANIPULATION.
+       * m32c-tdep.c (break_insn): Rename it to m32c_break_insn and change
+       its type to constexpr.  Don't use GDBARCH_BREAKPOINT_MANIPULATION.
+       (m32c_gdbarch_init): Don't use
+       SET_GDBARCH_BREAKPOINT_MANIPULATION.
+       * m32r-tdep.c (m32r_gdbarch_init): Likewise.
+       * m68hc11-tdep.c (breakpoint): Rename it to m68hc11_break_insn and
+       change its type to constexpr.
+       Don't use GDBARCH_BREAKPOINT_MANIPULATION.
+       (m68hc11_gdbarch_init): Don't use SET_GDBARCH_BREAKPOINT_MANIPULATION.
+       * m68k-tdep.c (break_insn): Rename it to m68k_break_insn and change
+       its type to constexpr.  Don't use GDBARCH_BREAKPOINT_MANIPULATION.
+       (m68k_gdbarch_init):  Don't use
+       SET_GDBARCH_BREAKPOINT_MANIPULATION.
+       * m88k-tdep.c (break_insn): Rename it to m88k_break_insn and change
+       its type to constexpr.  Don't use GDBARCH_BREAKPOINT_MANIPULATION.
+       (m88k_gdbarch_init): Don't use
+       SET_GDBARCH_BREAKPOINT_MANIPULATION.
+       * mep-tdep.c (breakpoint): Rename it to mep_break_insn and change
+       its type to constexpr.  Don't use GDBARCH_BREAKPOINT_MANIPULATION.
+       (mep_gdbarch_init): Don't use
+       SET_GDBARCH_BREAKPOINT_MANIPULATION.
+       * microblaze-tdep.c (break_insn): Rename it to
+       microblaze_break_insn and change its type to constexpr.  Don't use
+       GDBARCH_BREAKPOINT_MANIPULATION.
+       (microblaze_gdbarch_init): Don't use
+       SET_GDBARCH_BREAKPOINT_MANIPULATION.
+       * mips-tdep.c (mips_gdbarch_init): Likewise.
+       * mn10300-tdep.c (breakpoint): Rename it to mn10300_break_insn and
+       change its type to constexpr.  Don't use
+       GDBARCH_BREAKPOINT_MANIPULATION.
+       (mn10300_gdbarch_init): Don't use
+       SET_GDBARCH_BREAKPOINT_MANIPULATION.
+       * moxie-tdep.c (breakpoint): Rename it to moxie_break_insn and
+       change its type to constexpr.  Don't use
+       GDBARCH_BREAKPOINT_MANIPULATION.
+       (moxie_gdbarch_init): Don't use
+       SET_GDBARCH_BREAKPOINT_MANIPULATION.
+       * msp430-tdep.c (breakpoint): Rename it to msp430_break_insn
+       and change its type to constexpr.  Don't use
+       GDBARCH_BREAKPOINT_MANIPULATION.
+       (msp430_gdbarch_init): Don't use
+       SET_GDBARCH_BREAKPOINT_MANIPULATION.
+       * mt-tdep.c (mt_gdbarch_init): Likewise.
+       * nds32-tdep.c (break_insn): Rename it to nds32_break_insn
+       and change its type to constexpr.  Don't use
+       GDBARCH_BREAKPOINT_MANIPULATION.
+       (nds32_gdbarch_init): Don't use
+       SET_GDBARCH_BREAKPOINT_MANIPULATION.
+       * nios2-tdep.c (nios2_gdbarch_init): Likewise.
+       * rl78-tdep.c (breakpoint): Rename it to rl78_break_ins
+       and change its type to rl78_break_insn.  Don't use
+       GDBARCH_BREAKPOINT_MANIPULATION.
+       (rl78_gdbarch_init): Don't use
+       SET_GDBARCH_BREAKPOINT_MANIPULATION.
+       * rs6000-tdep.c (big_breakpoint): Change its type to
+       constexpr.
+       (little_breakpoint): Likewise.
+       Don't use GDBARCH_BREAKPOINT_MANIPULATION_ENDIAN.
+       (rs6000_gdbarch_init): Don't use
+       SET_GDBARCH_BREAKPOINT_MANIPULATION.
+       * rx-tdep.c (breakpoint): Rename it to rx_break_insn and
+       change its type to constexpr.  Don't use
+       GDBARCH_BREAKPOINT_MANIPULATION.
+       (rx_gdbarch_init): Don't use
+       SET_GDBARCH_BREAKPOINT_MANIPULATION.
+       * s390-linux-tdep.c (breakpoint): Rename it to s390_break_insn
+       and change its type to constexpr.  Don't use
+       GDBARCH_BREAKPOINT_MANIPULATION
+       (s390_gdbarch_init): Don't use
+       SET_GDBARCH_BREAKPOINT_MANIPULATION.
+       * score-tdep.c (score_gdbarch_init): Likewise.
+       * sh-tdep.c (sh_gdbarch_init): Likewise.
+       * sh64-tdep.c (sh64_gdbarch_init): Likewise.
+       * sparc-tdep.c (break_insn): Rename it to sparc_break_insn
+       and change its type to constexpr.  Don't use
+       GDBARCH_BREAKPOINT_MANIPULATION.
+       (sparc32_gdbarch_init): Don't use
+       SET_GDBARCH_BREAKPOINT_MANIPULATION.
+       * spu-tdep.c (breakpoint): Rename it to spu_break_insn and change
+       its type to constexpr.  Don't use
+       GDBARCH_BREAKPOINT_MANIPULATION.
+       (spu_gdbarch_init): Don't use
+       SET_GDBARCH_BREAKPOINT_MANIPULATION.
+       * tic6x-tdep.c (tic6x_gdbarch_init): Likewise.
+       * tilegx-tdep.c (breakpoint): Rename it to tilegx_break_insn
+       and change its type to constexpr.  Don't use
+       GDBARCH_BREAKPOINT_MANIPULATION.
+       (tilegx_gdbarch_init): Don't use
+       SET_GDBARCH_BREAKPOINT_MANIPULATION.
+       * v850-tdep.c (v850_gdbarch_init): Likewise.
+       * vax-tdep.c (break_insn): Rename it to vax_break_insn and
+       change its type to constexpr.
+       Don't use GDBARCH_BREAKPOINT_MANIPULATION.
+       (vax_gdbarch_init): Don't use
+       SET_GDBARCH_BREAKPOINT_MANIPULATION.
+       * xstormy16-tdep.c (breakpoint): Rename it to
+       xstormy16_break_insn and change its type to constexpr.
+       Don't use GDBARCH_BREAKPOINT_MANIPULATION.
+       (xstormy16_gdbarch_init): Don't use
+       SET_GDBARCH_BREAKPOINT_MANIPULATION.
+       * xtensa-tdep.c (xtensa_gdbarch_init): Likewise.
+
 2016-11-03  Yao Qi  <yao.qi@linaro.org>
 
        * arm-tdep.c (arm_override_mode): Remove.
index 304d9df7e84b1ba24623397bd2c1038fdea9f65e..1298302ab4302182720de7e36defd6602daeda5e 100644 (file)
@@ -1590,9 +1590,9 @@ aarch64_gdb_print_insn (bfd_vma memaddr, disassemble_info *info)
 /* AArch64 BRK software debug mode instruction.
    Note that AArch64 code is always little-endian.
    1101.0100.0010.0000.0000.0000.0000.0000 = 0xd4200000.  */
-static const gdb_byte aarch64_default_breakpoint[] = {0x00, 0x00, 0x20, 0xd4};
+constexpr gdb_byte aarch64_default_breakpoint[] = {0x00, 0x00, 0x20, 0xd4};
 
-GDBARCH_BREAKPOINT_MANIPULATION (aarch64, aarch64_default_breakpoint)
+typedef BP_MANIPULATION (aarch64_default_breakpoint) aarch64_breakpoint;
 
 /* Extract from an array REGS containing the (raw) register state a
    function return value of type TYPE, and copy that, in virtual
@@ -2754,7 +2754,10 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
 
   /* Breakpoint manipulation.  */
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (aarch64);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch,
+                                      aarch64_breakpoint::kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch,
+                                      aarch64_breakpoint::bp_from_kind);
   set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1);
   set_gdbarch_software_single_step (gdbarch, aarch64_software_single_step);
 
index 58e6ee323f6706c5bebe7c0c273434517f267128..4b5c32db666ed46ae4f7de3fc0121dc5ec6b548b 100644 (file)
@@ -646,9 +646,9 @@ alpha_return_in_memory_always (struct type *type)
 }
 \f
 
-static const gdb_byte break_insn[] = { 0x80, 0, 0, 0 }; /* call_pal bpt */
+constexpr gdb_byte alpha_break_insn[] = { 0x80, 0, 0, 0 }; /* call_pal bpt */
 
-GDBARCH_BREAKPOINT_MANIPULATION (alpha, break_insn)
+typedef BP_MANIPULATION (alpha_break_insn) alpha_breakpoint;
 
 \f
 /* This returns the PC of the first insn after the prologue.
@@ -1818,7 +1818,10 @@ 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_MANIPULATION (alpha);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch,
+                                      alpha_breakpoint::kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch,
+                                      alpha_breakpoint::bp_from_kind);
   set_gdbarch_decr_pc_after_break (gdbarch, ALPHA_INSN_SIZE);
   set_gdbarch_cannot_step_breakpoint (gdbarch, 1);
 
index f310da9c866f80a0cab7ba54eef5ade850285dd7..e7a7d53f6f79656464764f658bcaf86e3fbf124a 100644 (file)
@@ -1235,7 +1235,8 @@ arc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_skip_prologue (gdbarch, arc_skip_prologue);
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
 
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (arc);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch, arc_breakpoint_kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch, arc_sw_breakpoint_from_kind);
 
   /* On ARC 600 BRK_S instruction advances PC, unlike other ARC cores.  */
   if (!arc_mach_is_arc600 (gdbarch))
index 9592580d79b7ea141ab87402b82ace8d910a64bc..830ebed31206ff5a794681a6036b0f09db5b4cf8 100644 (file)
@@ -26,48 +26,51 @@ struct minimal_symbol;
 struct type;
 struct gdbarch_info;
 
-#define GDBARCH_BREAKPOINT_MANIPULATION(ARCH,BREAK_INSN)             \
-  static int                                                         \
-  ARCH##_breakpoint_kind_from_pc (struct gdbarch *gdbarch,           \
-                                 CORE_ADDR *pcptr)                   \
-  {                                                                  \
-    return sizeof (BREAK_INSN);                                      \
-  }                                                                  \
-  static const gdb_byte *                                            \
-  ARCH##_sw_breakpoint_from_kind (struct gdbarch *gdbarch,           \
-                                 int kind, int *size)                \
-  {                                                                  \
-    *size = kind;                                                    \
-    return BREAK_INSN;                                               \
+template <size_t bp_size, const gdb_byte *break_insn>
+struct bp_manipulation
+{
+  static int
+  kind_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr)
+  {
+    return bp_size;
   }
 
-#define SET_GDBARCH_BREAKPOINT_MANIPULATION(ARCH)                      \
-  set_gdbarch_breakpoint_kind_from_pc (gdbarch,                        \
-                                      ARCH##_breakpoint_kind_from_pc); \
-  set_gdbarch_sw_breakpoint_from_kind (gdbarch,                        \
-                                      ARCH##_sw_breakpoint_from_kind)
-
-#define GDBARCH_BREAKPOINT_MANIPULATION_ENDIAN(ARCH, \
-                                              LITTLE_BREAK_INSN,       \
-                                              BIG_BREAK_INSN)          \
-  static int                                                           \
-  ARCH##_breakpoint_kind_from_pc (struct gdbarch *gdbarch,             \
-                                 CORE_ADDR *pcptr)                     \
-  {                                                                    \
-    gdb_static_assert (ARRAY_SIZE (LITTLE_BREAK_INSN)                  \
-                      == ARRAY_SIZE (BIG_BREAK_INSN));         \
-    return sizeof (BIG_BREAK_INSN);                                    \
-  }                                                                    \
-  static const gdb_byte *                                            \
-  ARCH##_sw_breakpoint_from_kind (struct gdbarch *gdbarch,           \
-                                 int kind, int *size)                \
-  {                                                                  \
-    *size = kind;                                                    \
-    if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)              \
-      return BIG_BREAK_INSN;                                         \
-    else                                                             \
-      return LITTLE_BREAK_INSN;                                      \
+  static const gdb_byte *
+  bp_from_kind (struct gdbarch *gdbarch, int kind, int *size)
+  {
+    *size = kind;
+    return break_insn;
   }
+};
+
+template <size_t bp_size,
+         const gdb_byte *break_insn_little,
+         const gdb_byte *break_insn_big>
+struct bp_manipulation_endian
+{
+  static int
+  kind_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr)
+  {
+    return bp_size;
+  }
+
+  static const gdb_byte *
+  bp_from_kind (struct gdbarch *gdbarch, int kind, int *size)
+  {
+    *size = kind;
+    if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
+      return break_insn_big;
+    else
+      return break_insn_little;
+  }
+};
+
+#define BP_MANIPULATION(BREAK_INSN) \
+  bp_manipulation<sizeof (BREAK_INSN), BREAK_INSN>
+
+#define BP_MANIPULATION_ENDIAN(BREAK_INSN_LITTLE, BREAK_INSN_BIG) \
+  bp_manipulation_endian<sizeof (BREAK_INSN_LITTLE),             \
+  BREAK_INSN_LITTLE, BREAK_INSN_BIG>
 
 /* An implementation of gdbarch_displaced_step_copy_insn for
    processors that don't need to modify the instruction before
index 4a8922738c3a7af58af4a393ae82ba665b9e3c07..f41ad6daf7665211f4a29a7209af683ba168d0cc 100644 (file)
@@ -9447,7 +9447,8 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
 
   /* Breakpoint manipulation.  */
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (arm);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch, arm_breakpoint_kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch, arm_sw_breakpoint_from_kind);
   set_gdbarch_breakpoint_kind_from_current_state (gdbarch,
                                                  arm_breakpoint_kind_from_current_state);
 
index 066bba4082607376a944a5dbcd50c30b42790fac..11ec1905547f57cb49ff18b475a1703bc276a806 100644 (file)
@@ -913,9 +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_break_insn [] = { 0x98, 0x95 };
+constexpr gdb_byte avr_break_insn [] = { 0x98, 0x95 };
 
-GDBARCH_BREAKPOINT_MANIPULATION (avr, avr_break_insn)
+typedef BP_MANIPULATION (avr_break_insn) avr_breakpoint;
 
 /* Determine, for architecture GDBARCH, how a return value of TYPE
    should be returned.  If it is supposed to be returned in registers,
@@ -1509,7 +1509,8 @@ 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_MANIPULATION (avr);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch, avr_breakpoint::kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch, avr_breakpoint::bp_from_kind);
 
   frame_unwind_append_unwinder (gdbarch, &avr_frame_unwind);
   frame_base_set_default (gdbarch, &avr_frame_base);
index 989912e911c991723fb588b8abf7af9a4a3fc8ce..c1886e088d02d02072fcb65b750150e1a44015b4 100644 (file)
@@ -830,7 +830,8 @@ bfin_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_return_value (gdbarch, bfin_return_value);
   set_gdbarch_skip_prologue (gdbarch, bfin_skip_prologue);
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (bfin);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch, bfin_breakpoint_kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch, bfin_sw_breakpoint_from_kind);
   set_gdbarch_decr_pc_after_break (gdbarch, 2);
   set_gdbarch_frame_args_skip (gdbarch, 8);
   set_gdbarch_unwind_pc (gdbarch, bfin_unwind_pc);
index 3103f1c7e6a303f0389d148efd90c8af54a124f6..1a2641b085de7b13a5f2d0d5d65431e890d2c3c9 100644 (file)
@@ -4127,7 +4127,8 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   /* The stack grows downward.  */
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
 
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (cris);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch, cris_breakpoint_kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch, cris_sw_breakpoint_from_kind);
   
   set_gdbarch_unwind_pc (gdbarch, cris_unwind_pc);
   set_gdbarch_unwind_sp (gdbarch, cris_unwind_sp);
index 89d26d0f1b864c31925efa09f0f7c546c6f18783..5c09b7a628fd6a4ae8309d797f9f9755cd12722c 100644 (file)
@@ -424,9 +424,9 @@ frv_register_sim_regno (struct gdbarch *gdbarch, int reg)
   internal_error (__FILE__, __LINE__, _("Bad register number %d"), reg);
 }
 
-static const unsigned char breakpoint[] = {0xc0, 0x70, 0x00, 0x01};
+constexpr gdb_byte frv_break_insn[] = {0xc0, 0x70, 0x00, 0x01};
 
-GDBARCH_BREAKPOINT_MANIPULATION (frv, breakpoint)
+typedef BP_MANIPULATION (frv_break_insn) frv_breakpoint;
 
 /* Define the maximum number of instructions which may be packed into a
    bundle (VLIW instruction).  */
@@ -1533,7 +1533,8 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
   set_gdbarch_skip_prologue (gdbarch, frv_skip_prologue);
   set_gdbarch_skip_main_prologue (gdbarch, frv_skip_main_prologue);
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (frv);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch, frv_breakpoint::kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch, frv_breakpoint::bp_from_kind);
   set_gdbarch_adjust_breakpoint_address
     (gdbarch, frv_adjust_breakpoint_address);
 
index bd907c4073f11349b069ac19c4e2930daf1cc14d..0bb9a6f191ce759a3b1a69b01fc8a58a531c3ec5 100644 (file)
@@ -79,9 +79,9 @@ ft32_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp)
 }
 
 
-static const gdb_byte breakpoint[] = { 0x02, 0x00, 0x34, 0x00 };
+constexpr gdb_byte ft32_break_insn[] = { 0x02, 0x00, 0x34, 0x00 };
 
-GDBARCH_BREAKPOINT_MANIPULATION (ft32, breakpoint)
+typedef BP_MANIPULATION (ft32_break_insn) ft32_breakpoint;
 
 /* FT32 register names.  */
 
@@ -624,7 +624,8 @@ ft32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
   set_gdbarch_skip_prologue (gdbarch, ft32_skip_prologue);
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (ft32);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch, ft32_breakpoint::kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch, ft32_breakpoint::bp_from_kind);
   set_gdbarch_frame_align (gdbarch, ft32_frame_align);
 
   frame_base_set_default (gdbarch, &ft32_frame_base);
index 5e757a934dd105b4fa7067de258609f21f0931b2..6a011103e4889901808536f1794e2e8f7dd49c0b 100644 (file)
@@ -1243,9 +1243,9 @@ h8300s_dbg_reg_to_regnum (struct gdbarch *gdbarch, int regno)
 }
 
 /*static unsigned char breakpoint[] = { 0x7A, 0xFF }; *//* ??? */
-static const unsigned char breakpoint[] = { 0x01, 0x80 };      /* Sleep */
+constexpr gdb_byte h8300_break_insn[] = { 0x01, 0x80 };        /* Sleep */
 
-GDBARCH_BREAKPOINT_MANIPULATION (h8300, breakpoint)
+typedef BP_MANIPULATION (h8300_break_insn) h8300_breakpoint;
 
 static struct gdbarch *
 h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
@@ -1371,7 +1371,10 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   /* Stack grows up.  */
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
 
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (h8300);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch,
+                                      h8300_breakpoint::kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch,
+                                      h8300_breakpoint::bp_from_kind);
   set_gdbarch_push_dummy_call (gdbarch, h8300_push_dummy_call);
 
   set_gdbarch_char_signed (gdbarch, 0);
index 4fef5e7828c5995c3aef07692d4a4b6686665cc8..4bb49ed2ef64928d8ba2bc1d48c4b76483fd30b4 100644 (file)
@@ -604,9 +604,9 @@ hppa_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
   return 0;
 }
 
-static const unsigned char breakpoint[] = {0x00, 0x01, 0x00, 0x04};
+constexpr gdb_byte hppa_break_insn[] = {0x00, 0x01, 0x00, 0x04};
 
-GDBARCH_BREAKPOINT_MANIPULATION (hppa, breakpoint)
+typedef BP_MANIPULATION (hppa_break_insn) hppa_breakpoint;
 
 /* Return the name of a register.  */
 
@@ -3182,7 +3182,8 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
       internal_error (__FILE__, __LINE__, _("bad switch"));
     }
       
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (hppa);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch, hppa_breakpoint::kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch, hppa_breakpoint::bp_from_kind);
   set_gdbarch_pseudo_register_read (gdbarch, hppa_pseudo_register_read);
 
   /* Frame unwind methods.  */
index 697edc6c8b549a77d7f1acc99528c48de2bf1f6b..a67eca00164192321d9b93ff21fb581afd4c215d 100644 (file)
@@ -588,9 +588,10 @@ static const char *disassembly_flavor = att_flavor;
 
    This function is 64-bit safe.  */
 
-static const gdb_byte break_insn[] = { 0xcc }; /* int 3 */
+constexpr gdb_byte i386_break_insn[] = { 0xcc }; /* int 3 */
+
+typedef BP_MANIPULATION (i386_break_insn) i386_breakpoint;
 
-GDBARCH_BREAKPOINT_MANIPULATION (i386, break_insn)
 \f
 /* Displaced instruction handling.  */
 
@@ -8453,7 +8454,9 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   /* Stack grows downward.  */
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
 
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (i386);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch, i386_breakpoint::kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch, i386_breakpoint::bp_from_kind);
+
   set_gdbarch_decr_pc_after_break (gdbarch, 1);
   set_gdbarch_max_insn_length (gdbarch, I386_MAX_INSN_LEN);
 
index 874fc6a8bfd69fdd9bd355e82a1a7c695055ed91..a790a1b36f89618c4ce99318a7d7812c61b72089 100644 (file)
@@ -831,7 +831,10 @@ iq2000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_double_format        (gdbarch, floatformats_ieee_double);
   set_gdbarch_long_double_format   (gdbarch, floatformats_ieee_double);
   set_gdbarch_return_value        (gdbarch, iq2000_return_value);
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (iq2000);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch,
+                                      iq2000_breakpoint_kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch,
+                                      iq2000_sw_breakpoint_from_kind);
   set_gdbarch_frame_args_skip      (gdbarch, 0);
   set_gdbarch_skip_prologue        (gdbarch, iq2000_skip_prologue);
   set_gdbarch_inner_than           (gdbarch, core_addr_lessthan);
index 89f13e0386b90ac9b487247bbf6f38fc127cd747..e1b2582c1ff33c59e2b8b3a196838b02d216b228 100644 (file)
@@ -216,9 +216,9 @@ lm32_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
 }
 
 /* Create a breakpoint instruction.  */
-static const gdb_byte breakpoint[4] = { OP_RAISE << 2, 0, 0, 2 };
+constexpr gdb_byte lm32_break_insn[4] = { OP_RAISE << 2, 0, 0, 2 };
 
-GDBARCH_BREAKPOINT_MANIPULATION (lm32, breakpoint)
+typedef BP_MANIPULATION (lm32_break_insn) lm32_breakpoint;
 
 
 /* Setup registers and stack for faking a call to a function in the 
@@ -557,7 +557,8 @@ lm32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   frame_unwind_append_unwinder (gdbarch, &lm32_frame_unwind);
 
   /* Breakpoints.  */
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (lm32);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch, lm32_breakpoint::kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch, lm32_breakpoint::bp_from_kind);
   set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1);
 
   /* Calling functions in the inferior.  */
index da99eaec42f84e64bf7bc08b4c3e353dc59a13c1..429fecce07859112344580d8aeaa06c0c071779e 100644 (file)
@@ -990,9 +990,9 @@ make_regs (struct gdbarch *arch)
 
 \f
 /* Breakpoints.  */
-static const unsigned char break_insn[] = { 0x00 };    /* brk */
+constexpr gdb_byte m32c_break_insn[] = { 0x00 };       /* brk */
 
-GDBARCH_BREAKPOINT_MANIPULATION (m32c, break_insn)
+typedef BP_MANIPULATION (m32c_break_insn) m32c_breakpoint;
 
 \f
 /* Prologue analysis.  */
@@ -2645,7 +2645,8 @@ m32c_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_print_insn (gdbarch, print_insn_m32c);
 
   /* Breakpoints.  */
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (m32c);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch, m32c_breakpoint::kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch, m32c_breakpoint::bp_from_kind);
 
   /* Prologue analysis and unwinding.  */
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
index c493e2d53a8d649ae54ad6550608cc06cdd501f6..31ea3ed4eaf2cef9932217b42d06c2be60d3798f 100644 (file)
@@ -922,7 +922,8 @@ m32r_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
   set_gdbarch_skip_prologue (gdbarch, m32r_skip_prologue);
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (m32r);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch, m32r_breakpoint_kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch, m32r_sw_breakpoint_from_kind);
   set_gdbarch_memory_insert_breakpoint (gdbarch,
                                        m32r_memory_insert_breakpoint);
   set_gdbarch_memory_remove_breakpoint (gdbarch,
index 620d1fb2c7860923e30612775aa945b0ea706a5c..eb809460518f83f87232587728c1c4e572ad52c7 100644 (file)
@@ -390,9 +390,9 @@ m68hc11_register_name (struct gdbarch *gdbarch, int reg_nr)
   return m68hc11_register_names[reg_nr];
 }
 
-static unsigned char breakpoint[] = {0x0};
+constexpr gdb_byte m68hc11_break_insn[] = {0x0};
 
-GDBARCH_BREAKPOINT_MANIPULATION (m68hc11, breakpoint)
+typedef BP_MANIPULATION (m68hc11_break_insn) m68hc11_breakpoint;
 \f
 /* 68HC11 & 68HC12 prologue analysis.  */
 
@@ -1521,7 +1521,10 @@ m68hc11_gdbarch_init (struct gdbarch_info info,
   set_gdbarch_return_value (gdbarch, m68hc11_return_value);
   set_gdbarch_skip_prologue (gdbarch, m68hc11_skip_prologue);
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (m68hc11);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch,
+                                      m68hc11_breakpoint::kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch,
+                                      m68hc11_breakpoint::bp_from_kind);
   set_gdbarch_print_insn (gdbarch, gdb_print_insn_m68hc11);
 
   m68hc11_add_reggroups (gdbarch);
index cea2f018cd6f2bce006f2b51f4154b70f78431e2..53d0adefc19eaf981f9c56d633801004bcee2217 100644 (file)
@@ -57,9 +57,9 @@
 #define BPT_VECTOR 0xf
 #endif
 
-static gdb_byte break_insn[] = {0x4e, (0x40 | BPT_VECTOR)};
+constexpr gdb_byte m68k_break_insn[] = {0x4e, (0x40 | BPT_VECTOR)};
 
-GDBARCH_BREAKPOINT_MANIPULATION (m68k, break_insn)
+typedef BP_MANIPULATION (m68k_break_insn) m68k_breakpoint;
 \f
 
 /* Construct types for ISA-specific registers.  */
@@ -1191,7 +1191,8 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_long_double_bit (gdbarch, long_double_format[0]->totalsize);
 
   set_gdbarch_skip_prologue (gdbarch, m68k_skip_prologue);
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (m68k);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch, m68k_breakpoint::kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch, m68k_breakpoint::bp_from_kind);
 
   /* Stack grows down.  */
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
index 48deb53af9d12d9c96c946d915ced9c9b4834784..fbe5c5a2e8d942221b1fbabd0d7205f572b6d27c 100644 (file)
@@ -99,9 +99,9 @@ m88k_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr)
    location for inserting the breakpoint.  */
 
 /* tb 0,r0,511 */
-static gdb_byte break_insn[] = { 0xf0, 0x00, 0xd1, 0xff };
+constexpr gdb_byte m88k_break_insn[] = { 0xf0, 0x00, 0xd1, 0xff };
 
-GDBARCH_BREAKPOINT_MANIPULATION (m88k, break_insn)
+typedef BP_MANIPULATION (m88k_break_insn) m88k_breakpoint;
 
 static CORE_ADDR
 m88k_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
@@ -852,7 +852,8 @@ 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_MANIPULATION (m88k);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch, m88k_breakpoint::kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch, m88k_breakpoint::bp_from_kind);
   set_gdbarch_unwind_pc (gdbarch, m88k_unwind_pc);
   set_gdbarch_write_pc (gdbarch, m88k_write_pc);
 
index a8900f1adedad96e43712fa54dc64e36851652c7..80d2b76bce26e95f0fb69fb69d0f8347ba0f29bd 100644 (file)
@@ -1918,9 +1918,9 @@ mep_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
 
 \f
 /* Breakpoints.  */
-static unsigned char breakpoint[] = { 0x70, 0x32 };
+constexpr gdb_byte mep_break_insn[] = { 0x70, 0x32 };
 
-GDBARCH_BREAKPOINT_MANIPULATION (mep, breakpoint)
+typedef BP_MANIPULATION (mep_break_insn) mep_breakpoint;
 
 \f
 /* Frames and frame unwinding.  */
@@ -2484,7 +2484,8 @@ mep_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_print_insn (gdbarch, mep_gdb_print_insn); 
 
   /* Breakpoints.  */
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (mep);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch, mep_breakpoint::kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch, mep_breakpoint::bp_from_kind);
   set_gdbarch_decr_pc_after_break (gdbarch, 0);
   set_gdbarch_skip_prologue (gdbarch, mep_skip_prologue);
 
index ea33ae7dfcb1b6fa79658893a52588e5986fef64..6dd5b42a7f5eaaef53ac140140c69e405e788fbc 100644 (file)
@@ -134,9 +134,9 @@ microblaze_fetch_instruction (CORE_ADDR pc)
   return extract_unsigned_integer (buf, 4, byte_order);
 }
 \f
-static gdb_byte break_insn[] = MICROBLAZE_BREAKPOINT;
+constexpr gdb_byte microblaze_break_insn[] = MICROBLAZE_BREAKPOINT;
 
-GDBARCH_BREAKPOINT_MANIPULATION (microblaze, break_insn)
+typedef BP_MANIPULATION (microblaze_break_insn) microblaze_breakpoint;
 
 \f
 /* Allocate and initialize a frame cache.  */
@@ -731,7 +731,10 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   /* Stack grows downward.  */
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
 
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (microblaze);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch,
+                                      microblaze_breakpoint::kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch,
+                                      microblaze_breakpoint::bp_from_kind);
 
   set_gdbarch_frame_args_skip (gdbarch, 8);
 
index 9eb2de15d4e1d7aee0d1105c9230b7dc2eaff17b..da4bef6f8297442e57e1dc6e4b98de695d19d1bf 100644 (file)
@@ -8717,7 +8717,8 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_value_to_register (gdbarch, mips_value_to_register);
 
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (mips);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch, mips_breakpoint_kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch, mips_sw_breakpoint_from_kind);
   set_gdbarch_adjust_breakpoint_address (gdbarch,
                                         mips_adjust_breakpoint_address);
 
index 16c0b392cad20b07c5f1c4fe82e05e28de891fe9..542ef407623377f98594659996d4ce43a401e6fe 100644 (file)
@@ -322,9 +322,9 @@ mn10300_write_pc (struct regcache *regcache, CORE_ADDR val)
    The Matsushita mn10x00 processors have single byte instructions
    so we need a single byte breakpoint.  Matsushita hasn't defined
    one, so we defined it ourselves.  */
-static gdb_byte breakpoint[] = {0xff};
+constexpr gdb_byte mn10300_break_insn[] = {0xff};
 
-GDBARCH_BREAKPOINT_MANIPULATION (mn10300, breakpoint)
+typedef BP_MANIPULATION (mn10300_break_insn) mn10300_breakpoint;
 
 /* Model the semantics of pushing a register onto the stack.  This
    is a helper function for mn10300_analyze_prologue, below.  */
@@ -1438,7 +1438,10 @@ mn10300_gdbarch_init (struct gdbarch_info info,
   /* Stack unwinding.  */
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
   /* Breakpoints.  */
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (mn10300);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch,
+                                      mn10300_breakpoint::kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch,
+                                      mn10300_breakpoint::bp_from_kind);
   /* decr_pc_after_break?  */
   /* Disassembly.  */
   set_gdbarch_print_insn (gdbarch, print_insn_mn10300);
index 8d29bdfe2e954cafc7c19b813741913358f20ebd..aadb2701859ae7f13fa6453c89790bef2ee9288c 100644 (file)
@@ -68,9 +68,9 @@ moxie_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp)
   return sp & ~1;
 }
 
-static unsigned char breakpoint[] = { 0x35, 0x00 };
+constexpr gdb_byte moxie_break_insn[] = { 0x35, 0x00 };
 
-GDBARCH_BREAKPOINT_MANIPULATION (moxie, breakpoint)
+typedef BP_MANIPULATION (moxie_break_insn) moxie_breakpoint;
 
 /* Moxie register names.  */
 
@@ -1131,7 +1131,10 @@ moxie_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
   set_gdbarch_skip_prologue (gdbarch, moxie_skip_prologue);
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (moxie);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch,
+                                      moxie_breakpoint::kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch,
+                                      moxie_breakpoint::bp_from_kind);
   set_gdbarch_frame_align (gdbarch, moxie_frame_align);
 
   frame_base_set_default (gdbarch, &moxie_frame_base);
index 8043155d534d741039b7a33b2ec6af9a77ae255f..f37aa48e53cd361120af8b4481fc169e4bb80e16 100644 (file)
@@ -277,9 +277,9 @@ msp430_register_sim_regno (struct gdbarch *gdbarch, int regnum)
   return regnum;
 }
 
-static gdb_byte breakpoint[] = { 0x43, 0x43 };
+constexpr gdb_byte msp430_break_insn[] = { 0x43, 0x43 };
 
-GDBARCH_BREAKPOINT_MANIPULATION (msp430, breakpoint)
+typedef BP_MANIPULATION (msp430_break_insn) msp430_breakpoint;
 
 /* Define a "handle" struct for fetching the next opcode.  */
 
@@ -993,7 +993,10 @@ msp430_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_long_double_format (gdbarch, floatformats_ieee_double);
 
   /* Breakpoints.  */
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (msp430);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch,
+                                      msp430_breakpoint::kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch,
+                                      msp430_breakpoint::bp_from_kind);
   set_gdbarch_decr_pc_after_break (gdbarch, 1);
 
   /* Disassembly.  */
index a34023f0f47a22593183eb114fcd4ef1b02aab71..95dd6816a79fd85154b0e512a792f4107dc7f5ac 100644 (file)
@@ -1171,7 +1171,8 @@ mt_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_pseudo_register_write (gdbarch, mt_pseudo_register_write);
   set_gdbarch_skip_prologue (gdbarch, mt_skip_prologue);
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (mt);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch, mt_breakpoint_kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch, mt_sw_breakpoint_from_kind);
   set_gdbarch_decr_pc_after_break (gdbarch, 0);
   set_gdbarch_frame_args_skip (gdbarch, 0);
   set_gdbarch_print_insn (gdbarch, print_insn_mt);
index 618a4827dac361b9e2bd6fa300d4d0a1223e15e0..43c54ccdf19fb3edbbfda6659c6f416f4096a0cf 100644 (file)
@@ -282,9 +282,9 @@ nds32_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp)
 }
 
 /* The same insn machine code is used for little-endian and big-endian.  */
-static const gdb_byte break_insn[] = { 0xEA, 0x00 };
+constexpr gdb_byte nds32_break_insn[] = { 0xEA, 0x00 };
 
-GDBARCH_BREAKPOINT_MANIPULATION (nds32, break_insn)
+typedef BP_MANIPULATION (nds32_break_insn) nds32_breakpoint;
 
 /* Implement the "dwarf2_reg_to_regnum" gdbarch method.  */
 
@@ -2143,7 +2143,10 @@ nds32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
   set_gdbarch_skip_prologue (gdbarch, nds32_skip_prologue);
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (nds32);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch,
+                                      nds32_breakpoint::kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch,
+                                      nds32_breakpoint::bp_from_kind);
 
   set_gdbarch_frame_align (gdbarch, nds32_frame_align);
   frame_base_set_default (gdbarch, &nds32_frame_base);
index 97b422a70550f1224ab9ea6a30b0066aa4946947..2955a69dc32d5e9519be3e9705a2bff983495901 100644 (file)
@@ -2336,7 +2336,8 @@ nios2_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
   set_gdbarch_skip_prologue (gdbarch, nios2_skip_prologue);
   set_gdbarch_stack_frame_destroyed_p (gdbarch, nios2_stack_frame_destroyed_p);
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (nios2);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch, nios2_breakpoint_kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch, nios2_sw_breakpoint_from_kind);
 
   set_gdbarch_dummy_id (gdbarch, nios2_dummy_id);
   set_gdbarch_unwind_pc (gdbarch, nios2_unwind_pc);
index 1e9d4358978eadc002b98cdd999ba4fd9eb21c4a..95a26a5124a86ce8277571475ee5097a5d3b3128 100644 (file)
@@ -772,9 +772,9 @@ rl78_pseudo_register_write (struct gdbarch *gdbarch,
    {0x61, 0xcc}, but instructions may be as short as one byte.
    Correspondence with Renesas revealed that the one byte sequence
    0xff is used when a one byte breakpoint instruction is required.  */
-static gdb_byte breakpoint[] = { 0xff };
+constexpr gdb_byte rl78_break_insn[] = { 0xff };
 
-GDBARCH_BREAKPOINT_MANIPULATION (rl78, breakpoint)
+typedef BP_MANIPULATION (rl78_break_insn) rl78_breakpoint;
 
 /* Define a "handle" struct for fetching the next opcode.  */
 
@@ -1452,7 +1452,8 @@ rl78_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_addr_bits_remove (gdbarch, rl78_addr_bits_remove);
 
   /* Breakpoints.  */
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (rl78);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch, rl78_breakpoint::kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch, rl78_breakpoint::bp_from_kind);
   set_gdbarch_decr_pc_after_break (gdbarch, 1);
 
   /* Disassembly.  */
index 7cb7a9ea612c8ca7b0f2fe331fb314a5c2f88115..15886797bb944b1de1bd91506e0b54fb0c3a77ea 100644 (file)
@@ -967,11 +967,11 @@ rs6000_fetch_pointer_argument (struct frame_info *frame, int argi,
 
 /* Sequence of bytes for breakpoint instruction.  */
 
-static unsigned char big_breakpoint[] = { 0x7d, 0x82, 0x10, 0x08 };
-static unsigned char little_breakpoint[] = { 0x08, 0x10, 0x82, 0x7d };
+constexpr gdb_byte big_breakpoint[] = { 0x7d, 0x82, 0x10, 0x08 };
+constexpr gdb_byte little_breakpoint[] = { 0x08, 0x10, 0x82, 0x7d };
 
-GDBARCH_BREAKPOINT_MANIPULATION_ENDIAN (rs6000, little_breakpoint,
-                                       big_breakpoint)
+typedef BP_MANIPULATION_ENDIAN (little_breakpoint, big_breakpoint)
+  rs6000_breakpoint;
 
 /* Instruction masks for displaced stepping.  */
 #define BRANCH_MASK 0xfc000000
@@ -6479,7 +6479,11 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_skip_main_prologue (gdbarch, rs6000_skip_main_prologue);
 
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (rs6000);
+
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch,
+                                      rs6000_breakpoint::kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch,
+                                      rs6000_breakpoint::bp_from_kind);
 
   /* The value of symbols of type N_SO and N_FUN maybe null when
      it shouldn't be.  */
index fa91af933c3d4b6ed0978b50d7b50f5cd41a4470..6b8d8d5d6046d30049a0ab596ce3512fa72f9de2 100644 (file)
@@ -992,9 +992,9 @@ rx_return_value (struct gdbarch *gdbarch,
   return RETURN_VALUE_REGISTER_CONVENTION;
 }
 
-static gdb_byte breakpoint[] = { 0x00 };
+constexpr gdb_byte rx_break_insn[] = { 0x00 };
 
-GDBARCH_BREAKPOINT_MANIPULATION (rx, breakpoint)
+typedef BP_MANIPULATION (rx_break_insn) rx_breakpoint;
 
 /* Implement the dwarf_reg_to_regnum" gdbarch method.  */
 
@@ -1092,7 +1092,8 @@ rx_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_sp_regnum (gdbarch, RX_SP_REGNUM);
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
   set_gdbarch_decr_pc_after_break (gdbarch, 1);
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (rx);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch, rx_breakpoint::kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch, rx_breakpoint::bp_from_kind);
   set_gdbarch_skip_prologue (gdbarch, rx_skip_prologue);
 
   set_gdbarch_print_insn (gdbarch, print_insn_rx);
index f654e25f791fe725e3969e0cbb3d884595c02bdf..57bb99234627e21c43b3e81a6d114e4ca628a501 100644 (file)
@@ -3550,9 +3550,9 @@ s390_return_value (struct gdbarch *gdbarch, struct value *function,
 
 
 /* Breakpoints.  */
-static const gdb_byte breakpoint[] = { 0x0, 0x1 };
+constexpr gdb_byte s390_break_insn[] = { 0x0, 0x1 };
 
-GDBARCH_BREAKPOINT_MANIPULATION (s390, breakpoint)
+typedef BP_MANIPULATION (s390_break_insn) s390_breakpoint;
 
 /* Address handling.  */
 
@@ -7975,7 +7975,8 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_decr_pc_after_break (gdbarch, 2);
   /* Stack grows downward.  */
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (s390);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch, s390_breakpoint::kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch, s390_breakpoint::bp_from_kind);
   set_gdbarch_software_single_step (gdbarch, s390_software_single_step);
   set_gdbarch_displaced_step_hw_singlestep (gdbarch, s390_displaced_step_hw_singlestep);
   set_gdbarch_skip_prologue (gdbarch, s390_skip_prologue);
index 1bba20b87d4e1f741253d4c7c7e47d71b2df22ee..becea6b5ce96440798676a2362615c64bc35aec9 100644 (file)
@@ -1496,7 +1496,10 @@ score_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   switch (target_mach)
     {
     case bfd_mach_score7:
-      SET_GDBARCH_BREAKPOINT_MANIPULATION (score7);
+      set_gdbarch_breakpoint_kind_from_pc (gdbarch,
+                                          score7_breakpoint_kind_from_pc);
+      set_gdbarch_sw_breakpoint_from_kind (gdbarch,
+                                          score7_sw_breakpoint_from_kind);
       set_gdbarch_skip_prologue (gdbarch, score7_skip_prologue);
       set_gdbarch_stack_frame_destroyed_p (gdbarch,
                                           score7_stack_frame_destroyed_p);
@@ -1508,7 +1511,10 @@ score_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
       break;
 
     case bfd_mach_score3:
-      SET_GDBARCH_BREAKPOINT_MANIPULATION (score3);
+      set_gdbarch_breakpoint_kind_from_pc (gdbarch,
+                                          score3_breakpoint_kind_from_pc);
+      set_gdbarch_sw_breakpoint_from_kind (gdbarch,
+                                          score3_sw_breakpoint_from_kind);
       set_gdbarch_skip_prologue (gdbarch, score3_skip_prologue);
       set_gdbarch_stack_frame_destroyed_p (gdbarch,
                                           score3_stack_frame_destroyed_p);
index 27795ba013486c1c0f6fd62d60edac6f152f0563..01a24010514cd5244fc19ceda403c8fca455ae9d 100644 (file)
@@ -2282,7 +2282,8 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_register_type (gdbarch, sh_default_register_type);
   set_gdbarch_register_reggroup_p (gdbarch, sh_register_reggroup_p);
 
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (sh);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch, sh_breakpoint_kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch, sh_sw_breakpoint_from_kind);
 
   set_gdbarch_print_insn (gdbarch, print_insn_sh);
   set_gdbarch_register_sim_regno (gdbarch, legacy_register_sim_regno);
index 80df8b9aafcdf94a5fe1a936e39ccecb278e1bd6..cbbefddfe51655beeccb584043b8129e593405cd 100644 (file)
@@ -2411,7 +2411,8 @@ sh64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_pseudo_register_read (gdbarch, sh64_pseudo_register_read);
   set_gdbarch_pseudo_register_write (gdbarch, sh64_pseudo_register_write);
 
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (sh64);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch, sh64_breakpoint_kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch, sh64_sw_breakpoint_from_kind);
 
   set_gdbarch_print_insn (gdbarch, print_insn_sh);
   set_gdbarch_register_sim_regno (gdbarch, legacy_register_sim_regno);
index abeec802853c92414a0facdb474c16d7906f4f7b..d50d874760f5fda4577ae8ec20989057a048751b 100644 (file)
@@ -641,9 +641,9 @@ sparc32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
    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 break_insn[] = { 0x91, 0xd0, 0x20, 0x01 };
+constexpr gdb_byte sparc_break_insn[] = { 0x91, 0xd0, 0x20, 0x01 };
 
-GDBARCH_BREAKPOINT_MANIPULATION (sparc, break_insn)
+typedef BP_MANIPULATION (sparc_break_insn) sparc_breakpoint;
 \f
 
 /* Allocate and initialize a frame cache.  */
@@ -1703,7 +1703,10 @@ sparc32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   /* Stack grows downward.  */
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
 
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (sparc);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch,
+                                      sparc_breakpoint::kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch,
+                                      sparc_breakpoint::bp_from_kind);
 
   set_gdbarch_frame_args_skip (gdbarch, 8);
 
index 1863da1048e57a2567e3347b6719767c582d8eba..308c4604dceb94ab45f67d277fd697d0a635aef0 100644 (file)
@@ -1570,9 +1570,9 @@ spu_return_value (struct gdbarch *gdbarch, struct value *function,
 
 
 /* Breakpoints.  */
-static const gdb_byte breakpoint[] = { 0x00, 0x00, 0x3f, 0xff };
+constexpr gdb_byte spu_break_insn[] = { 0x00, 0x00, 0x3f, 0xff };
 
-GDBARCH_BREAKPOINT_MANIPULATION (spu, breakpoint)
+typedef BP_MANIPULATION (spu_break_insn) spu_breakpoint;
 
 static int
 spu_memory_remove_breakpoint (struct gdbarch *gdbarch,
@@ -2790,7 +2790,8 @@ spu_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
   /* Breakpoints.  */
   set_gdbarch_decr_pc_after_break (gdbarch, 4);
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (spu);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch, spu_breakpoint::kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch, spu_breakpoint::bp_from_kind);
   set_gdbarch_memory_remove_breakpoint (gdbarch, spu_memory_remove_breakpoint);
   set_gdbarch_software_single_step (gdbarch, spu_software_single_step);
   set_gdbarch_get_longjmp_target (gdbarch, spu_get_longjmp_target);
index d278e80d806d6d958a103c4557e928570c6a9dc9..63be7616b77cfa97b2c5bfcbab3d459ad009cf7e 100644 (file)
@@ -1302,7 +1302,10 @@ tic6x_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
 
   set_gdbarch_skip_prologue (gdbarch, tic6x_skip_prologue);
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (tic6x);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch,
+                                      tic6x_breakpoint_kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch,
+                                      tic6x_sw_breakpoint_from_kind);
 
   set_gdbarch_unwind_pc (gdbarch, tic6x_unwind_pc);
   set_gdbarch_unwind_sp (gdbarch, tic6x_unwind_sp);
index ea0368890d026ada89c85893436f692c5ccc9d66..9cc2c2c5f558564a06e159f33cdbf392294eba5c 100644 (file)
@@ -843,10 +843,10 @@ tilegx_write_pc (struct regcache *regcache, CORE_ADDR pc)
 }
 
 /* 64-bit pattern for a { bpt ; nop } bundle.  */
-static const unsigned char breakpoint[] =
+constexpr gdb_byte tilegx_break_insn[] =
   { 0x00, 0x50, 0x48, 0x51, 0xae, 0x44, 0x6a, 0x28 };
 
-GDBARCH_BREAKPOINT_MANIPULATION (tilegx, breakpoint)
+typedef BP_MANIPULATION (tilegx_break_insn) tilegx_breakpoint;
 
 /* Normal frames.  */
 
@@ -1049,7 +1049,10 @@ tilegx_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_push_dummy_call (gdbarch, tilegx_push_dummy_call);
   set_gdbarch_get_longjmp_target (gdbarch, tilegx_get_longjmp_target);
   set_gdbarch_write_pc (gdbarch, tilegx_write_pc);
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (tilegx);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch,
+                                      tilegx_breakpoint::kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch,
+                                      tilegx_breakpoint::bp_from_kind);
   set_gdbarch_return_value (gdbarch, tilegx_return_value);
 
   set_gdbarch_print_insn (gdbarch, print_insn_tilegx);
index 27e67a49cb1e74e8aeea130fd451c6d8c035934e..d69ee3298283d2eef18a32eb8fadef3a94f39f18 100644 (file)
@@ -1457,7 +1457,8 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
 
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (v850);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch, v850_breakpoint_kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch, v850_sw_breakpoint_from_kind);
   set_gdbarch_return_value (gdbarch, v850_return_value);
   set_gdbarch_push_dummy_call (gdbarch, v850_push_dummy_call);
   set_gdbarch_skip_prologue (gdbarch, v850_skip_prologue);
index 861f807516f9ce46ba3800ce52db831c1f06867a..9c562f13b5e3538b7e7170a2538fca91a1677cf2 100644 (file)
@@ -252,9 +252,9 @@ vax_return_value (struct gdbarch *gdbarch, struct value *function,
    *LEN and optionally adjust *PC to point to the correct memory
    location for inserting the breakpoint.  */
 
-static gdb_byte break_insn[] = { 3 };
+constexpr gdb_byte vax_break_insn[] = { 3 };
 
-GDBARCH_BREAKPOINT_MANIPULATION (vax, break_insn)
+typedef BP_MANIPULATION (vax_break_insn) vax_breakpoint;
 \f
 /* Advance PC across any function entry prologue instructions
    to reach some "real" code.  */
@@ -495,7 +495,8 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_dummy_id (gdbarch, vax_dummy_id);
 
   /* Breakpoint info */
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (vax);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch, vax_breakpoint::kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch, vax_breakpoint::bp_from_kind);
 
   /* Misc info */
   set_gdbarch_deprecated_function_start_offset (gdbarch, 2);
index b2f0c5eaeb368efca12345d26f8e2a252cbecceb..819e2aea85e27e7f13ddb272eedd59cc8661e982 100644 (file)
@@ -506,9 +506,9 @@ xstormy16_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
   return 0;
 }
 
-static unsigned char breakpoint[] = { 0x06, 0x0 };
+constexpr gdb_byte xstormy16_break_insn[] = { 0x06, 0x0 };
 
-GDBARCH_BREAKPOINT_MANIPULATION (xstormy16, breakpoint)
+typedef BP_MANIPULATION (xstormy16_break_insn) xstormy16_breakpoint;
 
 /* Given a pointer to a jump table entry, return the address
    of the function it jumps to.  Return 0 if not found.  */
@@ -838,7 +838,10 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
   /* These values and methods are used when gdb calls a target function.  */
   set_gdbarch_push_dummy_call (gdbarch, xstormy16_push_dummy_call);
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (xstormy16);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch,
+                                      xstormy16_breakpoint::kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch,
+                                      xstormy16_breakpoint::bp_from_kind);
   set_gdbarch_return_value (gdbarch, xstormy16_return_value);
 
   set_gdbarch_skip_trampoline_code (gdbarch, xstormy16_skip_trampoline_code);
index 8eef5cb9c43fc6b14dce587f92a9c6493c539707..783f71d04e704f820d28aac7c0f53eaf27978c70 100644 (file)
@@ -3240,7 +3240,10 @@ xtensa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
 
   /* Set breakpoints.  */
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (xtensa);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch,
+                                      xtensa_breakpoint_kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch,
+                                      xtensa_sw_breakpoint_from_kind);
 
   /* After breakpoint instruction or illegal instruction, pc still
      points at break instruction, so don't decrement.  */