Commit | Line | Data |
---|---|---|
32d0add0 | 1 | # Copyright 2011-2015 Free Software Foundation, Inc. |
d472a426 JK |
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 | # Are we on a target board? And non-Linux targets seem to identify the thread | |
17 | # differently. | |
18 | if {![isnative] || ![istarget "*-*-linux*"]} { | |
19 | return | |
20 | } | |
21 | ||
0efbbabc | 22 | standard_testfile |
d472a426 | 23 | set executable ${testfile} |
d472a426 JK |
24 | if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { |
25 | untested ${testfile}.exp | |
26 | return -1 | |
27 | } | |
28 | ||
29 | set corefile [core_find $binfile] | |
30 | if {$corefile == ""} { | |
31 | return 0 | |
32 | } | |
33 | ||
34 | clean_restart $executable | |
35 | ||
36 | gdb_test "core-file $corefile" "Core was generated by .*" "load core" | |
37 | gdb_test "info files" "\r\nLocal core dump file:\r\n.*" "sanity check we see the core file" | |
38 | ||
39 | set test "print pthread_t of thread0" | |
40 | gdb_test_multiple "p/x thread0" $test { | |
41 | -re " = (0x\[0-9a-f\]+)\r\n$gdb_prompt $" { | |
42 | pass $test | |
43 | set thread0 $expect_out(1,string) | |
44 | } | |
45 | } | |
46 | set test "print pthread_t of thread1" | |
47 | gdb_test_multiple "p/x thread1" $test { | |
48 | -re " = (0x\[0-9a-f\]+)\r\n$gdb_prompt $" { | |
49 | pass $test | |
50 | set thread1 $expect_out(1,string) | |
51 | } | |
52 | } | |
53 | ||
54 | gdb_test "info threads" "\r\n *\[12\] +Thread $thread0 .*" "thread0 found" | |
55 | gdb_test "info threads" "\r\n *\\*? +\[12\] +Thread $thread1 .*" "thread1 found" | |
56 | gdb_test "info threads" "\r\n\[ \t\]*Id\[ \t\]+Target\[ \t\]+Id\[ \t\]+Frame\[ \t\]*\r\n\[^\r\n\]+\r\n\[^\r\n\]+" "no other thread found" |