Commit | Line | Data |
---|---|---|
b811d2c2 | 1 | # Copyright 2014-2020 Free Software Foundation, Inc. |
22fd09ae 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 | standard_testfile | |
17 | set corefile [standard_output_file ${testfile}.core] | |
18 | ||
19 | if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable debug] != ""} { | |
20 | return -1 | |
21 | } | |
22 | ||
23 | clean_restart ${testfile} | |
24 | ||
25 | gdb_test_no_output "set non-stop on" | |
26 | ||
27 | if { ! [ runto_main ] } then { | |
28 | return -1 | |
29 | } | |
30 | ||
31 | gdb_test_multiple "info threads" "threads are supported" { | |
32 | -re ".* main .*\r\n$gdb_prompt $" { | |
33 | # OK, threads are supported. | |
34 | } | |
35 | -re "\r\n$gdb_prompt $" { | |
36 | unsupported "gdb does not support threads on this target" | |
37 | return -1 | |
38 | } | |
39 | } | |
40 | ||
41 | gdb_breakpoint ${srcfile}:[gdb_get_line_number "break-here"] | |
42 | # gdb_continue_to_breakpoint does not work as it uses "$gdb_prompt $" regex | |
43 | # which does not work due to the output: (gdb) [Thread ... exited] | |
44 | set name "continue to breakpoint: break-here" | |
45 | gdb_test_multiple "continue" $name { | |
46 | -re "Breakpoint .* (at|in) .* break-here .*\r\n$gdb_prompt " { | |
47 | pass $name | |
48 | } | |
49 | } | |
50 | ||
51 | gdb_gcore_cmd "$corefile" "save a corefile" | |
52 | ||
53 | # Do not run "info threads" before "gcore" as it could workaround the bug | |
54 | # by discarding non-current exited threads. | |
55 | gdb_test "info threads" \ | |
56 | {The current thread <Thread ID 1> has terminated\. See `help thread'\.} \ | |
57 | "exited thread is current due to non-stop" |