mi_load_shlibs $lib_sl2
# Set pending breakpoint via MI.
-mi_gdb_test "-break-insert -f pendfunc1" \
- ".*\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"<PENDING>\",pending=\"pendfunc1\",times=\"0\",original-location=\"pendfunc1\"\}"\
- "MI pending breakpoint on pendfunc1"
+mi_create_breakpoint_pending "-f pendfunc1" \
+ "MI pending breakpoint on pendfunc1" \
+ -number "1" \
+ -type "breakpoint" \
+ -disp "keep" \
+ -enabled "y" \
+ -pending "pendfunc1" \
+ -original-location "pendfunc1"
# Set pending breakpoint with a condition via MI.
-mi_gdb_test "-break-insert -f -c x==4 ${libfile1}.c:pendfunc2" \
- ".*\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"<PENDING>\",pending=\"${libfile1}.c:pendfunc2\",cond=\"x==4\",times=\"0\",original-location=\"${libfile1}.c:pendfunc2\"\}"\
- "MI pending breakpoint on ${libfile1}.c:pendfunc2 if x==4"
+mi_create_breakpoint_pending "-f -c x==4 ${libfile1}.c:pendfunc2" \
+ "MI pending breakpoint on ${libfile1}.c:pendfunc2 if x==4" \
+ -number "2" \
+ -type "breakpoint" \
+ -disp "keep" \
+ -enabled "y" \
+ -pending "${libfile1}.c:pendfunc2" \
+ -cond "x==4" \
+ -original-location "${libfile1}.c:pendfunc2"
# Set breakpoint so that we can stop when the thread is created
-mi_gdb_test "-break-insert -f thread_func" \
- ".*\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"${hex}\",func=\"thread_func\".*\}"\
- "MI pending breakpoint on thread_func"
+mi_create_breakpoint "-f thread_func" \
+ "MI breakpoint on thread_func" \
+ -number "3" \
+ -type "breakpoint" \
+ -disp "keep" \
+ -enabled "y" \
+ -addr "$hex" \
+ -func "thread_func"
mi_run_cmd
return $bp
}
+# Like mi_create_breakpoint, but creates a pending breakpoint.
+
+proc mi_create_breakpoint_pending {location test args} {
+ set bp [eval mi_make_breakpoint_pending $args]
+ mi_gdb_test "222-break-insert $location" ".*\r\n222\\^done,$bp" $test
+ return $bp
+}
+
# Creates varobj named NAME for EXPRESSION.
# Name cannot be "-".
proc mi_create_varobj { name expression testname } {
# -break-info for pending breakpoints.
#
# Arguments for the breakpoint may be specified using the options:
-# number, type, disp, enabled, pending, original-location, and thread.
+# number, type, disp, enabled, pending, original-location, thread, and
+# cond.
#
-# For the option -thread the corresponding output field is only
-# included if the option is present and not the empty string.
+# For the options -thread and -cond the corresponding output fields
+# are only included if the options are present and not the empty
+# string.
#
# Example: mi_make_breakpoint_pending -number 2 -pending func
# will return the breakpoint:
proc mi_make_breakpoint_pending {args} {
parse_args {{number .*} {type .*} {disp .*} {enabled .*}
- {pending .*} {original-location .*} {thread ""}}
+ {pending .*} {original-location .*} {thread ""} {cond ""}}
set attr_list {}
foreach attr [list number type disp enabled] {
set ignore 0
set times 0
set script ""
- set cond ""
set evaluated-by ""
set result [mi_make_breakpoint_1 \