| OLD | NEW |
| 1 # Copyright (C) 1996-1997, 2002-2003, 2007-2012 Free Software | 1 # Copyright (C) 1996-1997, 2002-2003, 2007-2012 Free Software |
| 2 # Foundation, Inc. | 2 # Foundation, Inc. |
| 3 | 3 |
| 4 # This program is free software; you can redistribute it and/or modify | 4 # This program is free software; you can redistribute it and/or modify |
| 5 # it under the terms of the GNU General Public License as published by | 5 # it under the terms of the GNU General Public License as published by |
| 6 # the Free Software Foundation; either version 3 of the License, or | 6 # the Free Software Foundation; either version 3 of the License, or |
| 7 # (at your option) any later version. | 7 # (at your option) any later version. |
| 8 # | 8 # |
| 9 # This program is distributed in the hope that it will be useful, | 9 # This program is distributed in the hope that it will be useful, |
| 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 # GNU General Public License for more details. | 12 # GNU General Public License for more details. |
| 13 # | 13 # |
| 14 # You should have received a copy of the GNU General Public License | 14 # You should have received a copy of the GNU General Public License |
| 15 # along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 | 16 |
| 17 # This file was written by Daniel Jacobowitz <drow@mvista.com> | 17 # This file was written by Daniel Jacobowitz <drow@mvista.com> |
| 18 # (parts based on pthreads.exp by Fred Fish (fnf@cygnus.com). | 18 # (parts based on pthreads.exp by Fred Fish (fnf@cygnus.com). |
| 19 # | 19 # |
| 20 # It tests miscellaneous actions with multiple threads, including | 20 # It tests miscellaneous actions with multiple threads, including |
| 21 # handling for thread exit. | 21 # handling for thread exit. |
| 22 | 22 |
| 23 if $tracelevel then { | |
| 24 strace $tracelevel | |
| 25 } | |
| 26 | 23 |
| 27 | 24 standard_testfile |
| 28 set testfile "print-threads" | |
| 29 set srcfile ${testfile}.c | |
| 30 set binfile ${objdir}/${subdir}/${testfile} | |
| 31 | 25 |
| 32 # regexp for "horizontal" text (i.e. doesn't include newline or | 26 # regexp for "horizontal" text (i.e. doesn't include newline or |
| 33 # carriage return) | 27 # carriage return) |
| 34 set horiz "\[^\n\r\]*" | 28 set horiz "\[^\n\r\]*" |
| 35 | 29 |
| 36 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab
le [list debug "incdir=${objdir}"]] != "" } { | 30 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab
le debug] != "" } { |
| 37 return -1 | 31 return -1 |
| 38 } | 32 } |
| 39 | 33 |
| 40 # Now we can proceed with the real testing. | 34 # Now we can proceed with the real testing. |
| 41 | 35 |
| 42 # Start with a fresh gdb. | 36 clean_restart ${binfile} |
| 43 | |
| 44 gdb_exit | |
| 45 gdb_start | |
| 46 gdb_reinitialize_dir $srcdir/$subdir | |
| 47 gdb_load ${binfile} | |
| 48 | 37 |
| 49 gdb_test_no_output "set print sevenbit-strings" | 38 gdb_test_no_output "set print sevenbit-strings" |
| 50 #gdb_test_no_output "set print address off" | 39 #gdb_test_no_output "set print address off" |
| 51 gdb_test_no_output "set width 0" | 40 gdb_test_no_output "set width 0" |
| 52 | 41 |
| 53 # We'll need this when we send_gdb a ^C to GDB. Need to do it before we | 42 # We'll need this when we send_gdb a ^C to GDB. Need to do it before we |
| 54 # run the program and gdb starts saving and restoring tty states. | 43 # run the program and gdb starts saving and restoring tty states. |
| 55 # On Ultrix, we don't need it and it is really slow (because shell_escape | 44 # On Ultrix, we don't need it and it is really slow (because shell_escape |
| 56 # doesn't use vfork). | 45 # doesn't use vfork). |
| 57 if ![istarget "*-*-ultrix*"] then { | 46 if ![istarget "*-*-ultrix*"] then { |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 runto_main | 106 runto_main |
| 118 gdb_test "break thread_function" "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+: file .*p
rint-threads.c, line \[0-9\]*\\." "break thread_function (3)" | 107 gdb_test "break thread_function" "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+: file .*p
rint-threads.c, line \[0-9\]*\\." "break thread_function (3)" |
| 119 gdb_test_no_output "set var slow = 1" "set var slow = 1 (2)" | 108 gdb_test_no_output "set var slow = 1" "set var slow = 1 (2)" |
| 120 gdb_breakpoint "kill" | 109 gdb_breakpoint "kill" |
| 121 # Extend the timeout for slower tests. | 110 # Extend the timeout for slower tests. |
| 122 set timeout [expr $oldtimeout + 120] | 111 set timeout [expr $oldtimeout + 120] |
| 123 test_all_threads "slow with kill breakpoint" 1 | 112 test_all_threads "slow with kill breakpoint" 1 |
| 124 set timeout $oldtimeout | 113 set timeout $oldtimeout |
| 125 | 114 |
| 126 return 0 | 115 return 0 |
| OLD | NEW |