Commit | Line | Data |
---|---|---|
c72b934c AC |
1 | # static.exp -- test script, for GDB, the GNU debugger. |
2 | ||
ecd75fc8 | 3 | # Copyright 2004-2014 Free Software Foundation, Inc. |
c72b934c AC |
4 | |
5 | # This program is free software; you can redistribute it and/or modify | |
6 | # it under the terms of the GNU General Public License as published by | |
e22f8b7c | 7 | # the Free Software Foundation; either version 3 of the License, or |
c72b934c | 8 | # (at your option) any later version. |
e22f8b7c | 9 | # |
c72b934c AC |
10 | # This program is distributed in the hope that it will be useful, |
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | # GNU General Public License for more details. | |
e22f8b7c | 14 | # |
c72b934c | 15 | # You should have received a copy of the GNU General Public License |
e22f8b7c | 16 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
c72b934c AC |
17 | |
18 | # Based on manythreads written by Jeff Johnston, contributed by Red | |
19 | # Hat. | |
20 | ||
c72b934c | 21 | |
0efbbabc | 22 | standard_testfile |
c72b934c AC |
23 | set static_flag "-static" |
24 | ||
25 | if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ | |
26 | executable \ | |
0efbbabc | 27 | [list debug "additional_flags=${static_flag}" \ |
c72b934c AC |
28 | ]] != "" } { |
29 | return -1 | |
30 | } | |
31 | ||
0efbbabc | 32 | clean_restart ${binfile} |
12b5d08a | 33 | gdb_test_no_output "set print sevenbit-strings" |
c72b934c AC |
34 | |
35 | ||
36 | # See if the static multi-threaded program runs. | |
37 | ||
38 | runto_main | |
39 | gdb_test "break sem_post" | |
40 | set test "Continue to main's call of sem_post" | |
41 | gdb_test_multiple "continue" "$test" { | |
aba471f5 | 42 | -re "Breakpoint .*, .*sem_post .*$gdb_prompt " { |
c72b934c AC |
43 | pass "$test" |
44 | } | |
45 | -re "Program received signal .*$gdb_prompt " { | |
46 | kfail gdb/1328 "$test" | |
47 | } | |
48 | } | |
49 | ||
50 | ||
51 | # See if handle SIG32 helps (a little) with a static multi-threaded | |
52 | # program. | |
53 | ||
1690f9cf DJ |
54 | set sig "SIG32" |
55 | ||
56 | # SIGRTMIN is 37 on hppa-linux and hpux | |
57 | if [istarget hppa*-*-*] { | |
58 | set sig "SIG37" | |
59 | } | |
60 | ||
c72b934c | 61 | rerun_to_main |
1690f9cf DJ |
62 | gdb_test "handle $sig nostop noprint pass" |
63 | set test "Handle $sig helps" | |
64 | gdb_test "continue" " .*sem_post .*" "handle $sig helps" | |
c72b934c AC |
65 | |
66 | ||
67 | # See if info threads produces anything approaching a thread list. | |
68 | ||
69 | set test "info threads" | |
70 | gdb_test_multiple "info threads" "$test" { | |
71 | -re " Thread .*$gdb_prompt " { | |
72 | pass "$test" | |
73 | } | |
74 | -re "$gdb_prompt " { | |
75 | kfail gdb/1328 "$test" | |
76 | } | |
77 | } | |
78 | ||
79 | ||
80 | # Check that the program can be quit. | |
81 | ||
82 | set test "GDB exits with static thread program" | |
83 | gdb_test_multiple "quit" "$test" { | |
b8fa0bfa | 84 | -re "Quit anyway\\? \\(y or n\\) $" { |
c72b934c AC |
85 | send_gdb "y\n" |
86 | exp_continue | |
87 | } | |
88 | eof { | |
89 | pass "$test" | |
90 | } | |
91 | } |