aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/lib
diff options
context:
space:
mode:
authorTiezhu Yang <yangtiezhu@loongson.cn>2024-02-22 15:29:11 +0800
committerTiezhu Yang <yangtiezhu@loongson.cn>2024-02-26 19:19:58 +0800
commit4a4fd10d1707424b9b13aa4af0cec7590c086ea0 (patch)
tree9e8a9ef2dffa8b88aab491c8339f471dc6af6d43 /gdb/testsuite/lib
parent8b53ea2ace9d1fe7a04b3009bf75f5296e0428dc (diff)
downloadbinutils-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 'gdb/testsuite/lib')
-rw-r--r--gdb/testsuite/lib/gdb.exp6
-rw-r--r--gdb/testsuite/lib/mi-support.exp10
2 files changed, 8 insertions, 8 deletions
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 9a906f0..7357d56 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -373,10 +373,10 @@ proc delete_breakpoints {} {
#
set timeout 100
- set msg "delete all breakpoints in delete_breakpoints"
+ set msg "delete all breakpoints, watchpoints, tracepoints, and catchpoints in delete_breakpoints"
set deleted 0
gdb_test_multiple "delete breakpoints" "$msg" {
- -re "Delete all breakpoints.*y or n.*$" {
+ -re "Delete all breakpoints, watchpoints, tracepoints, and catchpoints.*y or n.*$" {
send_gdb "y\n" answer
exp_continue
}
@@ -390,7 +390,7 @@ proc delete_breakpoints {} {
set deleted 0
set msg "info breakpoints"
gdb_test_multiple $msg $msg {
- -re "No breakpoints or watchpoints..*$gdb_prompt $" {
+ -re "No breakpoints, watchpoints, tracepoints, or catchpoints..*$gdb_prompt $" {
set deleted 1
}
-re "$gdb_prompt $" {
diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
index 001e4ee..b3a27ef 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -355,25 +355,25 @@ proc mi_delete_breakpoints {} {
# FIXME: The mi operation won't accept a prompt back and will use the 'all' arg
send_gdb "102-break-delete\n"
gdb_expect 30 {
- -re "Delete all breakpoints.*y or n.*$" {
+ -re "Delete all breakpoints, watchpoints, tracepoints, and catchpoints.*y or n.*$" {
send_gdb "y\n"
exp_continue
}
-re "102-break-delete\r\n102\\\^done\r\n$mi_gdb_prompt$" {
# This happens if there were no breakpoints
}
- timeout { perror "Delete all breakpoints in mi_delete_breakpoints (timeout)" ; return }
+ timeout { perror "Delete all breakpoints, watchpoints, tracepoints, and catchpoints in mi_delete_breakpoints (timeout)" ; return }
}
-# The correct output is not "No breakpoints or watchpoints." but an
+# The correct output is not "No breakpoints, watchpoints, tracepoints, or catchpoints." but an
# empty BreakpointTable. Also, a query is not acceptable with mi.
send_gdb "103-break-list\n"
gdb_expect 30 {
-re "103-break-list\r\n103\\\^done,BreakpointTable=\{\}\r\n$mi_gdb_prompt$" {}
-re "103-break-list\r\n103\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[\\\]\}\r\n$mi_gdb_prompt$" {}
- -re "103-break-list\r\n103\\\^doneNo breakpoints or watchpoints.\r\n\r\n$mi_gdb_prompt$" {warning "Unexpected console text received"}
+ -re "103-break-list\r\n103\\\^doneNo breakpoints, watchpoints, tracepoints, or catchpoints.\r\n\r\n$mi_gdb_prompt$" {warning "Unexpected console text received"}
-re "$mi_gdb_prompt$" { perror "Breakpoints not deleted" ; return }
- -re "Delete all breakpoints.*or n.*$" {
+ -re "Delete all breakpoints, watchpoints, tracepoints, and catchpoints.*or n.*$" {
warning "Unexpected prompt for breakpoints deletion"
send_gdb "y\n"
exp_continue