1 # static.exp -- test script, for GDB, the GNU debugger.
3 # Copyright 2004, 2005, 2007, 2008, 2009, 2010, 2011
4 # Free Software Foundation, Inc.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 # Based on manythreads written by Jeff Johnston, contributed by Red
27 set testfile "staticthreads"
28 set srcfile ${testfile}.c
29 set binfile ${objdir}/${subdir}/${testfile}
30 set static_flag "-static"
32 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
34 [list debug "incdir=${objdir}" "additional_flags=${static_flag}" \
40 gdb_reinitialize_dir $srcdir/$subdir
42 gdb_test_no_output "set print sevenbit-strings"
45 # See if the static multi-threaded program runs.
48 gdb_test "break sem_post"
49 set test "Continue to main's call of sem_post"
50 gdb_test_multiple "continue" "$test" {
51 -re "Breakpoint .*, .*sem_post .*$gdb_prompt " {
54 -re "Program received signal .*$gdb_prompt " {
55 kfail gdb/1328 "$test"
60 # See if handle SIG32 helps (a little) with a static multi-threaded
65 # SIGRTMIN is 37 on hppa-linux and hpux
66 if [istarget hppa*-*-*] {
71 gdb_test "handle $sig nostop noprint pass"
72 set test "Handle $sig helps"
73 gdb_test "continue" " .*sem_post .*" "handle $sig helps"
76 # See if info threads produces anything approaching a thread list.
78 set test "info threads"
79 gdb_test_multiple "info threads" "$test" {
80 -re " Thread .*$gdb_prompt " {
84 kfail gdb/1328 "$test"
89 # Check that the program can be quit.
91 set test "GDB exits with static thread program"
92 gdb_test_multiple "quit" "$test" {
93 -re "Quit anyway\\? \\(y or n\\) $" {