650e7c6194f63ed8f9375c39b185ab20c1bd839b
[binutils-gdb.git] / gdb / testsuite / gdb.multi / info-threads.exp
1 # Copyright 2009-2022 Free Software Foundation, Inc.
2
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
15
16 # Regression test for PR threads/19354. If you have a threaded
17 # inferior running (thread_db must be loaded), switch to another
18 # inferior, one that is NOT running yet, and do "info threads", you
19 # would get back an error.
20
21 standard_testfile hello.c
22
23 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {pthreads debug}] } {
24 return -1
25 }
26
27 if {![runto_main]} {
28 return -1
29 }
30
31 # Add another inferior.
32 gdb_test "add-inferior" "Added inferior 2.*" "add empty inferior 2"
33 gdb_test "inferior 2" "Switching to inferior 2.*" "switch to inferior 2"
34
35 # "info threads" while inferior 1 has execution and inferior 2 is not
36 # running yet should show inferior 1's thread, and give no error.
37 gdb_test "info threads" "1\.1 .* main .* at .*$srcfile:.*No selected thread.*"