OLD | NEW |
1 # Copyright (C) 2007, 2011-2012 Free Software Foundation, Inc. | 1 # Copyright (C) 2007, 2011-2012 Free Software Foundation, Inc. |
2 | 2 |
3 # This program is free software; you can redistribute it and/or modify | 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 | 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 | 5 # the Free Software Foundation; either version 3 of the License, or |
6 # (at your option) any later version. | 6 # (at your option) any later version. |
7 # | 7 # |
8 # This program is distributed in the hope that it will be useful, | 8 # This program is distributed in the hope that it will be useful, |
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11 # GNU General Public License for more details. | 11 # GNU General Public License for more details. |
12 # | 12 # |
13 # You should have received a copy of the GNU General Public License | 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/>. | 14 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
15 | 15 |
16 # Exit of a thread when there are other threads in the inferior should | 16 # Exit of a thread when there are other threads in the inferior should |
17 # not hang GDB. | 17 # not hang GDB. |
18 | 18 |
19 set testfile "no-unwaited-for-left" | 19 standard_testfile |
20 set srcfile ${testfile}.c | |
21 set executable ${testfile} | 20 set executable ${testfile} |
22 set binfile ${objdir}/${subdir}/${executable} | |
23 | 21 |
24 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab
le {debug}] != "" } { | 22 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab
le {debug}] != "" } { |
25 return -1 | 23 return -1 |
26 } | 24 } |
27 | 25 |
28 clean_restart ${executable} | 26 clean_restart ${executable} |
29 | 27 |
30 if ![runto_main] { | 28 if ![runto_main] { |
31 return -1 | 29 return -1 |
32 } | 30 } |
(...skipping 27 matching lines...) Expand all Loading... |
60 gdb_test_no_output "set scheduler-locking on" \ | 58 gdb_test_no_output "set scheduler-locking on" \ |
61 "enable scheduler-locking, for main thread" | 59 "enable scheduler-locking, for main thread" |
62 # The main thread exits, and thread 3 was already stopped. | 60 # The main thread exits, and thread 3 was already stopped. |
63 gdb_test "continue" \ | 61 gdb_test "continue" \ |
64 "No unwaited-for children left." \ | 62 "No unwaited-for children left." \ |
65 "continue stops when the main thread exits" | 63 "continue stops when the main thread exits" |
66 | 64 |
67 gdb_test "info threads" \ | 65 gdb_test "info threads" \ |
68 "\r\n\[ \t\]*Id\[ \t\]+Target\[ \t\]+Id\[ \t\]+Frame\[ \t\]*\r\n *3 *Th
read \[^\r\n\]* \[^\r\n\]*.*The current thread <Thread ID 1> has terminated.*" \ | 66 "\r\n\[ \t\]*Id\[ \t\]+Target\[ \t\]+Id\[ \t\]+Frame\[ \t\]*\r\n *3 *Th
read \[^\r\n\]* \[^\r\n\]*.*The current thread <Thread ID 1> has terminated.*" \ |
69 "only thread 3 left, main thread terminated" | 67 "only thread 3 left, main thread terminated" |
OLD | NEW |