]>
Commit | Line | Data |
---|---|---|
4a94e368 | 1 | # Copyright 2021-2022 Free Software Foundation, Inc. |
4d772ea2 SM |
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 | # Test that GDB handles well a thread exiting with sched-lock on. A buggy GDB | |
17 | # would hang, a fixed GDB shows the "No unwaited-for children left" message and | |
18 | # shows the prompt. | |
19 | # | |
20 | # The explanation for the original bug involved some threads with a pending | |
21 | # wait status, so we launch multiple threads, which very likely gives us that. | |
22 | ||
23 | standard_testfile | |
24 | ||
25 | if { [build_executable "failed to prepare" ${testfile} ${srcfile} {debug pthreads}] } { | |
26 | return | |
27 | } | |
28 | ||
29 | proc do_test { } { | |
30 | clean_restart $::binfile | |
31 | ||
32 | # One of the launched threads will report a stop on thread_func. Some | |
33 | # others will also stop on thread_func and have a pending status. | |
34 | if { ![runto "thread_func"] } { | |
35 | return | |
36 | } | |
37 | ||
38 | gdb_test_no_output "set scheduler-locking on" | |
39 | gdb_test "continue" "No unwaited-for children left." | |
40 | } | |
41 | ||
42 | do_test |