* 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 02494cfbe7a81d076e15368b1ac465cf488d3756..4e73971ba261925cae759c33692f12d5a315ec0e 100644 (file)
@@ -1,3 +1,87 @@
+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.
index f98906b1292de29aadffd71fa19bdc067881bf31..c74fafa4842a343f8d02f1da5b619e577109738c 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 cba19d83f48f1852ecc1b8dce8118d440676b388..f4c05baeadb97b4034e46271478d6485339bc252 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 0ec7054eee0cef916f0188369c66827867ff3c56..7b6182ca6fa422cdd673d485fc8f8e167d17cf88 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 2dd117336bd614f2f5e742e7d97ca6c8371405e2..6700017a1b041508395cf1f04bea915ab4cf59c6 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 4a8fb4d9401fa56eb31164fc811a716a36c0b58a..9b9116a9b0c5232a6f0d507fc2bdc2fd9c916445 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 e94fcbb4b55e51b1aa139f4764569c4acd6d483d..b8c198c16dfd28f23af9e139cf33f86acb0dbef3 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 3c0a4af19a4b3cf9968db6085c50ab5a21336f08..e2b4cc32d6f8760e1e799be2142fc74f41fa40e3 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 dfb231477ae2ab1f6763ee132fd2f7d10d786b1c..a47f931dc9a1bb45d30664882aa56f7490d6f974 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 ba0e74b98da3b60a739e62374bacfad15b6189e6..e179390c8bcb4dfa37f50fed32cf1f311e6f1152 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 e14c6852fda05429f71097b7e4b324a4ed07dba0..a1ae60dcea511e779a0fc6fb98dd0f5cce847ea0 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 926c612a73ba28a1d97499d0b561f772d4c67ad3..7b838afce4b881d7b22e3b2bc1bbd8a6d9f08737 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 fa99e6e9c1b577e2b8df84384d39b504b7534bfa..2e22886a689cdb53f15c8e0d6971255490ded544 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 d4b8c1f30e94b1d8ee7a910a431514b090f61e4e..140b025bd36c3d42e55173ef00f98dba166e059a 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 d74cded8ce31034178e2773f0689ca23d7161b2e..38f78efb6da291bc355c41b73a2254954d8dbd6b 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 a8897a53ea5dad16eb19c33864d9267c04c9d263..942922fc2c66303ebaae9cebb9b521139c4bd35a 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 42333e6b7f0f42a1c2f3e72c7d34fad6a540af88..c863ee19c6e9984a99c2038e4a3a0bb2b01581cd 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 ed5cb301309c83c24969e45da1e7f0e3c5cef5ec..7d1f3eae80b286114e3ce247af62edb8cda1c1c7 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 86c9259b91a1a015247f07e314f217774bc130cc..22efc36cc7f070201f0331df7aeb03d01b8f9db0 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 8dc9bf42905a29cfa95c3965c0215a11316c4370..2d0b802398d06eff86f781446aec7f9b8bd251c1 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 2d49773b9b6fc7b944364f3aa72fb27a88de87c8..476e48e902f7c3911694194a6c84259bf2047b47 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 7d6841dea9f8a355a6bdffeb86a9aa436cf41339..9d674a68e50736fd421f62353eddfba47bd4e5ef 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 aecf10745fb3d760ef9587cd1c074a003a11acf7..7543e20ed936d1f0b989528b77d9d346f6046939 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 eb052cdf7624e7682aaab3f9e698145464b52b17..b5987dd57943cb17018699bd466e2f8b142b2a01 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 b5a99fee0c2ee017290c0ed96956566b889fc8ed..8336e29ae8e5fa95c3be58833bcabee6d861a395 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 fc2942e07a06a3b698c2d482a86e46be2953f36e..bf8730bc3b8d46c1579cb129fb60df2e460c42d5 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 e216993cd5feae8f597f84f1e7ecbd8441849fad..14aa41099bf9a5bc0ca5490fb9898f82274ec3a4 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 522559c1b29b9b8eaf66a9e10ba782ef7341dd1d..2d0552afcb5fa8fdfa3db58d68db443e139ebb92 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 d3b491830f443fd772694649927e932d91f2d908..7e9fb0644e017225efa5d16dc655d1ed8c8fa874 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 a073d556fd20dd824ae6f04fb7930a5ead5024d4..d26f3e8c52d6498d5f1f100bc146f708f9a9439f 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 1561e5b0fef120289226391fb5068264e68cc9de..c0ccb5825e7b14476fa7c84d090b157cf10a2121 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 3886846a61ec51afa09e4065682b93f7d956538e..449e3033ea83d1388fbe64d4984b6bea76b69cb7 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 f39886c0018dbf5ae74a94144d8efc991d4eadd1..42932ffccdaa0977a85b2197ebe022e0616cc28f 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 6e22dded0aaf13443e2635e811447b62deb95b08..e41f12ff26377653ffa73e46358273d393e9648e 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 bacbe4c0f7c70c5d6abc7e70ffb2d81ad2e120e2..cb904793ead57f2be44bde001ad93396823f66a4 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 1a4526d8e24271f1dacfdcae53a4e977802ac0eb..8d94046925b381d324fe29f5a6f6bcd5e5adc82b 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 2b69eb8449d506f9b9eac0509f70cc8be5c3515a..61bf69d2671ad28cef31be545d3693ad525ab685 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 a46ceebc1d21174e196411a41c9515cd24cd18b4..1ec1a3af2cda72302dfa1042fb451b4bd8e1a3c8 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 315dabc27e9774ea2b3db2e1940154aea8563349..4985d455daf96949f3e9eb9d33ae92c42d558432 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 40709f24110870c5e23add7aa367af47c4f6020f..186a9da2f6c667932844de8188ffae6c30ec563d 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 c0538d3beb2c84bb4e1f77ef291706d335a366ba..e659d51aeb15687ec8573a64597d0d4b52e85683 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 00540492194edf1104d5eb74058bc62ee15be769..fdc267a6c18cbf30c203439431c38bf2de7ff3f6 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 411b24bd35c8def6292080bb67c9004a52cd862f..62ef4efe2ea0b5dcdb18a3fc0990dea2620501c3 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 09563a5bb535e0315702e2eaa9682ac72e71f743..f6f1567aa5235a9c70189e2e71cca8da47a76740 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 51979830335cd8c1fb740ca4a7e6ee27eb621f5d..283c4caf1adf6593c4bb7a046616fea40830d28b 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 c18505e394aa5b9d9f61e8a322139bef388f2d0e..b74b291661aa2b8dc5c043d79a3c32fc900a8382 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 aaa3430715d733d052548cb567440084dcf71499..d67b9f094ed2aed8564aa3e941834acc20f87dec 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" ""