aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch-gen.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/gdbarch-gen.h')
-rw-r--r--gdb/gdbarch-gen.h25
1 files changed, 17 insertions, 8 deletions
diff --git a/gdb/gdbarch-gen.h b/gdb/gdbarch-gen.h
index bbf2376..a2bd08b 100644
--- a/gdb/gdbarch-gen.h
+++ b/gdb/gdbarch-gen.h
@@ -1068,9 +1068,9 @@ typedef bool (gdbarch_displaced_step_hw_singlestep_ftype) (struct gdbarch *gdbar
extern bool gdbarch_displaced_step_hw_singlestep (struct gdbarch *gdbarch);
extern void set_gdbarch_displaced_step_hw_singlestep (struct gdbarch *gdbarch, gdbarch_displaced_step_hw_singlestep_ftype *displaced_step_hw_singlestep);
-/* Fix up the state resulting from successfully single-stepping a
- displaced instruction, to give the result we would have gotten from
- stepping the instruction in its original location.
+/* Fix up the state after attempting to single-step a displaced
+ instruction, to give the result we would have gotten from stepping the
+ instruction in its original location.
REGS is the register state resulting from single-stepping the
displaced instruction.
@@ -1078,15 +1078,24 @@ extern void set_gdbarch_displaced_step_hw_singlestep (struct gdbarch *gdbarch, g
CLOSURE is the result from the matching call to
gdbarch_displaced_step_copy_insn.
- If you provide gdbarch_displaced_step_copy_insn.but not this
- function, then GDB assumes that no fixup is needed after
- single-stepping the instruction.
+ FROM is the address where the instruction was original located, TO is
+ the address of the displaced buffer where the instruction was copied
+ to for stepping.
+
+ COMPLETED_P is true if GDB stopped as a result of the requested step
+ having completed (e.g. the inferior stopped with SIGTRAP), otherwise
+ COMPLETED_P is false and GDB stopped for some other reason. In the
+ case where a single instruction is expanded to multiple replacement
+ instructions for stepping then it may be necessary to read the current
+ program counter from REGS in order to decide how far through the
+ series of replacement instructions the inferior got before stopping,
+ this may impact what will need fixing up in this function.
For a general explanation of displaced stepping and how GDB uses it,
see the comments in infrun.c. */
-typedef void (gdbarch_displaced_step_fixup_ftype) (struct gdbarch *gdbarch, struct displaced_step_copy_insn_closure *closure, CORE_ADDR from, CORE_ADDR to, struct regcache *regs);
-extern void gdbarch_displaced_step_fixup (struct gdbarch *gdbarch, struct displaced_step_copy_insn_closure *closure, CORE_ADDR from, CORE_ADDR to, struct regcache *regs);
+typedef void (gdbarch_displaced_step_fixup_ftype) (struct gdbarch *gdbarch, struct displaced_step_copy_insn_closure *closure, CORE_ADDR from, CORE_ADDR to, struct regcache *regs, bool completed_p);
+extern void gdbarch_displaced_step_fixup (struct gdbarch *gdbarch, struct displaced_step_copy_insn_closure *closure, CORE_ADDR from, CORE_ADDR to, struct regcache *regs, bool completed_p);
extern void set_gdbarch_displaced_step_fixup (struct gdbarch *gdbarch, gdbarch_displaced_step_fixup_ftype *displaced_step_fixup);
/* Prepare THREAD for it to displaced step the instruction at its current PC.