aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.mi/mi-pending.exp
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2023-04-04 18:10:48 +0100
committerAndrew Burgess <aburgess@redhat.com>2023-04-14 22:16:17 +0100
commit393946658fe67e95abe41d3de03b36d84563e873 (patch)
tree256c8003a0a274ee62530f081304dcfe7740137b /gdb/testsuite/gdb.mi/mi-pending.exp
parent5be45917f49846f4ce58d8b63473e96dff7d4e0f (diff)
downloadgdb-393946658fe67e95abe41d3de03b36d84563e873.zip
gdb-393946658fe67e95abe41d3de03b36d84563e873.tar.gz
gdb-393946658fe67e95abe41d3de03b36d84563e873.tar.bz2
gdb/testsuite: accept script argument for mi_make_breakpoint_pending
This commit changes mi_make_breakpoint_pending to accept the 'script' and 'times' arguments. I've then added a new test that makes use of 'scripts' in gdb.mi/mi-pending.exp and gdb.mi/mi-dprintf-pending.exp. There is already a test in gdb.mi/mi-pending.exp that uses the 'times' argument -- previously this argument was being ignored, but is now used. Reviewed-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/testsuite/gdb.mi/mi-pending.exp')
-rw-r--r--gdb/testsuite/gdb.mi/mi-pending.exp15
1 files changed, 15 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.mi/mi-pending.exp b/gdb/testsuite/gdb.mi/mi-pending.exp
index 71c3d45..79f0db8 100644
--- a/gdb/testsuite/gdb.mi/mi-pending.exp
+++ b/gdb/testsuite/gdb.mi/mi-pending.exp
@@ -61,6 +61,21 @@ mi_create_breakpoint_pending "-f pendfunc1" \
-pending "pendfunc1" \
-original-location "pendfunc1"
+# Add some commands to the pending breakpoint, use -break-info to
+# check that the commands show up, then clear the commands again.
+mi_gdb_test "-break-commands 1 \"print 1\" \"print 2\" \"print 3\""\
+ "\\^done" \
+ "set breakpoint commands on pending breakpoint"
+set bp [mi_make_breakpoint_pending -number 1 -disp keep -func pendfunc1 \
+ -disp keep -enabled y -original-location pendfunc1 \
+ -script {\["print 1","print 2","print 3"\]}]
+mi_gdb_test "-break-info 1" \
+ "\\^done,[mi_make_breakpoint_table [list $bp]]" \
+ "breakpoint commands: check that commands are set"
+mi_gdb_test "-break-commands 1"\
+ "\\^done" \
+ "clear breakpoint commands on pending breakpoint"
+
# Set pending breakpoint with a condition via MI.
mi_create_breakpoint_pending "-f -c x==4 ${libfile1}.c:pendfunc2" \
"MI pending breakpoint on ${libfile1}.c:pendfunc2 if x==4" \