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 | |
parent | 8b53ea2ace9d1fe7a04b3009bf75f5296e0428dc (diff) | |
download | binutils-4a4fd10d1707424b9b13aa4af0cec7590c086ea0.zip binutils-4a4fd10d1707424b9b13aa4af0cec7590c086ea0.tar.gz binutils-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')
-rw-r--r-- | gdbserver/mem-break.cc | 7 | ||||
-rw-r--r-- | gdbserver/mem-break.h | 7 |
2 files changed, 8 insertions, 6 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) diff --git a/gdbserver/mem-break.h b/gdbserver/mem-break.h index 99689c9..3652118 100644 --- a/gdbserver/mem-break.h +++ b/gdbserver/mem-break.h @@ -216,7 +216,8 @@ void check_mem_read (CORE_ADDR mem_addr, unsigned char *buf, int mem_len); void check_mem_write (CORE_ADDR mem_addr, unsigned char *buf, const unsigned char *myaddr, int mem_len); -/* Delete all breakpoints. */ +/* Delete all breakpoints, watchpoints, tracepoints, and catchpoints, + and un-insert them from the inferior. */ void delete_all_breakpoints (void); @@ -224,8 +225,8 @@ void delete_all_breakpoints (void); void mark_breakpoints_out (struct process_info *proc); -/* Delete all breakpoints, but do not try to un-insert them from the - inferior. */ +/* Delete 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); |