1 # static.exp
-- test script
, for GDB
, the GNU debugger.
3 # Copyright
2004, 2005 Free Software Foundation
, Inc.
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
7 # the Free Software Foundation
; either version
2 of the License
, or
8 #
(at your option
) any later version.
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.
15 # You should have received a copy of the GNU General Public License
16 # along with this
program; if not
, write to the Free Software
17 # Foundation
, Inc.
, 59 Temple Place
- Suite
330, Boston
, MA
02111-1307, USA.
19 # Based
on manythreads written by Jeff Johnston
, contributed by Red
29 set testfile
"staticthreads"
30 set srcfile $
{testfile
}.c
31 set binfile $
{objdir
}/$
{subdir
}/$
{testfile
}
32 set static_flag
"-static"
34 if {[gdb_compile_pthreads
"${srcdir}/${subdir}/${srcfile}" "${binfile}" \
36 [list debug
"incdir=${objdir}" "additional_flags=${static_flag}" \
42 gdb_reinitialize_dir $srcdir
/$subdir
44 gdb_test
"set print sevenbit-strings" ""
47 # See
if the static multi
-threaded
program runs.
50 gdb_test
"break sem_post"
51 set test
"Continue to main's call of sem_post"
52 gdb_test_multiple
"continue" "$test" {
53 -re
" sem_post .*$gdb_prompt " {
56 -re
"Program received signal .*$gdb_prompt " {
57 kfail gdb
/1328 "$test"
62 # See
if handle SIG32 helps
(a little
) with a static multi
-threaded
67 # SIGRTMIN is
37 on hppa
-linux and hpux
68 if [istarget hppa
*-*-*] {
73 gdb_test
"handle $sig nostop noprint pass"
74 set test
"Handle $sig helps"
75 gdb_test
"continue" " .*sem_post .*" "handle $sig helps"
78 # See
if info threads produces anything approaching a thread list.
80 set test
"info threads"
81 gdb_test_multiple
"info threads" "$test" {
82 -re
" Thread .*$gdb_prompt " {
86 kfail gdb
/1328 "$test"
91 # Check that the
program can be quit.
93 set test
"GDB exits with static thread program"
94 gdb_test_multiple
"quit" "$test" {
95 -re
"The program is running. Exit anyway\\? \\(y or n\\) $" {