Update stopped_by_sw_breakpoint documentation

Message ID 20191014145306.4421-1-tromey@adacore.com
State New, archived
Headers

Commit Message

Tom Tromey Oct. 14, 2019, 2:53 p.m. UTC
  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(+)
  

Patch

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);