* gdb.threads/watchpoint-fork.exp (test): Use
authorTom Tromey <tromey@redhat.com>
Tue, 26 Jun 2012 19:23:20 +0000 (19:23 +0000)
committerTom Tromey <tromey@redhat.com>
Tue, 26 Jun 2012 19:23:20 +0000 (19:23 +0000)
standard_output_file.  Don't declare objdir.
* gdb.threads/attach-into-signal.exp: Use standard_testfile,
standard_output_file.
* gdb.threads/attach-stopped.exp: Use standard_testfile.
* gdb.threads/bp_in_thread.exp: Use standard_testfile,
clean_restart.  Remove incdir.
* gdb.threads/corethreads.exp: Use standard_testfile.
* gdb.threads/execl.exp: Use standard_testfile,
standard_output_file, clean_restart.
* gdb.threads/fork-child-threads.exp: Use standard_testfile,
clean_restart.
* gdb.threads/fork-thread-pending.exp: Use standard_testfile,
clean_restart.
* gdb.threads/gcore-thread.exp: Use standard_testfile.  Remove
incdir.
* gdb.threads/hand-call-in-threads.exp: Use standard_testfile,
clean_restart.  Remove incdir.
* gdb.threads/ia64-sigill.exp: Use standard_testfile.
* gdb.threads/interrupted-hand-call.exp: Use standard_testfile,
clean_restart.  Remove incdir.
* gdb.threads/killed.exp: Use standard_testfile, clean_restart.
Remove incdir.
* gdb.threads/leader-exit.exp: Use standard_testfile.
* gdb.threads/linux-dp.exp: Use standard_testfile, clean_restart.
* gdb.threads/local-watch-wrong-thread.exp: Use standard_testfile,
clean_restart.
* gdb.threads/manythreads.exp: Use standard_testfile,
clean_restart.  Remove incdir.
* gdb.threads/multi-create.exp: Use standard_testfile,
clean_restart.
* gdb.threads/no-unwaited-for-left.exp: Use standard_testfile.
* gdb.threads/non-ldr-exc-1.exp: Use standard_testfile.
* gdb.threads/non-ldr-exc-2.exp: Use standard_testfile.
* gdb.threads/non-ldr-exc-3.exp: Use standard_testfile.
* gdb.threads/non-ldr-exc-4.exp: Use standard_testfile.
* gdb.threads/pending-step.exp: Use standard_testfile,
clean_restart.  Remove incdir.
* gdb.threads/print-threads.exp: Use standard_testfile,
clean_restart.  Remove incdir.
* gdb.threads/pthread_cond_wait.exp: Use standard_testfile,
clean_restart.  Remove incdir.
* gdb.threads/pthreads.exp: Use standard_testfile, clean_restart.
Remove incdir.
* gdb.threads/schedlock.exp: Use standard_testfile.  Remove
incdir.
* gdb.threads/sigthread.exp: Use standard_testfile,
clean_restart.
* gdb.threads/staticthreads.exp: Use standard_testfile,
clean_restart.  Remove incdir.
* gdb.threads/switch-threads.exp: Use standard_testfile,
clean_restart.  Remove incdir.
* gdb.threads/thread-execl.exp: Use standard_testfile,
clean_restart.  Remove incdir.
* gdb.threads/thread-find.exp: Use standard_testfile,
clean_restart.
* gdb.threads/thread-specific.exp: Use standard_testfile,
clean_restart.  Remove incdir.
* gdb.threads/thread-unwindonsignal.exp: Use standard_testfile,
clean_restart.  Remove incdir.
* gdb.threads/thread_check.exp: Use standard_testfile,
clean_restart.  Remove incdir.
* gdb.threads/thread_events.exp: Use standard_testfile.  Remove
incdir.
* gdb.threads/threadapply.exp: Use standard_testfile,
clean_restart.  Remove incdir.
* gdb.threads/threxit-hop-specific.exp: Use standard_testfile,
clean_restart.  Remove incdir.
* gdb.threads/tls-nodebug.exp: Use standard_testfile,
clean_restart.
* gdb.threads/tls-shared.exp: Use standard_testfile,
clean_restart, standard_output_file.
* gdb.threads/tls-var.exp: Use standard_testfile,
standard_output_file.
* gdb.threads/tls.exp: Use standard_testfile, clean_restart.
Remove incdir.
* gdb.threads/watchthreads-reorder.exp: Use standard_testfile.
* gdb.threads/watchthreads.exp: Use standard_testfile.  Remove
incdir.
* gdb.threads/watchthreads2.exp: Use standard_testfile,
clean_restart.  Remove incdir.

47 files changed:
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.threads/attach-into-signal.exp
gdb/testsuite/gdb.threads/attach-stopped.exp
gdb/testsuite/gdb.threads/bp_in_thread.exp
gdb/testsuite/gdb.threads/corethreads.exp
gdb/testsuite/gdb.threads/execl.exp
gdb/testsuite/gdb.threads/fork-child-threads.exp
gdb/testsuite/gdb.threads/fork-thread-pending.exp
gdb/testsuite/gdb.threads/gcore-thread.exp
gdb/testsuite/gdb.threads/hand-call-in-threads.exp
gdb/testsuite/gdb.threads/ia64-sigill.exp
gdb/testsuite/gdb.threads/interrupted-hand-call.exp
gdb/testsuite/gdb.threads/killed.exp
gdb/testsuite/gdb.threads/leader-exit.exp
gdb/testsuite/gdb.threads/linux-dp.exp
gdb/testsuite/gdb.threads/local-watch-wrong-thread.exp
gdb/testsuite/gdb.threads/manythreads.exp
gdb/testsuite/gdb.threads/multi-create.exp
gdb/testsuite/gdb.threads/no-unwaited-for-left.exp
gdb/testsuite/gdb.threads/non-ldr-exc-1.exp
gdb/testsuite/gdb.threads/non-ldr-exc-2.exp
gdb/testsuite/gdb.threads/non-ldr-exc-3.exp
gdb/testsuite/gdb.threads/non-ldr-exc-4.exp
gdb/testsuite/gdb.threads/pending-step.exp
gdb/testsuite/gdb.threads/print-threads.exp
gdb/testsuite/gdb.threads/pthread_cond_wait.exp
gdb/testsuite/gdb.threads/pthreads.exp
gdb/testsuite/gdb.threads/schedlock.exp
gdb/testsuite/gdb.threads/sigthread.exp
gdb/testsuite/gdb.threads/staticthreads.exp
gdb/testsuite/gdb.threads/switch-threads.exp
gdb/testsuite/gdb.threads/thread-execl.exp
gdb/testsuite/gdb.threads/thread-find.exp
gdb/testsuite/gdb.threads/thread-specific.exp
gdb/testsuite/gdb.threads/thread-unwindonsignal.exp
gdb/testsuite/gdb.threads/thread_check.exp
gdb/testsuite/gdb.threads/thread_events.exp
gdb/testsuite/gdb.threads/threadapply.exp
gdb/testsuite/gdb.threads/threxit-hop-specific.exp
gdb/testsuite/gdb.threads/tls-nodebug.exp
gdb/testsuite/gdb.threads/tls-shared.exp
gdb/testsuite/gdb.threads/tls-var.exp
gdb/testsuite/gdb.threads/tls.exp
gdb/testsuite/gdb.threads/watchpoint-fork.exp
gdb/testsuite/gdb.threads/watchthreads-reorder.exp
gdb/testsuite/gdb.threads/watchthreads.exp
gdb/testsuite/gdb.threads/watchthreads2.exp

index 02494cf..4e73971 100644 (file)
@@ -1,5 +1,89 @@
 2012-06-26  Tom Tromey  <tromey@redhat.com>
 
+       * gdb.threads/watchpoint-fork.exp (test): Use
+       standard_output_file.  Don't declare objdir.
+       * gdb.threads/attach-into-signal.exp: Use standard_testfile,
+       standard_output_file.
+       * gdb.threads/attach-stopped.exp: Use standard_testfile.
+       * gdb.threads/bp_in_thread.exp: Use standard_testfile,
+       clean_restart.  Remove incdir.
+       * gdb.threads/corethreads.exp: Use standard_testfile.
+       * gdb.threads/execl.exp: Use standard_testfile,
+       standard_output_file, clean_restart.
+       * gdb.threads/fork-child-threads.exp: Use standard_testfile,
+       clean_restart.
+       * gdb.threads/fork-thread-pending.exp: Use standard_testfile,
+       clean_restart.
+       * gdb.threads/gcore-thread.exp: Use standard_testfile.  Remove
+       incdir.
+       * gdb.threads/hand-call-in-threads.exp: Use standard_testfile,
+       clean_restart.  Remove incdir.
+       * gdb.threads/ia64-sigill.exp: Use standard_testfile.
+       * gdb.threads/interrupted-hand-call.exp: Use standard_testfile,
+       clean_restart.  Remove incdir.
+       * gdb.threads/killed.exp: Use standard_testfile, clean_restart.
+       Remove incdir.
+       * gdb.threads/leader-exit.exp: Use standard_testfile.
+       * gdb.threads/linux-dp.exp: Use standard_testfile, clean_restart.
+       * gdb.threads/local-watch-wrong-thread.exp: Use standard_testfile,
+       clean_restart.
+       * gdb.threads/manythreads.exp: Use standard_testfile,
+       clean_restart.  Remove incdir.
+       * gdb.threads/multi-create.exp: Use standard_testfile,
+       clean_restart.
+       * gdb.threads/no-unwaited-for-left.exp: Use standard_testfile.
+       * gdb.threads/non-ldr-exc-1.exp: Use standard_testfile.
+       * gdb.threads/non-ldr-exc-2.exp: Use standard_testfile.
+       * gdb.threads/non-ldr-exc-3.exp: Use standard_testfile.
+       * gdb.threads/non-ldr-exc-4.exp: Use standard_testfile.
+       * gdb.threads/pending-step.exp: Use standard_testfile,
+       clean_restart.  Remove incdir.
+       * gdb.threads/print-threads.exp: Use standard_testfile,
+       clean_restart.  Remove incdir.
+       * gdb.threads/pthread_cond_wait.exp: Use standard_testfile,
+       clean_restart.  Remove incdir.
+       * gdb.threads/pthreads.exp: Use standard_testfile, clean_restart.
+       Remove incdir.
+       * gdb.threads/schedlock.exp: Use standard_testfile.  Remove
+       incdir.
+       * gdb.threads/sigthread.exp: Use standard_testfile,
+       clean_restart.
+       * gdb.threads/staticthreads.exp: Use standard_testfile,
+       clean_restart.  Remove incdir.
+       * gdb.threads/switch-threads.exp: Use standard_testfile,
+       clean_restart.  Remove incdir.
+       * gdb.threads/thread-execl.exp: Use standard_testfile,
+       clean_restart.  Remove incdir.
+       * gdb.threads/thread-find.exp: Use standard_testfile,
+       clean_restart.
+       * gdb.threads/thread-specific.exp: Use standard_testfile,
+       clean_restart.  Remove incdir.
+       * gdb.threads/thread-unwindonsignal.exp: Use standard_testfile,
+       clean_restart.  Remove incdir.
+       * gdb.threads/thread_check.exp: Use standard_testfile,
+       clean_restart.  Remove incdir.
+       * gdb.threads/thread_events.exp: Use standard_testfile.  Remove
+       incdir.
+       * gdb.threads/threadapply.exp: Use standard_testfile,
+       clean_restart.  Remove incdir.
+       * gdb.threads/threxit-hop-specific.exp: Use standard_testfile,
+       clean_restart.  Remove incdir.
+       * gdb.threads/tls-nodebug.exp: Use standard_testfile,
+       clean_restart.
+       * gdb.threads/tls-shared.exp: Use standard_testfile,
+       clean_restart, standard_output_file.
+       * gdb.threads/tls-var.exp: Use standard_testfile,
+       standard_output_file.
+       * gdb.threads/tls.exp: Use standard_testfile, clean_restart.
+       Remove incdir.
+       * gdb.threads/watchthreads-reorder.exp: Use standard_testfile.
+       * gdb.threads/watchthreads.exp: Use standard_testfile.  Remove
+       incdir.
+       * gdb.threads/watchthreads2.exp: Use standard_testfile,
+       clean_restart.  Remove incdir.
+
+2012-06-26  Tom Tromey  <tromey@redhat.com>
+
        * gdb.trace/actions.exp: Use standard_testfile.
        * gdb.trace/ax.exp: Use standard_testfile.
        * gdb.trace/backtrace.exp: Use standard_testfile.
index f98906b..c74fafa 100644 (file)
@@ -22,29 +22,21 @@ if { ![isnative] || [is_remote host] || [target_info exists use_gdb_stub]
     continue
 }
 
-set testfile "attach-into-signal"
-set srcfile  ${testfile}.c
+standard_testfile
 set executable_nothr ${testfile}-nothr
 set executable_thr ${testfile}-thr
 
-remote_exec build "rm -f ${objdir}/${subdir}/${executable_nothr}"
-remote_exec build "rm -f ${objdir}/${subdir}/${executable_thr}"
-# For debugging this test
-#
-#log_user 1
-
 proc corefunc { threadtype executable } {
     global srcfile
     global srcdir
-    global objdir
     global subdir
     global gdb_prompt
 
     with_test_prefix "$threadtype" {
        clean_restart ${executable}
 
-       set binfile ${objdir}/${subdir}/${executable}
-       set escapedbinfile [string_to_regexp ${objdir}/${subdir}/${executable}]
+       set binfile [standard_output_file $executable]
+       set escapedbinfile [string_to_regexp ${binfile}]
 
        if [get_compiler_info] {
            return -1
@@ -183,7 +175,7 @@ corefunc nonthreaded ${executable_nothr}
 
 # build the test case also with threads
 #
-if  { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${objdir}/${subdir}/${executable_thr}" executable {debug additional_flags=-DUSE_THREADS}] != "" } {
+if  { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" [standard_output_file ${executable_thr}] executable {debug additional_flags=-DUSE_THREADS}] != "" } {
     untested "attach-into-signal.exp (threaded)"
     return -1
 }
index cba19d8..f4c05ba 100644 (file)
@@ -23,10 +23,8 @@ if { ![isnative] || [is_remote host] || [target_info exists use_gdb_stub]
     continue
 }
 
-set testfile "attach-stopped"
-set srcfile  ${testfile}.c
-set binfile  ${objdir}/${subdir}/${testfile}
-set escapedbinfile  [string_to_regexp ${objdir}/${subdir}/${testfile}]
+standard_testfile
+set escapedbinfile  [string_to_regexp $binfile]
 
 #execute_anywhere "rm -f ${binfile}"
 remote_exec build "rm -f ${binfile}"
index 0ec7054..7b6182c 100644 (file)
 # GDB reported a SIGTRAP signal in a random thread when hitting
 # a breakpoint.
 
-set testfile "bp_in_thread"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 
-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
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart $binfile
+
 runto_main
 
 gdb_test "break noreturn" \
index 2dd1173..6700017 100644 (file)
@@ -19,10 +19,8 @@ if {![isnative] || ![istarget "*-*-linux*"]} {
     return
 }
 
-set testfile "corethreads"
-set srcfile ${testfile}.c
+standard_testfile
 set executable ${testfile}
-set binfile ${objdir}/${subdir}/${executable}
 if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
      untested ${testfile}.exp
      return -1
index 4a8fb4d..9b9116a 100644 (file)
@@ -20,9 +20,7 @@ if { [is_remote target] } then {
 }
 
 # Original image, loads a thread library.
-set testfile "execl"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 
 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
     return -1
@@ -31,16 +29,13 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab
 # New image, that does not load a thread library.
 set testfile1 "execl1"
 set srcfile1 ${testfile1}.c
-set binfile1 ${objdir}/${subdir}/${testfile1}
+set binfile1 [standard_output_file ${testfile1}]
 
 if {[gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile1}" executable {debug}] != "" } {
     return -1
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 
 runto_main
 
index e94fcbb..b8c198c 100644 (file)
@@ -22,19 +22,14 @@ if { [is_remote target] || ![isnative] } then {
     return 0
 }
 
-set testfile fork-child-threads
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 
 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
     return -1
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
+clean_restart ${binfile}
 
-gdb_load ${binfile}
 if ![runto_main] then {
    fail "Can't run to main"
    return 0
index 3c0a4af..e2b4cc3 100644 (file)
@@ -25,19 +25,14 @@ if { ! [istarget "*-*-linux*"] } {
     return 0
 }
 
-set testfile fork-thread-pending
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 
 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
     return -1
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
+clean_restart ${binfile}
 
-gdb_load ${binfile}
 if ![runto_main] then {
    fail "Can't run to main"
    return 0
index dfb2314..a47f931 100644 (file)
 # This is a test for the gdb command "generate-core-file".
 
 # Single-threaded test case
-set testfile "gcore-thread"
-set srcfile  pthreads.c
-set objfile  ${objdir}/${subdir}/${testfile}.o
-set binfile  ${objdir}/${subdir}/${testfile}
-set corefile ${objdir}/${subdir}/${testfile}.test
-set core0file ${objdir}/${subdir}/${testfile}0.test
+standard_testfile pthreads.c
+set objfile  $binfile.o
+set corefile $binfile.test
+set core0file ${binfile}0.test
 
 if [istarget "*-*-linux"] then {
     set target_cflags "-D_MIT_POSIX_THREADS"
@@ -35,7 +33,7 @@ if [istarget "*-*-linux"] then {
 # libpthread, therefore libthread_db will not fail as expected
 # on the test `zeroed-threads cannot be listed'.
 
-set opts [list debug "incdir=${objdir}"]
+set opts [list debug]
 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${objfile}" object $opts] != ""
     || ([gdb_compile_pthreads "${objfile}" "${binfile}" executable [concat $opts {additional_flags=-Wl,-z,norelro}] ] != ""
         && [gdb_compile_pthreads "${objfile}" "${binfile}" executable $opts] != "") } {
index ba0e74b..e179390 100644 (file)
 
 set NR_THREADS 4
 
-set testfile "hand-call-in-threads"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 
-if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}" "additional_flags=-DNR_THREADS=$NR_THREADS"]] != "" } {
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "additional_flags=-DNR_THREADS=$NR_THREADS"]] != "" } {
     return -1
 }
 
@@ -51,10 +49,7 @@ proc get_dummy_frame_number { } {
     return ""
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 
 if { ![runto_main] } {
     fail "Can't run to main"
index e14c685..a1ae60d 100644 (file)
@@ -20,9 +20,7 @@
 # breakpoint has been already deleted.  moribund locations are not active in
 # the default all-stop mode.
 
-set testfile "ia64-sigill"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" ${binfile} executable [list debug additional_flags=-lrt]] != "" } {
     return -1
 }
index 926c612..7b838af 100644 (file)
 
 set NR_THREADS 4
 
-set testfile "interrupted-hand-call"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 
-if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}" "additional_flags=-DNR_THREADS=$NR_THREADS"]] != "" } {
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "additional_flags=-DNR_THREADS=$NR_THREADS"]] != "" } {
     return -1
 }
 
@@ -35,10 +33,7 @@ if [target_info exists gdb,cannot_call_functions] {
     continue
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 
 if { ![runto_main] } {
     fail "Can't run to main"
index fa99e6e..2e22886 100644 (file)
 # $ 
 
 
-set testfile "killed"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 
-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
 }
 
 
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 
 gdb_run_cmd
 gdb_expect {
index d4b8c1f..140b025 100644 (file)
 
 # Exit of the thread group leader should not break GDB.
 
-set testfile "leader-exit"
-set srcfile ${testfile}.c
+standard_testfile
 set executable ${testfile}
-set binfile ${objdir}/${subdir}/${executable}
 
 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
     return -1
index d74cded..38f78ef 100644 (file)
@@ -39,16 +39,12 @@ if ![istarget *-*-linux-gnu*] then {
     return
 }
 
-set testfile "linux-dp"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != ""} {
     return -1
 }
 
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 gdb_test_no_output "set print sevenbit-strings"
 runto_main
 
index a8897a5..942922f 100644 (file)
@@ -23,19 +23,14 @@ if {[skip_hw_watchpoint_multi_tests]} {
     return 0
 }
 
-set testfile "local-watch-wrong-thread"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 if {[gdb_compile_pthreads \
         "${srcdir}/${subdir}/${srcfile}" \
         "${binfile}" executable {debug} ] != "" } {
     return -1
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 
 gdb_test_no_output "set can-use-hw-watchpoints 1" ""
 
index 42333e6..c863ee1 100644 (file)
 # This file was written by Jeff Johnston. (jjohnstn@redhat.com)
 
 
-set testfile "manythreads"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 
-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
 }
 
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 gdb_test_no_output "set print sevenbit-strings"
 runto_main
 
index ed5cb30..7d1f3ea 100644 (file)
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-set testfile "multi-create"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 
 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
         executable {debug}] != "" } {
     return -1
 }
 
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 runto_main
 
 # Run to the beginning of create_function several times.  Make sure
index 86c9259..22efc36 100644 (file)
 # Exit of a thread when there are other threads in the inferior should
 # not hang GDB.
 
-set testfile "no-unwaited-for-left"
-set srcfile ${testfile}.c
+standard_testfile
 set executable ${testfile}
-set binfile ${objdir}/${subdir}/${executable}
 
 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
     return -1
index 8dc9bf4..2d0b802 100644 (file)
@@ -21,10 +21,8 @@ if { [is_remote target] } then {
     continue
 }
 
-set testfile "non-ldr-exc-1"
-set srcfile ${testfile}.c
+standard_testfile
 set executable ${testfile}
-set binfile ${objdir}/${subdir}/${executable}
 
 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
     return -1
index 2d49773..476e48e 100644 (file)
@@ -22,10 +22,8 @@ if { [is_remote target] } then {
     continue
 }
 
-set testfile "non-ldr-exc-2"
-set srcfile ${testfile}.c
+standard_testfile
 set executable ${testfile}
-set binfile ${objdir}/${subdir}/${executable}
 
 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
     return -1
index 7d6841d..9d674a6 100644 (file)
@@ -24,10 +24,8 @@ if { [is_remote target] } then {
     continue
 }
 
-set testfile "non-ldr-exc-3"
-set srcfile ${testfile}.c
+standard_testfile
 set executable ${testfile}
-set binfile ${objdir}/${subdir}/${executable}
 
 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
     return -1
index aecf107..7543e20 100644 (file)
@@ -23,10 +23,8 @@ if { [is_remote target] } then {
     continue
 }
 
-set testfile "non-ldr-exc-4"
-set srcfile ${testfile}.c
+standard_testfile
 set executable ${testfile}
-set binfile ${objdir}/${subdir}/${executable}
 
 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
     return -1
index eb052cd..b5987dd 100644 (file)
 #    continued in step 5).  Neither does this SIGTRAP correspond to a
 #    breakpoint hit.  GDB reports to the user a spurious SIGTRAP.
 
-set testfile "pending-step"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 
-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
 }
 
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 
 if ![runto_main] then {
     fail "Can't run to main"
index b5a99fe..8336e29 100644 (file)
 # handling for thread exit.
 
 
-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"
index fc2942e..bf8730b 100644 (file)
 # This file verifies that GDB is able to compute a backtrace for a thread
 # being blocked on a call to pthread_cond_wait(). 
 
-set testfile "pthread_cond_wait"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 
-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
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 runto_main
 
 gdb_test "break break_me" \
index e216993..14aa410 100644 (file)
@@ -17,9 +17,7 @@
 # This file was written by Fred Fish. (fnf@cygnus.com)
 
 
-set testfile "pthreads"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 
 # regexp for "horizontal" text (i.e. doesn't include newline or
 # carriage return)
@@ -31,17 +29,11 @@ if [istarget "*-*-linux"] then {
     set target_cflags ""
 }
 
-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
 }
 
-
-# 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"
index 522559c..2d0552a 100644 (file)
 # This test covers the various forms of "set scheduler-locking".
 
 
-set testfile "schedlock"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 
 # The number of threads, including the main thread.
 set NUM 2
 
-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
 }
 
index d3b4918..7e9fb06 100644 (file)
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-set testfile sigthread
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 
 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
         executable { debug }] != "" } {
     return -1
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 
 if ![runto_main] then {
    fail "Can't run to main"
index a073d55..d26f3e8 100644 (file)
 # Hat.
 
 
-set testfile "staticthreads"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 set static_flag "-static"
 
 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
         executable \
-        [list debug "incdir=${objdir}" "additional_flags=${static_flag}" \
+        [list debug "additional_flags=${static_flag}" \
             ]] != "" } {
     return -1
 }
 
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 gdb_test_no_output "set print sevenbit-strings"
 
 
index 1561e5b..c0ccb58 100644 (file)
 # TODO: we should also test explicitly changing threads with the "thread"
 # command.
 
-set testfile "switch-threads"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 
-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
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 
 runto_main
 
index 3886846..449e303 100644 (file)
@@ -21,21 +21,14 @@ if { [is_remote target] } {
     return 0
 }
 
-set testfile "thread-execl"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 
 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
-        executable [list debug "incdir=${objdir}"]] != "" } {
+        executable debug] != "" } {
     return -1
 }
 
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 
 runto_main
 
index f39886c..42932ff 100644 (file)
 # Please email any bugs, comments, and/or additions to this file to:
 # bug-gdb@gnu.org
 
-set testfile "linux-dp"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile linux-dp.c
 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != ""} {
     return -1
 }
 
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 gdb_test_no_output "set print sevenbit-strings"
 runto_main
 
index 6e22dde..e41f12f 100644 (file)
 # thread-specific breakpoint inserted for several threads.
 
 
-set testfile "thread-specific"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 
-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
 }
 
@@ -63,13 +61,7 @@ proc get_thread_list { } {
   return $thr_list
 }
 
-# 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 width 0"
index bacbe4c..cb90479 100644 (file)
 
 set NR_THREADS 4
 
-set testfile "interrupted-hand-call"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile interrupted-hand-call.c
 
-if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}" "additional_flags=-DNR_THREADS=$NR_THREADS"]] != "" } {
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "additional_flags=-DNR_THREADS=$NR_THREADS"]] != "" } {
     return -1
 }
 
@@ -34,10 +32,7 @@ if [target_info exists gdb,cannot_call_functions] {
     continue
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 
 if { ![runto_main] } {
     fail "Can't run to main"
index 1a4526d..8d94046 100644 (file)
 # - exit gdb.
 
 
-set testfile "thread_check"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 
-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
 }
 
 
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 
 if ![runto_main] then {
    fail "Can't run to main"
index 2b69eb8..61bf69d 100644 (file)
@@ -34,11 +34,9 @@ if [is_remote target] then {
 }
 
 
-set testfile "thread_events"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 
-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
 }
 
index a46ceeb..1ec1a3a 100644 (file)
 # and will continue for each thread even though an error may occur in
 # backtracing one of the threads.
 
-set testfile "threadapply"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}"]] != "" } {
+standard_testfile
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable debug] != "" } {
     return -1
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 
 #
 # Run to `main' where we begin our tests.
index 315dabc..4985d45 100644 (file)
 # Test that GDB doesn't get stuck when thread hoping over a thread
 # specific breakpoint when the selected thread has gone away.
 
-set testfile "threxit-hop-specific"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 
 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
-        executable [list debug "incdir=${objdir}"]] != "" } {
+        executable debug] != "" } {
     return -1
 }
 
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-
-gdb_load ${binfile}
+clean_restart ${binfile}
 
 runto_main
 
index 40709f2..186a9da 100644 (file)
@@ -14,9 +14,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-set testfile tls-nodebug
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 
 if [istarget "*-*-linux"] then {
     set target_cflags "-D_MIT_POSIX_THREADS"
@@ -28,11 +26,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab
     return -1
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-
-gdb_load ${binfile}
+clean_restart ${binfile}
 if ![runto_main] then {
    fail "Can't run to main"
    return 0
index c0538d3..e659d51 100644 (file)
 # tls-shared.exp -- Expect script to test thread local storage in gdb, with
 # shared libraries.
 
-set testfile tls-main
+standard_testfile tls-main.c
 set libfile tls-shared
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
 set srcfile_lib ${libfile}.c
-set binfile_lib ${objdir}/${subdir}/${libfile}.so
+set binfile_lib [standard_output_file ${libfile}.so]
 
 remote_exec build "rm -f ${binfile}"
 
@@ -37,10 +35,7 @@ if { [gdb_compile_shlib_pthreads ${srcdir}/${subdir}/${srcfile_lib} ${binfile_li
 }
 
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 gdb_load_shlibs ${binfile_lib}
 
 if ![runto_main] then {
@@ -53,7 +48,7 @@ gdb_test "print i_tls" "2" "print thread local storage variable"
 gdb_test "ptype i_tls" "int" "ptype of thread local storage variable"
 
 gdb_test "info address i_tls" \
-       "Symbol \\\"i_tls\\\" is a thread-local variable at offset 0x0 in the thread-local storage for .*tls-main.." \
+       "Symbol \\\"i_tls\\\" is a thread-local variable at offset 0x0 in the thread-local storage for .*tls-shared.." \
        "print storage info for thread local storage variable"
 
 set line_number [gdb_get_line_number "break here to check result"]
index 0054049..fdc267a 100644 (file)
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-set testfile tls-var
-set srcfile ${testfile}.c
+standard_testfile
 set srcmainfile ${testfile}-main.c
-set objfile ${objdir}/${subdir}/${testfile}.o
-set objmainfile ${objdir}/${subdir}/${testfile}-main.o
+set objfile [standard_output_file ${testfile}.o]
+set objmainfile [standard_output_file ${testfile}-main.o]
 set executable ${testfile}
-set binfile ${objdir}/${subdir}/${executable}
 
 if { [gdb_compile ${srcdir}/${subdir}/${srcfile} ${objfile} object {debug}] != ""
      || [gdb_compile ${srcdir}/${subdir}/${srcmainfile} ${objmainfile} object {}] != ""
index 411b24b..62ef4ef 100644 (file)
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-set testfile tls
-set testfile2 tls2
-set srcfile ${testfile}.c
-set srcfile2 ${testfile2}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile tls.c tls2.c
 
 if [istarget "*-*-linux"] then {
     set target_cflags "-D_MIT_POSIX_THREADS"
@@ -26,7 +22,7 @@ if [istarget "*-*-linux"] then {
     set target_cflags ""
 }
 
-if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile} ${srcdir}/${subdir}/${srcfile2}" "${binfile}" executable [list c++ debug "incdir=${objdir}"]] != "" } {
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile} ${srcdir}/${subdir}/${srcfile2}" "${binfile}" executable [list c++ debug]] != "" } {
     return -1
 }
 
@@ -142,11 +138,7 @@ proc check_thread_stack {number spin_threads spin_threads_level} {
     }
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-
-gdb_load ${binfile}
+clean_restart ${binfile}
 if ![runto_main] then {
    fail "Can't run to main"
    return 0
index 09563a5..f6f1567 100644 (file)
@@ -23,7 +23,7 @@ if [is_remote target] {
 }
 
 proc test {type symbol} { with_test_prefix "$type" {
-    global testfile objdir subdir srcdir gdb_prompt
+    global testfile subdir srcdir gdb_prompt
 
     set srcfile_type ${srcdir}/${subdir}/${testfile}-${type}.c
 
@@ -31,11 +31,13 @@ proc test {type symbol} { with_test_prefix "$type" {
 
     with_test_prefix "singlethreaded" {
        set executable ${testfile}-${type}-st
-       set srcfile_main ${srcdir}/${subdir}/${testfile}-st.c
-       if { [gdb_compile "${srcfile_main} ${srcfile_type}" ${objdir}/${subdir}/${executable} executable [list debug additional_flags=-D$symbol]] != "" } {
-           untested ${testfile}.exp
-           return
+       set srcfile_main ${testfile}-st.c
+       if {[build_executable $testfile.exp $executable \
+                [list $srcfile_main ${testfile}-${type}.c] \
+                [list debug additional_flags=-D$symbol]] == -1} {
+           return -1
        }
+
        clean_restart $executable
 
        if [target_info exists gdb,no_hardware_watchpoints] {
@@ -90,7 +92,7 @@ proc test {type symbol} { with_test_prefix "$type" {
     with_test_prefix "multithreaded" {
        set executable ${testfile}-${type}-mt
        set srcfile_main ${srcdir}/${subdir}/${testfile}-mt.c
-       if { [gdb_compile_pthreads "${srcfile_main} ${srcfile_type}" ${objdir}/${subdir}/${executable} executable [list debug "additional_flags=-D$symbol -DTHREAD"]] != "" } {
+       if { [gdb_compile_pthreads "${srcfile_main} ${srcfile_type}" [standard_output_file ${executable}] executable [list debug "additional_flags=-D$symbol -DTHREAD"]] != "" } {
            untested ${testfile}.exp
            return
        }
index 5197983..283c4ca 100644 (file)
@@ -31,9 +31,7 @@ if {[skip_hw_watchpoint_access_tests]
     return 0
 }
 
-set testfile "watchthreads-reorder"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" ${binfile} executable [list debug additional_flags=-lrt]] != "" } {
     return -1
 }
index c18505e..b74b291 100644 (file)
@@ -28,10 +28,8 @@ proc target_no_stopped_data { } {
     return [istarget s390*-*-*]
 }
 
-set testfile "watchthreads"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}"]] != "" } {
+standard_testfile
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable debug] != "" } {
     return -1
 }
 
index aaa3430..d67b9f0 100644 (file)
@@ -28,17 +28,12 @@ if {[skip_hw_watchpoint_tests]} {
     return 0
 }
 
-set testfile "watchthreads2"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}" "additional_flags=-DNR_THREADS=$NR_THREADS -DX_INCR_COUNT=$X_INCR_COUNT"]] != "" } {
+standard_testfile
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "additional_flags=-DNR_THREADS=$NR_THREADS -DX_INCR_COUNT=$X_INCR_COUNT"]] != "" } {
     return -1
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 
 gdb_test_no_output "set can-use-hw-watchpoints 1" ""