]>
Commit | Line | Data |
---|---|---|
e2882c85 | 1 | # Copyright 2017-2018 Free Software Foundation, Inc. |
280ca31f DT |
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 | standard_testfile | |
17 | ||
18 | if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ | |
19 | executable { debug }] != "" } { | |
20 | return -1 | |
21 | } | |
22 | ||
23 | ||
24 | clean_restart ${binfile} | |
25 | ||
26 | runto thread_proc | |
27 | ||
28 | # | |
29 | # Generate corefile. | |
30 | # | |
31 | set corefile [standard_output_file gcore.test] | |
32 | set core_supported [gdb_gcore_cmd "$corefile" "save a corefile"] | |
33 | if {!$core_supported} { | |
34 | return 0 | |
35 | } | |
36 | ||
37 | # | |
38 | # Restart gdb and load generated corefile. | |
39 | # | |
40 | clean_restart ${binfile} | |
41 | ||
42 | set core_loaded [gdb_core_cmd "$corefile" "load generated corefile"] | |
43 | if { $core_loaded != 1 } { | |
44 | # No use proceeding from here. | |
45 | return 0 | |
46 | } | |
47 | ||
48 | # This fails in cross-debugging due to the use of native `libthread_db'. | |
49 | if {![string match $host_triplet $target_triplet]} { | |
50 | setup_kfail "threads/22381" "*-*-*" | |
51 | } | |
52 | gdb_test "p/x foo" \ | |
53 | "\\$\[0-9]+ = 0xdeadbeef" \ | |
54 | "print thread-local storage variable" | |
55 | ||
56 | gdb_exit |