Update stopped_by_sw_breakpoint documentation
Commit Message
While developing a patch for PR gdb/22992, I found that the
documentation for stopped_by_sw_breakpoint was somewhat unclear. This
patch adds the text that I think would have helped me avoid some extra
investigation.
gdb/ChangeLog
2019-10-14 Tom Tromey <tromey@adacore.com>
* target.h (target_ops::stopped_by_sw_breakpoint): Update
comment.
---
gdb/ChangeLog | 5 +++++
gdb/target.h | 7 +++++++
2 files changed, 12 insertions(+)
@@ -507,6 +507,13 @@ struct target_ops
processes a breakpoint event, the breakpoint may already be
done from the target, so GDB needs to be able to tell whether
it should ignore the event and whether it should adjust the PC.
+
+ Note that the PC only needs to be adjusted if a software
+ breakpoint was in fact hit. In other cases, it should be left
+ alone. Also, this method should check
+ software_breakpoint_inserted_here_p before returning true --
+ and thus also be updating the regcache with the adjusted PC.
+
See adjust_pc_after_break. */
virtual bool stopped_by_sw_breakpoint ()
TARGET_DEFAULT_RETURN (false);