]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb: Modify the output of "info breakpoints" and "delete breakpoints"
authorTiezhu Yang <yangtiezhu@loongson.cn>
Thu, 22 Feb 2024 07:29:11 +0000 (15:29 +0800)
committerTiezhu Yang <yangtiezhu@loongson.cn>
Mon, 26 Feb 2024 11:19:58 +0000 (19:19 +0800)
commit4a4fd10d1707424b9b13aa4af0cec7590c086ea0
tree9e8a9ef2dffa8b88aab491c8339f471dc6af6d43
parent8b53ea2ace9d1fe7a04b3009bf75f5296e0428dc
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>
45 files changed:
gdb/breakpoint.c
gdb/doc/gdb.texinfo
gdb/ppc-linux-nat.c
gdb/testsuite/gdb.arch/i386-dr3-watch.exp
gdb/testsuite/gdb.base/annota-input-while-running.exp
gdb/testsuite/gdb.base/break-unload-file.exp
gdb/testsuite/gdb.base/break.exp
gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp
gdb/testsuite/gdb.base/continue-after-aborted-step-over.exp
gdb/testsuite/gdb.base/default.exp
gdb/testsuite/gdb.base/del.exp
gdb/testsuite/gdb.base/ena-dis-br.exp
gdb/testsuite/gdb.base/foll-fork.exp
gdb/testsuite/gdb.base/hbreak-unmapped.exp
gdb/testsuite/gdb.base/hbreak2.exp
gdb/testsuite/gdb.base/help.exp
gdb/testsuite/gdb.base/new-ui.exp
gdb/testsuite/gdb.base/save-bp.exp
gdb/testsuite/gdb.base/sepdebug.exp
gdb/testsuite/gdb.base/server-del-break.exp
gdb/testsuite/gdb.cp/annota2.exp
gdb/testsuite/gdb.cp/annota3.exp
gdb/testsuite/gdb.cp/ovldbreak.exp
gdb/testsuite/gdb.cp/save-bp-qualified.exp
gdb/testsuite/gdb.dwarf2/dw2-inline-header-1.exp
gdb/testsuite/gdb.dwarf2/dw2-inline-header-2.exp
gdb/testsuite/gdb.dwarf2/dw2-inline-header-3.exp
gdb/testsuite/gdb.dwarf2/dw2-inline-small-func.exp
gdb/testsuite/gdb.guile/scm-breakpoint.exp
gdb/testsuite/gdb.linespec/cpexplicit.exp
gdb/testsuite/gdb.linespec/explicit.exp
gdb/testsuite/gdb.mi/mi-py-modify-bp.exp
gdb/testsuite/gdb.mi/mi-return.exp
gdb/testsuite/gdb.mi/mi-thread-specific-bp.exp
gdb/testsuite/gdb.multi/inferior-specific-bp.exp
gdb/testsuite/gdb.opt/inline-small-func.exp
gdb/testsuite/gdb.python/py-breakpoint.exp
gdb/testsuite/gdb.reverse/ppc_record_test_isa_3_1.exp
gdb/testsuite/gdb.threads/continue-pending-after-query.exp
gdb/testsuite/gdb.threads/continue-pending-status.exp
gdb/testsuite/gdb.threads/thread_check.exp
gdb/testsuite/lib/gdb.exp
gdb/testsuite/lib/mi-support.exp
gdbserver/mem-break.cc
gdbserver/mem-break.h