diff --git a/gdb/testsuite/gdb.threads/thread-find.exp b/gdb/testsuite/gdb.threads/thread-find.exp index dd18a95..fb73963 100644 --- a/gdb/testsuite/gdb.threads/thread-find.exp +++ b/gdb/testsuite/gdb.threads/thread-find.exp @@ -65,31 +65,11 @@ gdb_test "thread apply 6 thread name threadname_6" \ # Collect thread ids, if any. gdb_test_multiple "info threads" "collect thread id" { - -re ". 6 .*\[Tt\]hread (\[0-9a-fA-Fx\]+).* \"threadname_6\" \[^\r\n\]*" { - set thread6 $expect_out(1,string) + -re "\r\n. (\d) +\[Tt\]hread (\[0-9a-fA-Fx\]+) \[^\r\n\]* \"threadname_\1\" \[^\r\n\]*" { + eval "set thread$expect_out(1,string) \\$expect_out(2,string)" exp_continue } - -re ". 5 .*\[Tt\]hread (\[0-9a-fA-Fx\]+).* \"threadname_5\" \[^\r\n\]*" { - set thread5 $expect_out(1,string) - exp_continue - } - -re ". 4 .*\[Tt\]hread (\[0-9a-fA-Fx\]+).* \"threadname_4\" \[^\r\n\]*" { - set thread4 $expect_out(1,string) - exp_continue - } - -re ". 3 .*\[Tt\]hread (\[0-9a-fA-Fx\]+).* \"threadname_3\" \[^\r\n\]*" { - set thread3 $expect_out(1,string) - exp_continue - } - -re ". 2 .*\[Tt\]hread (\[0-9a-fA-Fx\]+).* \"threadname_2\" \[^\r\n\]*" { - set thread2 $expect_out(1,string) - exp_continue - } - -re ". 1 .*\[Tt\]hread (\[0-9a-fA-Fx\]+).* \"threadname_1\" \[^\r\n\]*" { - set thread1 $expect_out(1,string) - exp_continue - } - -re ".*$gdb_prompt $" { + -re "\r\n$gdb_prompt $" { pass "collect thread id" } } @@ -100,31 +80,11 @@ if { [info exists thread6] } then { # Collect process ids, if any. gdb_test_multiple "info threads" "collect thread id" { - -re ". 6 .*\[Pp\]rocess (\[0-9a-fA-Fx\]+).* \"threadname_6\" \[^\r\n\]*" { - set process6 $expect_out(1,string) - exp_continue - } - -re ". 5 .*\[Pp\]rocess (\[0-9a-fA-Fx\]+).* \"threadname_5\" \[^\r\n\]*" { - set process5 $expect_out(1,string) - exp_continue - } - -re ". 4 .*\[Pp\]rocess (\[0-9a-fA-Fx\]+).* \"threadname_4\" \[^\r\n\]*" { - set process4 $expect_out(1,string) - exp_continue - } - -re ". 3 .*\[Pp\]rocess (\[0-9a-fA-Fx\]+).* \"threadname_3\" \[^\r\n\]*" { - set process3 $expect_out(1,string) + -re "\r\n. (\d) +\[Pp\]rocess (\[0-9a-fA-Fx\]+) \[^\r\n\]* \"threadname_\1\" \[^\r\n\]*" { + eval "set process$expect_out(1,string) \\$expect_out(2,string)" exp_continue } - -re ". 2 .*\[Pp\]rocess (\[0-9a-fA-Fx\]+).* \"threadname_2\" \[^\r\n\]*" { - set process2 $expect_out(1,string) - exp_continue - } - -re ". 1 .*\[Pp\]rocess (\[0-9a-fA-Fx\]+).* \"threadname_1\" \[^\r\n\]*" { - set process1 $expect_out(1,string) - exp_continue - } - -re ".*$gdb_prompt $" { + -re "\r\n$gdb_prompt $" { pass "collect process id" } } @@ -135,31 +95,11 @@ if { [info exists process6] } then { # Collect lwp ids, if any. gdb_test_multiple "info threads" "collect thread id" { - -re ". 6 .*LWP (\[0-9a-fA-Fx\]+).* \"threadname_6\" \[^\r\n\]*" { - set lwp6 $expect_out(1,string) - exp_continue - } - -re ". 5 .*LWP (\[0-9a-fA-Fx\]+).* \"threadname_5\" \[^\r\n\]*" { - set lwp5 $expect_out(1,string) - exp_continue - } - -re ". 4 .*LWP (\[0-9a-fA-Fx\]+).* \"threadname_4\" \[^\r\n\]*" { - set lwp4 $expect_out(1,string) - exp_continue - } - -re ". 3 .*LWP (\[0-9a-fA-Fx\]+).* \"threadname_3\" \[^\r\n\]*" { - set lwp3 $expect_out(1,string) - exp_continue - } - -re ". 2 .*LWP (\[0-9a-fA-Fx\]+).* \"threadname_2\" \[^\r\n\]*" { - set lwp2 $expect_out(1,string) - exp_continue - } - -re ". 1 .*LWP (\[0-9a-fA-Fx\]+).* \"threadname_1\" \[^\r\n\]*" { - set lwp1 $expect_out(1,string) + -re "\r\n. (\d) +LWP (\[0-9a-fA-Fx\]+) \[^\r\n\]* \"threadname_\1\" \[^\r\n\]*" { + eval "set lwp$expect_out(1,string) \\$expect_out(2,string)" exp_continue } - -re ".*$gdb_prompt $" { + -re "\r\n$gdb_prompt $" { pass "collect lwp id" } }