Rename gdb/ChangeLog to gdb/ChangeLog-2021
[binutils-gdb.git] / gdb / testsuite / gdb.multi / info-threads.exp
blob8ebd03b290c6acbb2b1df0bd7b5bec78cea73e6d
1 # Copyright 2009-2021 Free Software Foundation, Inc.
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.
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.
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/>.
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.
21 standard_testfile hello.c
23 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {pthreads debug}] } {
24 return -1
27 clean_restart ${testfile}
29 if { ![runto_main] } then {
30 return -1
33 # Add another inferior.
34 gdb_test "add-inferior" "Added inferior 2.*" "add empty inferior 2"
35 gdb_test "inferior 2" "Switching to inferior 2.*" "switch to inferior 2"
37 # "info threads" while inferior 1 has execution and inferior 2 is not
38 # running yet should show inferior 1's thread, and give no error.
39 gdb_test "info threads" "1\.1 .* main .* at .*$srcfile:.*No selected thread.*"