set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
# Set pending dprintf via MI.
+set bp [mi_make_breakpoint_pending -number "1" -type "dprintf" \
+ -disp "keep" -enabled "y" -pending "pendfunc1" \
+ -original-location "pendfunc1"]
mi_gdb_test "-dprintf-insert -f pendfunc1 \"hello\"" \
- ".*\\^done,bkpt={number=\"1\",type=\"dprintf\",disp=\"keep\",enabled=\"y\",addr=\"<PENDING>\",pending=\"pendfunc1\",times=\"0\",original-location=\"pendfunc1\"}" \
- "mi set dprintf"
+ ".*\\^done,$bp" "mi set dprintf"
mi_create_breakpoint $bp_location1 "mi insert breakpoint bp_location1" \
-type "breakpoint" -line $bp_location1 -file ".*$srcfile"
-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" \
proc mi_make_breakpoint_pending {args} {
parse_args {{number .*} {type .*} {disp .*} {enabled .*}
- {pending .*} {original-location .*} {thread ""} {cond ""}}
+ {pending .*} {original-location .*} {thread ""} {cond ""}
+ {script ""} {times .*}}
set attr_list {}
foreach attr [list number type disp enabled] {
}
set ignore 0
- set times 0
- set script ""
set evaluated-by ""
set result [mi_make_breakpoint_1 \