summaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-06-26 18:25:19 +0000
committerTom Tromey <tromey@redhat.com>2012-06-26 18:25:19 +0000
commit497a5eb0393355660ba219e968dd5ef655d081b5 (patch)
tree105e205dfc7e0d749c9b6ae095b03f3fa2c1b7eb /gdb
parent7686c074591882316c738d09af170b43f42f3ffe (diff)
downloadbinutils-gdb-497a5eb0393355660ba219e968dd5ef655d081b5.tar.gz
* gdb.trace/actions.exp: Use standard_testfile.
* gdb.trace/ax.exp: Use standard_testfile. * gdb.trace/backtrace.exp: Use standard_testfile. * gdb.trace/change-loc.exp: Use standard_testfile. * gdb.trace/circ.exp: Use standard_testfile, prepare_for_testing. * gdb.trace/collection.exp: Use standard_testfile, prepare_for_testing. * gdb.trace/deltrace.exp: Use standard_testfile. * gdb.trace/disconnected-tracing.exp: Use standard_testfile. * gdb.trace/ftrace.exp: Use standard_testfile. * gdb.trace/infotrace.exp: Use standard_testfile. * gdb.trace/packetlen.exp: Use standard_testfile. * gdb.trace/passc-dyn.exp: Use standard_testfile. * gdb.trace/passcount.exp: Use standard_testfile. * gdb.trace/pending.exp: Use standard_testfile. * gdb.trace/report.exp: Use standard_testfile. * gdb.trace/save-trace.exp: Use standard_testfile. * gdb.trace/stap-trace.exp: Use standard_testfile. * gdb.trace/status-stop.exp: Use standard_testfile. * gdb.trace/strace.exp: Use standard_testfile. * gdb.trace/tfile.exp: Use standard_testfile. * gdb.trace/tfind.exp: Use standard_testfile. * gdb.trace/trace-break.exp: Use standard_testfile. * gdb.trace/trace-mt.exp: Use standard_testfile. * gdb.trace/tracecmd.exp: Use standard_testfile. * gdb.trace/tspeed.exp: Use standard_testfile. * gdb.trace/tstatus.exp: Use standard_testfile. * gdb.trace/tsv.exp: Use standard_testfile. * gdb.trace/unavailable.exp: Use standard_testfile, prepare_for_testing. * gdb.trace/while-dyn.exp: Use standard_testfile. * gdb.trace/while-stepping.exp: Use standard_testfile.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/ChangeLog35
-rw-r--r--gdb/testsuite/gdb.trace/actions.exp4
-rw-r--r--gdb/testsuite/gdb.trace/ax.exp4
-rw-r--r--gdb/testsuite/gdb.trace/backtrace.exp4
-rw-r--r--gdb/testsuite/gdb.trace/change-loc.exp8
-rw-r--r--gdb/testsuite/gdb.trace/circ.exp15
-rw-r--r--gdb/testsuite/gdb.trace/collection.exp9
-rw-r--r--gdb/testsuite/gdb.trace/deltrace.exp4
-rw-r--r--gdb/testsuite/gdb.trace/disconnected-tracing.exp6
-rw-r--r--gdb/testsuite/gdb.trace/ftrace.exp4
-rw-r--r--gdb/testsuite/gdb.trace/infotrace.exp4
-rw-r--r--gdb/testsuite/gdb.trace/packetlen.exp4
-rw-r--r--gdb/testsuite/gdb.trace/passc-dyn.exp4
-rw-r--r--gdb/testsuite/gdb.trace/passcount.exp4
-rw-r--r--gdb/testsuite/gdb.trace/pending.exp8
-rw-r--r--gdb/testsuite/gdb.trace/report.exp4
-rw-r--r--gdb/testsuite/gdb.trace/save-trace.exp15
-rw-r--r--gdb/testsuite/gdb.trace/stap-trace.exp9
-rw-r--r--gdb/testsuite/gdb.trace/status-stop.exp4
-rw-r--r--gdb/testsuite/gdb.trace/strace.exp4
-rw-r--r--gdb/testsuite/gdb.trace/tfile.exp4
-rw-r--r--gdb/testsuite/gdb.trace/tfind.exp4
-rw-r--r--gdb/testsuite/gdb.trace/trace-break.exp4
-rw-r--r--gdb/testsuite/gdb.trace/trace-mt.exp4
-rw-r--r--gdb/testsuite/gdb.trace/tracecmd.exp4
-rw-r--r--gdb/testsuite/gdb.trace/tspeed.exp4
-rw-r--r--gdb/testsuite/gdb.trace/tstatus.exp4
-rw-r--r--gdb/testsuite/gdb.trace/tsv.exp4
-rw-r--r--gdb/testsuite/gdb.trace/unavailable.exp10
-rw-r--r--gdb/testsuite/gdb.trace/while-dyn.exp6
-rw-r--r--gdb/testsuite/gdb.trace/while-stepping.exp4
31 files changed, 83 insertions, 122 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 5eb76ec8857..02494cfbe7a 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,40 @@
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.
+ * gdb.trace/change-loc.exp: Use standard_testfile.
+ * gdb.trace/circ.exp: Use standard_testfile, prepare_for_testing.
+ * gdb.trace/collection.exp: Use standard_testfile,
+ prepare_for_testing.
+ * gdb.trace/deltrace.exp: Use standard_testfile.
+ * gdb.trace/disconnected-tracing.exp: Use standard_testfile.
+ * gdb.trace/ftrace.exp: Use standard_testfile.
+ * gdb.trace/infotrace.exp: Use standard_testfile.
+ * gdb.trace/packetlen.exp: Use standard_testfile.
+ * gdb.trace/passc-dyn.exp: Use standard_testfile.
+ * gdb.trace/passcount.exp: Use standard_testfile.
+ * gdb.trace/pending.exp: Use standard_testfile.
+ * gdb.trace/report.exp: Use standard_testfile.
+ * gdb.trace/save-trace.exp: Use standard_testfile.
+ * gdb.trace/stap-trace.exp: Use standard_testfile.
+ * gdb.trace/status-stop.exp: Use standard_testfile.
+ * gdb.trace/strace.exp: Use standard_testfile.
+ * gdb.trace/tfile.exp: Use standard_testfile.
+ * gdb.trace/tfind.exp: Use standard_testfile.
+ * gdb.trace/trace-break.exp: Use standard_testfile.
+ * gdb.trace/trace-mt.exp: Use standard_testfile.
+ * gdb.trace/tracecmd.exp: Use standard_testfile.
+ * gdb.trace/tspeed.exp: Use standard_testfile.
+ * gdb.trace/tstatus.exp: Use standard_testfile.
+ * gdb.trace/tsv.exp: Use standard_testfile.
+ * gdb.trace/unavailable.exp: Use standard_testfile,
+ prepare_for_testing.
+ * gdb.trace/while-dyn.exp: Use standard_testfile.
+ * gdb.trace/while-stepping.exp: Use standard_testfile.
+
+2012-06-26 Tom Tromey <tromey@redhat.com>
+
* gdb.reverse/break-precsave.exp: Use standard_testfile.
* gdb.reverse/break-reverse.exp: Use standard_testfile.
* gdb.reverse/consecutive-precsave.exp: Use standard_testfile.
diff --git a/gdb/testsuite/gdb.trace/actions.exp b/gdb/testsuite/gdb.trace/actions.exp
index 18c778a83f7..4400dbc0126 100644
--- a/gdb/testsuite/gdb.trace/actions.exp
+++ b/gdb/testsuite/gdb.trace/actions.exp
@@ -21,9 +21,7 @@ load_lib "trace-support.exp";
gdb_exit
gdb_start
-set testfile "actions"
-set srcfile ${testfile}.c
-set binfile $objdir/$subdir/actions
+standard_testfile
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
executable {debug nowarnings}] != "" } {
untested actions.exp
diff --git a/gdb/testsuite/gdb.trace/ax.exp b/gdb/testsuite/gdb.trace/ax.exp
index aa25f6cd419..9940a5e5c07 100644
--- a/gdb/testsuite/gdb.trace/ax.exp
+++ b/gdb/testsuite/gdb.trace/ax.exp
@@ -23,9 +23,7 @@ load_lib "trace-support.exp";
gdb_exit
gdb_start
-set testfile "actions"
-set srcfile ${testfile}.c
-set binfile $objdir/$subdir/ax
+standard_testfile actions.c
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
executable {debug nowarnings}] != "" } {
untested ax.exp
diff --git a/gdb/testsuite/gdb.trace/backtrace.exp b/gdb/testsuite/gdb.trace/backtrace.exp
index 7d978930bbe..5093266bd04 100644
--- a/gdb/testsuite/gdb.trace/backtrace.exp
+++ b/gdb/testsuite/gdb.trace/backtrace.exp
@@ -21,9 +21,7 @@ load_lib "trace-support.exp";
gdb_exit
gdb_start
-set testfile "actions"
-set srcfile ${testfile}.c
-set binfile $objdir/$subdir/backtrace
+standard_testfile actions.c
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
executable {debug nowarnings}] != "" } {
untested backtrace.exp
diff --git a/gdb/testsuite/gdb.trace/change-loc.exp b/gdb/testsuite/gdb.trace/change-loc.exp
index c881ae79291..0064b6ffc3f 100644
--- a/gdb/testsuite/gdb.trace/change-loc.exp
+++ b/gdb/testsuite/gdb.trace/change-loc.exp
@@ -18,16 +18,14 @@ if {[skip_shlib_tests]} {
return 0
}
-set testfile "change-loc"
+standard_testfile
set libfile1 "change-loc-1"
set libfile2 "change-loc-2"
-set srcfile $testfile.c
set executable $testfile
set libsrc1 $srcdir/$subdir/$libfile1.c
set libsrc2 $srcdir/$subdir/$libfile2.c
-set binfile $objdir/$subdir/$testfile
-set lib_sl1 $objdir/$subdir/$libfile1.sl
-set lib_sl2 $objdir/$subdir/$libfile2.sl
+set lib_sl1 [standard_output_file $libfile1.sl]
+set lib_sl2 [standard_output_file $libfile2.sl]
set lib_opts debug
diff --git a/gdb/testsuite/gdb.trace/circ.exp b/gdb/testsuite/gdb.trace/circ.exp
index 67b4389c6a8..83000822483 100644
--- a/gdb/testsuite/gdb.trace/circ.exp
+++ b/gdb/testsuite/gdb.trace/circ.exp
@@ -16,13 +16,9 @@
load_lib "trace-support.exp"
-set testfile "circ"
-set srcfile ${testfile}.c
-set binfile $objdir/$subdir/$testfile
+standard_testfile
-if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
- executable {debug nowarnings}] != "" } {
- untested circ.exp
+if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug nowarnings}]} {
return -1
}
@@ -200,13 +196,6 @@ proc gdb_trace_circular_tests { } {
return 0;
}
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load $binfile
-
gdb_test_no_output "set circular-trace-buffer on" \
"set circular-trace-buffer on"
diff --git a/gdb/testsuite/gdb.trace/collection.exp b/gdb/testsuite/gdb.trace/collection.exp
index 9beb9afba2c..25544b54639 100644
--- a/gdb/testsuite/gdb.trace/collection.exp
+++ b/gdb/testsuite/gdb.trace/collection.exp
@@ -16,14 +16,10 @@
load_lib "trace-support.exp"
-set testfile "collection"
-set srcfile ${testfile}.c
+standard_testfile
set executable $testfile
-set binfile $objdir/$subdir/$executable
-if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
- executable {debug nowarnings}] != "" } {
- untested collection.exp
+if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug nowarnings}]} {
return -1
}
@@ -776,7 +772,6 @@ proc gdb_trace_collection_test {} {
}
-clean_restart $executable
runto_main
if { ![gdb_target_supports_trace] } then {
diff --git a/gdb/testsuite/gdb.trace/deltrace.exp b/gdb/testsuite/gdb.trace/deltrace.exp
index 6baf1d2ab95..2423de23018 100644
--- a/gdb/testsuite/gdb.trace/deltrace.exp
+++ b/gdb/testsuite/gdb.trace/deltrace.exp
@@ -21,9 +21,7 @@ load_lib "trace-support.exp";
gdb_exit
gdb_start
-set testfile "actions"
-set srcfile ${testfile}.c
-set binfile $objdir/$subdir/deltrace
+standard_testfile actions.c
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
executable {debug nowarnings}] != "" } {
untested deltrace.exp
diff --git a/gdb/testsuite/gdb.trace/disconnected-tracing.exp b/gdb/testsuite/gdb.trace/disconnected-tracing.exp
index 9c35b76b7ee..64ce2744a8b 100644
--- a/gdb/testsuite/gdb.trace/disconnected-tracing.exp
+++ b/gdb/testsuite/gdb.trace/disconnected-tracing.exp
@@ -17,10 +17,8 @@
load_lib "trace-support.exp";
-set testfile "disconnected-tracing"
-set executable $testfile
-set srcfile ${testfile}.c
-set binfile $objdir/$subdir/$testfile
+standard_testfile
+set executabel $testfile
set expfile $testfile.exp
set gdbserver_reconnect_p 1
diff --git a/gdb/testsuite/gdb.trace/ftrace.exp b/gdb/testsuite/gdb.trace/ftrace.exp
index 634d77b21c5..56cd2fac27a 100644
--- a/gdb/testsuite/gdb.trace/ftrace.exp
+++ b/gdb/testsuite/gdb.trace/ftrace.exp
@@ -14,10 +14,8 @@
load_lib "trace-support.exp";
-set testfile "ftrace"
+standard_testfile
set executable $testfile
-set srcfile $testfile.c
-set binfile $objdir/$subdir/$testfile
set expfile $testfile.exp
# Some targets have leading underscores on assembly symbols.
diff --git a/gdb/testsuite/gdb.trace/infotrace.exp b/gdb/testsuite/gdb.trace/infotrace.exp
index 5a99d16e28e..bdc383046c0 100644
--- a/gdb/testsuite/gdb.trace/infotrace.exp
+++ b/gdb/testsuite/gdb.trace/infotrace.exp
@@ -21,9 +21,7 @@ load_lib "trace-support.exp";
gdb_exit
gdb_start
-set testfile "actions"
-set srcfile ${testfile}.c
-set binfile $objdir/$subdir/infotrace
+standard_testfile actions.c
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
executable {debug nowarnings}] != "" } {
untested infotrace.exp
diff --git a/gdb/testsuite/gdb.trace/packetlen.exp b/gdb/testsuite/gdb.trace/packetlen.exp
index 4ce13e660f0..81f3d7d0a1b 100644
--- a/gdb/testsuite/gdb.trace/packetlen.exp
+++ b/gdb/testsuite/gdb.trace/packetlen.exp
@@ -21,9 +21,7 @@ load_lib "trace-support.exp"
gdb_exit
gdb_start
-set testfile "actions"
-set srcfile ${testfile}.c
-set binfile $objdir/$subdir/packetlen
+standard_testfile actions.c
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
executable {debug nowarnings}] != "" } {
untested packetlen.exp
diff --git a/gdb/testsuite/gdb.trace/passc-dyn.exp b/gdb/testsuite/gdb.trace/passc-dyn.exp
index 718a4da6bb0..0e6465b2ec3 100644
--- a/gdb/testsuite/gdb.trace/passc-dyn.exp
+++ b/gdb/testsuite/gdb.trace/passc-dyn.exp
@@ -20,9 +20,7 @@ load_lib "trace-support.exp";
gdb_exit
gdb_start
-set testfile "actions"
-set srcfile ${testfile}.c
-set binfile $objdir/$subdir/passc-dyn
+standard_testfile actions.c
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
executable {debug nowarnings}] != "" } {
untested passc-dyn.exp
diff --git a/gdb/testsuite/gdb.trace/passcount.exp b/gdb/testsuite/gdb.trace/passcount.exp
index a56c84662dd..42f767a2668 100644
--- a/gdb/testsuite/gdb.trace/passcount.exp
+++ b/gdb/testsuite/gdb.trace/passcount.exp
@@ -20,9 +20,7 @@ load_lib "trace-support.exp";
gdb_exit
gdb_start
-set testfile "actions"
-set srcfile ${testfile}.c
-set binfile $objdir/$subdir/passcount
+standard_testfile actions.c
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
executable {debug nowarnings}] != "" } {
untested passcount.exp
diff --git a/gdb/testsuite/gdb.trace/pending.exp b/gdb/testsuite/gdb.trace/pending.exp
index 018ded2bc45..750c0317c16 100644
--- a/gdb/testsuite/gdb.trace/pending.exp
+++ b/gdb/testsuite/gdb.trace/pending.exp
@@ -18,16 +18,14 @@ if {[skip_shlib_tests]} {
return 0
}
-set testfile "pending"
+standard_testfile
set libfile1 "pendshr1"
set libfile2 "pendshr2"
set executable $testfile
-set srcfile $testfile.c
set libsrc1 $srcdir/$subdir/$libfile1.c
set libsrc2 $srcdir/$subdir/$libfile2.c
-set binfile $objdir/$subdir/$testfile
-set lib_sl1 $objdir/$subdir/$libfile1.sl
-set lib_sl2 $objdir/$subdir/$libfile2.sl
+set lib_sl1 [standard_output_file $libfile1.sl]
+set lib_sl2 [standard_output_file $libfile2.sl]
set lib_opts [gdb_target_symbol_prefix_flags]
diff --git a/gdb/testsuite/gdb.trace/report.exp b/gdb/testsuite/gdb.trace/report.exp
index 7c08a419b84..7153f07800c 100644
--- a/gdb/testsuite/gdb.trace/report.exp
+++ b/gdb/testsuite/gdb.trace/report.exp
@@ -21,9 +21,7 @@ load_lib "trace-support.exp";
gdb_exit
gdb_start
-set testfile "actions"
-set srcfile ${testfile}.c
-set binfile $objdir/$subdir/report
+standard_testfile actions.c
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
executable {debug nowarnings}] != "" } {
untested report.exp
diff --git a/gdb/testsuite/gdb.trace/save-trace.exp b/gdb/testsuite/gdb.trace/save-trace.exp
index e5cada7b125..2a9061a089b 100644
--- a/gdb/testsuite/gdb.trace/save-trace.exp
+++ b/gdb/testsuite/gdb.trace/save-trace.exp
@@ -21,9 +21,7 @@ load_lib "trace-support.exp";
gdb_exit
gdb_start
-set testfile "actions"
-set srcfile ${testfile}.c
-set binfile $objdir/$subdir/save-trace
+standard_testfile actions.c
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
executable {debug nowarnings}] != "" } {
untested save-trace.exp
@@ -136,20 +134,21 @@ remote_file host delete savetrace.tr
# 10.3 repeat with a path to the file
-set escapedfilename [string_to_regexp $objdir/savetrace.tr]
-remote_file host delete $objdir/savetrace.tr
-gdb_test "save-tracepoints $objdir/savetrace.tr" \
+set trace_file_name [standard_output_file savetrace.tr]
+set escapedfilename [string_to_regexp $trace_file_name]
+remote_file host delete $trace_file_name
+gdb_test "save-tracepoints $trace_file_name" \
"Saved to file '${escapedfilename}'." \
"10.3: save tracepoint definitions, full path"
gdb_delete_tracepoints
gdb_test_no_output "set default-collect" "10.3: clear default-collect"
gdb_test "info tracepoints" "No tracepoints." "10.3: delete tracepoints"
-gdb_test "source $objdir/savetrace.tr" \
+gdb_test "source $trace_file_name" \
"Tracepoint \[0-9\]+ at .*" \
"10.4: read saved tracepoints, full path"
gdb_verify_tracepoints "10.3: verify recovered tracepoints, full path";
-remote_file host delete $objdir/savetrace.tr
+remote_file host delete $trace_file_name
# 10.5 invalid filename
# [deferred -- not sure what a good invalid filename would be]
diff --git a/gdb/testsuite/gdb.trace/stap-trace.exp b/gdb/testsuite/gdb.trace/stap-trace.exp
index abc5af4a19f..39db64ba6be 100644
--- a/gdb/testsuite/gdb.trace/stap-trace.exp
+++ b/gdb/testsuite/gdb.trace/stap-trace.exp
@@ -15,10 +15,8 @@
load_lib "trace-support.exp"
-set testfile "stap-trace"
-set srcfile ${testfile}.c
+standard_testfile
set executable ""
-set binfile_dir $objdir/$subdir
set ws "\[\r\n\t \]+"
set cr "\[\r\n\]+"
@@ -31,7 +29,6 @@ if { ![istarget "x86_64-*"] && ![istarget "i?86-*"] } {
proc compile_stap_bin {exec_name {arg ""}} {
global srcfile
- global binfile_dir
global srcdir
global subdir
global executable
@@ -43,8 +40,8 @@ proc compile_stap_bin {exec_name {arg ""}} {
set executable ${exec_name}
if { [gdb_compile "$srcdir/$subdir/$srcfile" \
- "$binfile_dir/$exec_name" \
- executable [concat $arg debug nowarnings]] != "" } {
+ [standard_output_file $exec_name] \
+ executable [concat $arg debug nowarnings]] != "" } {
untested "Could not compile ${srcfile}"
return 0
}
diff --git a/gdb/testsuite/gdb.trace/status-stop.exp b/gdb/testsuite/gdb.trace/status-stop.exp
index 9c2320ef2c2..61afdd5936d 100644
--- a/gdb/testsuite/gdb.trace/status-stop.exp
+++ b/gdb/testsuite/gdb.trace/status-stop.exp
@@ -14,10 +14,8 @@
load_lib "trace-support.exp";
-set testfile "status-stop"
+standard_testfile
set executable $testfile
-set srcfile ${testfile}.c
-set binfile $objdir/$subdir/$testfile
set expfile $testfile.exp
diff --git a/gdb/testsuite/gdb.trace/strace.exp b/gdb/testsuite/gdb.trace/strace.exp
index b79fd9c5c7f..d9e90b6efd8 100644
--- a/gdb/testsuite/gdb.trace/strace.exp
+++ b/gdb/testsuite/gdb.trace/strace.exp
@@ -18,9 +18,7 @@ if {[skip_shlib_tests]} {
return 0
}
-set testfile "strace"
-set srcfile $testfile.c
-set binfile $objdir/$subdir/$testfile
+standard_testfile
set executable $testfile
set libipa [get_in_proc_agent]
diff --git a/gdb/testsuite/gdb.trace/tfile.exp b/gdb/testsuite/gdb.trace/tfile.exp
index 391dfbb965f..a2c5c1d4ea3 100644
--- a/gdb/testsuite/gdb.trace/tfile.exp
+++ b/gdb/testsuite/gdb.trace/tfile.exp
@@ -30,9 +30,7 @@ if [target_info exists gdb,nofileio] {
gdb_exit
gdb_start
-set testfile "tfile"
-set srcfile ${testfile}.c
-set binfile $objdir/$subdir/$testfile
+standard_testfile
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
executable {debug nowarnings}] != "" } {
untested ${testfile}.exp
diff --git a/gdb/testsuite/gdb.trace/tfind.exp b/gdb/testsuite/gdb.trace/tfind.exp
index d025f39cba5..cce742ecfe8 100644
--- a/gdb/testsuite/gdb.trace/tfind.exp
+++ b/gdb/testsuite/gdb.trace/tfind.exp
@@ -21,9 +21,7 @@ load_lib "trace-support.exp";
gdb_exit
gdb_start
-set testfile "actions"
-set srcfile ${testfile}.c
-set binfile $objdir/$subdir/tfind
+standard_testfile actions.c
if { [gdb_compile "$srcdir/$subdir/$srcfile" "$binfile" \
executable {debug nowarnings}] != "" } {
diff --git a/gdb/testsuite/gdb.trace/trace-break.exp b/gdb/testsuite/gdb.trace/trace-break.exp
index 2d19511450a..d75e2bc0ac8 100644
--- a/gdb/testsuite/gdb.trace/trace-break.exp
+++ b/gdb/testsuite/gdb.trace/trace-break.exp
@@ -14,10 +14,8 @@
load_lib "trace-support.exp";
-set testfile "trace-break"
+standard_testfile
set executable $testfile
-set srcfile $testfile.c
-set binfile $objdir/$subdir/$testfile
set expfile $testfile.exp
# Some targets have leading underscores on assembly symbols.
diff --git a/gdb/testsuite/gdb.trace/trace-mt.exp b/gdb/testsuite/gdb.trace/trace-mt.exp
index d6b619cd684..58990acb73e 100644
--- a/gdb/testsuite/gdb.trace/trace-mt.exp
+++ b/gdb/testsuite/gdb.trace/trace-mt.exp
@@ -14,10 +14,8 @@
load_lib "trace-support.exp";
-set testfile "trace-mt"
+standard_testfile
set executable $testfile
-set srcfile $testfile.c
-set binfile $objdir/$subdir/$testfile
set expfile $testfile.exp
# Some targets have leading underscores on assembly symbols.
diff --git a/gdb/testsuite/gdb.trace/tracecmd.exp b/gdb/testsuite/gdb.trace/tracecmd.exp
index 15811664f6a..b4fc3e2c02d 100644
--- a/gdb/testsuite/gdb.trace/tracecmd.exp
+++ b/gdb/testsuite/gdb.trace/tracecmd.exp
@@ -20,9 +20,7 @@ load_lib "trace-support.exp";
gdb_exit
gdb_start
-set testfile "actions"
-set srcfile ${testfile}.c
-set binfile $objdir/$subdir/tracecmd
+standard_testfile actions.c
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
executable {debug nowarnings}] != "" } {
untested tracecmd.exp
diff --git a/gdb/testsuite/gdb.trace/tspeed.exp b/gdb/testsuite/gdb.trace/tspeed.exp
index 5f7f36dccee..653b119c72c 100644
--- a/gdb/testsuite/gdb.trace/tspeed.exp
+++ b/gdb/testsuite/gdb.trace/tspeed.exp
@@ -15,10 +15,8 @@
load_lib "trace-support.exp"
-set testfile "tspeed"
-set srcfile ${testfile}.c
+standard_testfile
set executable $testfile
-set binfile $objdir/$subdir/$executable
set ipalib [get_in_proc_agent]
diff --git a/gdb/testsuite/gdb.trace/tstatus.exp b/gdb/testsuite/gdb.trace/tstatus.exp
index 5c4055b1fc9..fdeb0dd5c89 100644
--- a/gdb/testsuite/gdb.trace/tstatus.exp
+++ b/gdb/testsuite/gdb.trace/tstatus.exp
@@ -14,10 +14,8 @@
load_lib "trace-support.exp"
-set testfile "actions"
+standard_testfile actions.c
set executable $testfile
-set srcfile $testfile.c
-set binfile $objdir/$subdir/$testfile
set expfile tstatus.exp
if [prepare_for_testing $expfile $executable $srcfile \
diff --git a/gdb/testsuite/gdb.trace/tsv.exp b/gdb/testsuite/gdb.trace/tsv.exp
index b8af4d63b6a..ce95835b762 100644
--- a/gdb/testsuite/gdb.trace/tsv.exp
+++ b/gdb/testsuite/gdb.trace/tsv.exp
@@ -18,9 +18,7 @@ load_lib "trace-support.exp";
gdb_exit
gdb_start
-set testfile "actions"
-set srcfile ${testfile}.c
-set binfile $objdir/$subdir/tsv
+standard_testfile actions.c
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
executable {debug nowarnings}] != "" } {
untested tsv.exp
diff --git a/gdb/testsuite/gdb.trace/unavailable.exp b/gdb/testsuite/gdb.trace/unavailable.exp
index 60bb41b7fc7..1fb75ebb3a0 100644
--- a/gdb/testsuite/gdb.trace/unavailable.exp
+++ b/gdb/testsuite/gdb.trace/unavailable.exp
@@ -15,14 +15,11 @@
load_lib "trace-support.exp"
-set testfile "unavailable"
-set srcfile ${testfile}.cc
+standard_testfile unavailable.cc
set executable $testfile
-set binfile $objdir/$subdir/$executable
-if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
- executable {debug nowarnings c++}] != "" } {
- untested unavailable.exp
+if {[prepare_for_testing $testfile.exp $testfile $srcfile \
+ {debug nowarnings c++}]} {
return -1
}
@@ -588,7 +585,6 @@ proc gdb_trace_collection_test {} {
gdb_collect_locals_test statlocal_test_func "static locals"
}
-clean_restart $executable
runto_main
if { ![gdb_target_supports_trace] } then {
diff --git a/gdb/testsuite/gdb.trace/while-dyn.exp b/gdb/testsuite/gdb.trace/while-dyn.exp
index 3e8aa2da86d..7281a81f59f 100644
--- a/gdb/testsuite/gdb.trace/while-dyn.exp
+++ b/gdb/testsuite/gdb.trace/while-dyn.exp
@@ -21,10 +21,8 @@ load_lib "trace-support.exp"
gdb_exit
gdb_start
-set testfile "actions"
-set srcfile $testfile.c
-set executable while-dyn
-set binfile $objdir/$subdir/$executable
+standard_testfile actions.c
+set executable $testfile
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
executable {debug nowarnings}] != "" } {
untested while-dyn.exp
diff --git a/gdb/testsuite/gdb.trace/while-stepping.exp b/gdb/testsuite/gdb.trace/while-stepping.exp
index 0e53815347c..5d8e0666050 100644
--- a/gdb/testsuite/gdb.trace/while-stepping.exp
+++ b/gdb/testsuite/gdb.trace/while-stepping.exp
@@ -21,9 +21,7 @@ load_lib "trace-support.exp";
gdb_exit
gdb_start
-set testfile "actions"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/while-stepping
+standard_testfile actions.c
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" $binfile \
executable {debug nowarnings}] != "" } {
untested while-stepping.exp