This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] Update stopped_by_sw_breakpoint documentation
- From: Tom Tromey <tromey at adacore dot com>
- To: gdb-patches at sourceware dot org
- Cc: Tom Tromey <tromey at adacore dot com>
- Date: Mon, 14 Oct 2019 08:53:06 -0600
- Subject: [PATCH] Update stopped_by_sw_breakpoint documentation
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(+)
diff --git a/gdb/target.h b/gdb/target.h
index 8dbd2d62dc4..84a6acbf7a4 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -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);
--
2.20.1