-# Copyright (C) 1996-1997, 2002-2003, 2007-2012 Free Software
-# Foundation, Inc.
+# Copyright (C) 1996-2016 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
# It tests miscellaneous actions with multiple threads, including
# handling for thread exit.
-if $tracelevel then {
- strace $tracelevel
-}
-
-set testfile "print-threads"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
# regexp for "horizontal" text (i.e. doesn't include newline or
# carriage return)
set horiz "\[^\n\r\]*"
-if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}"]] != "" } {
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable debug] != "" } {
return -1
}
# Now we can proceed with the real testing.
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
gdb_test_no_output "set print sevenbit-strings"
#gdb_test_no_output "set print address off"
# 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 inferior_exited_re
fail "all threads ran once ($name) (total $i threads ran)"
}
}
- -re "Program received signal SIGTRAP.*(Thread \[-0-9a-fx\]* \\(zombie\\)|0x00000000 in ).*$gdb_prompt $" {
+ -re " received signal SIGTRAP.*(Thread \[-0-9a-fx\]* \\(zombie\\)|0x00000000 in ).*$gdb_prompt $" {
if { $kill == 1 } {
kfail "gdb/1265" "Running threads ($name) (zombie thread)"
} else {