-
-/* An implementation of gdbarch_displaced_step_copy_insn for
- processors that don't need to modify the instruction before
- single-stepping the displaced copy.
-
- Simply copy gdbarch_max_insn_length (ARCH) bytes from FROM to TO.
- The closure is an array of that many bytes containing the
- instruction's bytes, allocated with xmalloc. */
-extern struct displaced_step_closure *
- simple_displaced_step_copy_insn (struct gdbarch *gdbarch,
- CORE_ADDR from, CORE_ADDR to,
- struct regcache *regs);
-
-/* Simple implementation of gdbarch_displaced_step_free_closure: Call
- xfree.
- This is appropriate for use with simple_displaced_step_copy_insn. */
-extern void
- simple_displaced_step_free_closure (struct gdbarch *gdbarch,
- struct displaced_step_closure *closure);
+struct dwarf2_frame_state;
+
+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;
+ }
+
+ 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>