diff options
author | Tiezhu Yang <yangtiezhu@loongson.cn> | 2024-02-22 15:29:11 +0800 |
---|---|---|
committer | Tiezhu Yang <yangtiezhu@loongson.cn> | 2024-02-26 19:19:58 +0800 |
commit | 4a4fd10d1707424b9b13aa4af0cec7590c086ea0 (patch) | |
tree | 9e8a9ef2dffa8b88aab491c8339f471dc6af6d43 /gdbserver/mem-break.cc | |
parent | 8b53ea2ace9d1fe7a04b3009bf75f5296e0428dc (diff) | |
download | gdb-4a4fd10d1707424b9b13aa4af0cec7590c086ea0.zip gdb-4a4fd10d1707424b9b13aa4af0cec7590c086ea0.tar.gz gdb-4a4fd10d1707424b9b13aa4af0cec7590c086ea0.tar.bz2 |
gdb: Modify the output of "info breakpoints" and "delete breakpoints"
The output of "info breakpoints" includes breakpoint, watchpoint,
tracepoint, and catchpoint if they are created, so it should show
all the four types are deleted in the output of "info breakpoints"
to report empty list after "delete breakpoints".
It should also change the output of "delete breakpoints" to make it
clear that watchpoints, tracepoints, and catchpoints are also being
deleted. This is suggested by Guinevere Larsen, thank you.
$ make check-gdb TESTS="gdb.base/access-mem-running.exp"
$ gdb/gdb gdb/testsuite/outputs/gdb.base/access-mem-running/access-mem-running
[...]
(gdb) break main
Breakpoint 1 at 0x12000073c: file /home/loongson/gdb.git/gdb/testsuite/gdb.base/access-mem-running.c, line 32.
(gdb) watch global_counter
Hardware watchpoint 2: global_counter
(gdb) trace maybe_stop_here
Tracepoint 3 at 0x12000071c: file /home/loongson/gdb.git/gdb/testsuite/gdb.base/access-mem-running.c, line 27.
(gdb) catch fork
Catchpoint 4 (fork)
(gdb) info breakpoints
Num Type Disp Enb Address What
1 breakpoint keep y 0x000000012000073c in main at /home/loongson/gdb.git/gdb/testsuite/gdb.base/access-mem-running.c:32
2 hw watchpoint keep y global_counter
3 tracepoint keep y 0x000000012000071c in maybe_stop_here at /home/loongson/gdb.git/gdb/testsuite/gdb.base/access-mem-running.c:27
not installed on target
4 catchpoint keep y fork
Without this patch:
(gdb) delete breakpoints
Delete all breakpoints? (y or n) y
(gdb) info breakpoints
No breakpoints or watchpoints.
(gdb) info breakpoints 3
No breakpoint or watchpoint matching '3'.
With this patch:
(gdb) delete breakpoints
Delete all breakpoints, watchpoints, tracepoints, and catchpoints? (y or n) y
(gdb) info breakpoints
No breakpoints, watchpoints, tracepoints, or catchpoints.
(gdb) info breakpoints 3
No breakpoint, watchpoint, tracepoint, or catchpoint matching '3'.
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Approved-by: Kevin Buettner <kevinb@redhat.com>
Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Diffstat (limited to 'gdbserver/mem-break.cc')
-rw-r--r-- | gdbserver/mem-break.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gdbserver/mem-break.cc b/gdbserver/mem-break.cc index e2cb13f..c23bb46 100644 --- a/gdbserver/mem-break.cc +++ b/gdbserver/mem-break.cc @@ -1999,7 +1999,8 @@ check_mem_write (CORE_ADDR mem_addr, unsigned char *buf, delete_disabled_breakpoints (); } -/* Delete all breakpoints, and un-insert them from the inferior. */ +/* Delete all breakpoints, watchpoints, tracepoints, and catchpoints, + and un-insert them from the inferior. */ void delete_all_breakpoints (void) @@ -2021,8 +2022,8 @@ mark_breakpoints_out (struct process_info *proc) raw_bp->inserted = 0; } -/* Release all breakpoints, but do not try to un-insert them from the - inferior. */ +/* Release all breakpoints, watchpoints, tracepoints, and catchpoints, + but do not try to un-insert them from the inferior. */ void free_all_breakpoints (struct process_info *proc) |