gdb/testsuite: make more use of mi-support.exp
authorAndrew Burgess <aburgess@redhat.com>
Fri, 17 Feb 2023 14:33:03 +0000 (14:33 +0000)
committerAndrew Burgess <aburgess@redhat.com>
Tue, 28 Feb 2023 10:56:28 +0000 (10:56 +0000)
Building on the previous commit, now that the breakpoint related
support functions in lib/mi-support.exp can now help creating the
patterns for thread specific breakpoints, make use of this
functionality for gdb.mi/mi-nsmoribund.exp and gdb.mi/mi-pending.exp.

There should be no changes in what is tested after this commit.

Reviewed-By: Pedro Alves <pedro@palves.net>
gdb/testsuite/gdb.mi/mi-nsmoribund.exp
gdb/testsuite/gdb.mi/mi-pending.exp

index 55450e4621ac7fb192d9e14c5b58d675ddce1b75..a08ba8ab2e742b1bb0d5b62881a7916fad075036 100644 (file)
@@ -73,9 +73,10 @@ mi_gdb_test "-thread-select 5" "\\^done.*" "select thread 5"
 mi_delete_breakpoints
 
 # Recreate the same breakpoint, but this time, specific to thread 5.
-mi_gdb_test "234-break-insert -p 5 $srcfile:$bkpt_line" \
-    "234\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\".*\",func=\"thread_function\",file=\".*\",fullname=\".*\",line=\".*\",thread-groups=\\\[\".*\"\\\],thread=\"5\",times=\"0\",original-location=\".*\"\}" \
-    "thread specific breakpoint at thread_function" 
+mi_create_breakpoint "-p 5 $srcfile:$bkpt_line" \
+    "thread specific breakpoint at thread_function" \
+    -number "3" -type "breakpoint" -disp "keep" -enabled "y" \
+    -func "thread_function" -line "$bkpt_line" -thread "5" -times "0"
 
 # Resume all threads.  Only thread 5 should report a stop.
 
index cd1301c21e34976c8ed8ff8b3f3b057b6bfc3abb..a5c6ee5c906aa89bd88965e9dc9829819b512696 100644 (file)
@@ -97,8 +97,10 @@ mi_expect_stop "breakpoint-hit" "thread_func" ".*" ".*" ".*" \
 mi_gdb_test "-break-delete 3" "\\^done" "delete breakpoint 3"
 
 # Set pending breakpoint with a thread via MI.
-mi_gdb_test "-break-insert -p 2 -f pendfunc3" \
-    ".*\\^done,bkpt=\{number=\"4\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"<PENDING>\",pending=\"pendfunc3\",thread=\"2\",times=\"0\",original-location=\"pendfunc3\"\}"\
+set bp [mi_make_breakpoint_pending -number "4" -type "breakpoint" \
+           -disp "keep" -enabled "y" -pending "pendfunc3" -thread "2" \
+           -times "0" -original-location "pendfunc3"]
+mi_gdb_test "-break-insert -p 2 -f pendfunc3" ".*\\^done,$bp"\
     "MI pending breakpoint on pendfunc3"
 
 mi_send_resuming_command "exec-continue" "continuing execution to thread condition"