X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Ftestsuite%2Fgdb.threads%2Fprint-threads.exp;h=6cf42ef556e9b9d2e90bebaecfcfdbeabed56824;hb=fda326dd1d341f03a75a36c8331b8cc8d1f637fa;hp=5d6fd8d5c8b330883b2888aeec4e0a33ef0078c6;hpb=4ee6625b5326ffb404d88b0befc9d8e4633024ed;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/testsuite/gdb.threads/print-threads.exp b/gdb/testsuite/gdb.threads/print-threads.exp index 5d6fd8d5c8..6cf42ef556 100644 --- a/gdb/testsuite/gdb.threads/print-threads.exp +++ b/gdb/testsuite/gdb.threads/print-threads.exp @@ -1,21 +1,18 @@ -# Copyright (C) 1996, 1997, 2002, 2003 Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 2002, 2003, 2007, 2008, 2009, 2010, 2011 +# Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or +# the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# Please email any bugs, comments, and/or additions to this file to: -# bug-gdb@prep.ai.mit.edu +# along with this program. If not, see . # This file was written by Daniel Jacobowitz # (parts based on pthreads.exp by Fred Fish (fnf@cygnus.com). @@ -27,8 +24,6 @@ if $tracelevel then { strace $tracelevel } -set prms_id 0 -set bug_id 0 set testfile "print-threads" set srcfile ${testfile}.c @@ -51,25 +46,24 @@ gdb_start gdb_reinitialize_dir $srcdir/$subdir gdb_load ${binfile} -gdb_test "set print sevenbit-strings" "" -#gdb_test "set print address off" "" -gdb_test "set width 0" "" +gdb_test_no_output "set print sevenbit-strings" +#gdb_test_no_output "set print address off" +gdb_test_no_output "set width 0" # We'll need this when we send_gdb a ^C to GDB. Need to do it before we # run the program and gdb starts saving and restoring tty states. # On Ultrix, we don't need it and it is really slow (because shell_escape # doesn't use vfork). if ![istarget "*-*-ultrix*"] then { - gdb_test "shell stty intr '^C'" "" + gdb_test "shell stty intr '^C'" ".*" } proc test_all_threads { name kill } { - global gdb_prompt + global gdb_prompt inferior_exited_re set i 0 set j 0 - send_gdb "continue\n" - gdb_expect { + gdb_test_multiple "continue" "all threads ran once" { -re "Breakpoint \[0-9\]+, thread_function \\(arg=.*\\) at .*print-threads.c:\[0-9\]+.*$gdb_prompt" { set i [expr $i + 1] pass "Hit thread_function breakpoint, $i ($name)" @@ -86,7 +80,7 @@ proc test_all_threads { name kill } { send_gdb "continue\n" exp_continue } - -re "Program exited normally\\.\[\r\n\]+$gdb_prompt" { + -re "$inferior_exited_re normally.\[\r\n\]+$gdb_prompt" { pass "program exited normally" if {$i == 5} { pass "all threads ran once ($name)" @@ -94,36 +88,30 @@ proc test_all_threads { name kill } { fail "all threads ran once ($name) (total $i threads ran)" } } - -re "Program received signal SIGTRAP.*(Thread \[0-9\]* \\(zombie\\)|0x00000000 in ).*$gdb_prompt $" { + -re "Program received signal SIGTRAP.*(Thread \[-0-9a-fx\]* \\(zombie\\)|0x00000000 in ).*$gdb_prompt $" { if { $kill == 1 } { kfail "gdb/1265" "Running threads ($name) (zombie thread)" } else { fail "Running threads ($name) (unknown output)" } } - -re "$gdb_prompt" { - fail "Running threads ($name) (unknown output)" - } - timeout { - fail "Running threads ($name) (timeout)" - } } } runto_main gdb_test "break thread_function" "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+: file .*print-threads.c, line \[0-9\]*\\." -gdb_test "set var slow = 0" "" +gdb_test_no_output "set var slow = 0" test_all_threads "fast" 0 runto_main gdb_test "break thread_function" "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+: file .*print-threads.c, line \[0-9\]*\\." "break thread_function (2)" -gdb_test "set var slow = 1" "" +gdb_test_no_output "set var slow = 1" test_all_threads "slow" 0 runto_main gdb_test "break thread_function" "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+: file .*print-threads.c, line \[0-9\]*\\." "break thread_function (3)" -gdb_test "set var slow = 1" "" "set var slow = 1 (2)" -gdb_test "break kill" "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+" +gdb_test_no_output "set var slow = 1" "set var slow = 1 (2)" +gdb_breakpoint "kill" test_all_threads "slow with kill breakpoint" 1 return 0