aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/testsuite/ChangeLog13
-rw-r--r--gdb/testsuite/gdb.base/call-ar-st.exp30
-rw-r--r--gdb/testsuite/gdb.base/call-rt-st.exp10
-rw-r--r--gdb/testsuite/gdb.base/call-sc.exp7
-rw-r--r--gdb/testsuite/gdb.base/call-signal-resume.exp9
-rw-r--r--gdb/testsuite/gdb.base/call-strs.exp20
-rw-r--r--gdb/testsuite/gdb.base/callexit.exp9
-rw-r--r--gdb/testsuite/gdb.base/callfuncs.exp4
-rw-r--r--gdb/testsuite/gdb.base/catch-load.exp6
-rw-r--r--gdb/testsuite/gdb.base/catch-syscall.exp5
-rw-r--r--gdb/testsuite/gdb.base/charset.exp7
-rw-r--r--gdb/testsuite/gdb.base/checkpoint.exp9
-rw-r--r--gdb/testsuite/gdb.base/chng-syms.exp9
-rw-r--r--gdb/testsuite/gdb.base/code-expr.exp9
-rw-r--r--gdb/testsuite/gdb.base/code_elim.exp4
-rw-r--r--gdb/testsuite/gdb.base/commands.exp40
-rw-r--r--gdb/testsuite/gdb.base/completion.exp30
-rw-r--r--gdb/testsuite/gdb.base/complex.exp22
-rw-r--r--gdb/testsuite/gdb.base/cond-expr.exp10
-rw-r--r--gdb/testsuite/gdb.base/condbreak.exp76
-rw-r--r--gdb/testsuite/gdb.base/consecutive.exp15
-rw-r--r--gdb/testsuite/gdb.base/constvars.exp9
-rw-r--r--gdb/testsuite/gdb.base/corefile.exp21
-rw-r--r--gdb/testsuite/gdb.base/ctxobj.exp6
-rw-r--r--gdb/testsuite/gdb.base/cursal.exp4
-rw-r--r--gdb/testsuite/gdb.base/cvexpr.exp9
-rw-r--r--gdb/testsuite/gdb.base/dbx.exp26
-rw-r--r--gdb/testsuite/gdb.base/default.exp3
-rw-r--r--gdb/testsuite/gdb.base/define.exp26
-rw-r--r--gdb/testsuite/gdb.base/del.exp16
-rw-r--r--gdb/testsuite/gdb.base/detach.exp6
-rw-r--r--gdb/testsuite/gdb.base/dfp-test.exp9
-rw-r--r--gdb/testsuite/gdb.base/display.exp14
-rw-r--r--gdb/testsuite/gdb.base/dmsym.exp8
-rw-r--r--gdb/testsuite/gdb.base/dump.exp4
-rw-r--r--gdb/testsuite/gdb.base/dup-sect.exp4
36 files changed, 172 insertions, 337 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index c022aec..f4d180e 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,18 @@
2013-06-27 Tom Tromey <tromey@redhat.com>
+ * call-ar-st.exp, call-rt-st.exp, call-sc.exp,
+ call-signal-resume.exp, call-strs.exp, callexit.exp,
+ callfuncs.exp, catch-load.exp, catch-syscall.exp, charset.exp,
+ checkpoint.exp, chng-syms.exp, code-expr.exp, code_elim.exp,
+ commands.exp, completion.exp, complex.exp, cond-expr.exp,
+ condbreak.exp, consecutive.exp, constvars.exp, corefile.exp,
+ ctxobj.exp, cursal.exp, cvexpr.exp, dbx.exp, default.exp,
+ define.exp, del.exp, detach.exp, dfp-test.exp, display.exp,
+ dmsym.exp, dump.exp, dup-sect.exp: Use standard_testfile,
+ standard_output_file, prepare_for_testing, clean_restart.
+
+2013-06-27 Tom Tromey <tromey@redhat.com>
+
* a2-run.exp, all-bin.exp, annota1.exp, annota3.exp, anon.exp,
args.exp, arithmet.exp, arrayidx.exp, assign.exp, async-shell.exp,
async.exp, attach-pie-misread.exp, attach-pie-noexec.exp,
diff --git a/gdb/testsuite/gdb.base/call-ar-st.exp b/gdb/testsuite/gdb.base/call-ar-st.exp
index 925d2af..21df59d 100644
--- a/gdb/testsuite/gdb.base/call-ar-st.exp
+++ b/gdb/testsuite/gdb.base/call-ar-st.exp
@@ -17,21 +17,21 @@
-set testfile "call-ar-st"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
# Test depends on printf, which the sparclet stub doesn't support.
if { [istarget "sparclet-*-*"] } {
return 0
}
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
- untested "couldn't compile ${srcdir}/${subdir}/${srcfile}"
- return -1
+# Some targets can't call functions, so don't even bother with this
+# test.
+if [target_info exists gdb,cannot_call_functions] {
+ setup_xfail "*-*-*" 2416
+ fail "This target can not call functions"
+ continue
}
-
# Create and source the file that provides information about the compiler
# used to compile the test case.
@@ -39,23 +39,15 @@ if [get_compiler_info] {
return -1
}
-# Some targets can't call functions, so don't even bother with this
-# test.
-if [target_info exists gdb,cannot_call_functions] {
- setup_xfail "*-*-*" 2416
- fail "This target can not call functions"
- continue
+if {[prepare_for_testing $testfile.exp $testfile $srcfile debug]} {
+ untested $testfile.exp
+ return -1
}
+
set oldtimeout $timeout
set timeout [expr "$timeout + 60"]
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
gdb_test_no_output "set print sevenbit-strings"
gdb_test_no_output "set print address off"
gdb_test_no_output "set width 0"
diff --git a/gdb/testsuite/gdb.base/call-rt-st.exp b/gdb/testsuite/gdb.base/call-rt-st.exp
index d71824c..f01a18f 100644
--- a/gdb/testsuite/gdb.base/call-rt-st.exp
+++ b/gdb/testsuite/gdb.base/call-rt-st.exp
@@ -21,10 +21,7 @@
-set testfile "call-rt-st"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-
+standard_testfile .c
# Test depends on printf, which the sparclet stub doesn't support.
if { [istarget "sparclet-*-*"] } {
@@ -55,10 +52,7 @@ if [target_info exists gdb,cannot_call_functions] {
# 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"
gdb_test_no_output "set width 0"
diff --git a/gdb/testsuite/gdb.base/call-sc.exp b/gdb/testsuite/gdb.base/call-sc.exp
index e62021b..d3bd8ad 100644
--- a/gdb/testsuite/gdb.base/call-sc.exp
+++ b/gdb/testsuite/gdb.base/call-sc.exp
@@ -28,9 +28,7 @@ if [target_info exists gdb,cannot_call_functions] {
continue
}
-set testfile "call-sc"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
# Create and source the file that provides information about the
# compiler used to compile the test case.
@@ -47,7 +45,6 @@ proc start_scalars_test { type } {
global testfile
global srcfile
global binfile
- global objdir
global subdir
global srcdir
global gdb_prompt
@@ -57,7 +54,7 @@ proc start_scalars_test { type } {
set flags "debug additional_flags=-DT=${type}"
set testfile "call-sc-${type}"
- set binfile ${objdir}/${subdir}/${testfile}
+ set binfile [standard_output_file ${testfile}]
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "${flags}"] != "" } {
# built the second test case since we can't use prototypes
warning "Prototypes not supported, rebuilding with -DNO_PROTOTYPES"
diff --git a/gdb/testsuite/gdb.base/call-signal-resume.exp b/gdb/testsuite/gdb.base/call-signal-resume.exp
index b7c4c0b..656e8dc 100644
--- a/gdb/testsuite/gdb.base/call-signal-resume.exp
+++ b/gdb/testsuite/gdb.base/call-signal-resume.exp
@@ -31,9 +31,7 @@ if [target_info exists gdb,nosignals] {
}
-set testfile "call-signals"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile call-signals.c
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
untested call-signal-resume.exp
@@ -61,10 +59,7 @@ proc get_dummy_frame_number { } {
# Start with a fresh gdb.
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
if { ![runto_main] } {
fail "Can't run to main"
diff --git a/gdb/testsuite/gdb.base/call-strs.exp b/gdb/testsuite/gdb.base/call-strs.exp
index 37a2828..764912a 100644
--- a/gdb/testsuite/gdb.base/call-strs.exp
+++ b/gdb/testsuite/gdb.base/call-strs.exp
@@ -23,22 +23,13 @@
#debug strarg
-set testfile "call-strs"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
# Test depends on printf, which the sparclet stub doesn't support.
if { [istarget "sparclet-*-*"] } {
return 0
}
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
- untested call-strs.exp
- return -1
-}
-
-
-
# Some targets can't call functions, so don't even bother with this
# test.
if [target_info exists gdb,cannot_call_functions] {
@@ -48,12 +39,11 @@ if [target_info exists gdb,cannot_call_functions] {
}
-# Start with a fresh gdb.
+if {[prepare_for_testing $testfile.exp $testfile $srcfile debug]} {
+ untested $testfile.exp
+ return -1
+}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
gdb_test_no_output "set print sevenbit-strings"
gdb_test_no_output "set print address off"
gdb_test_no_output "set print symbol off"
diff --git a/gdb/testsuite/gdb.base/callexit.exp b/gdb/testsuite/gdb.base/callexit.exp
index 87d2d91..e33d5f7 100644
--- a/gdb/testsuite/gdb.base/callexit.exp
+++ b/gdb/testsuite/gdb.base/callexit.exp
@@ -14,9 +14,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-set testfile "callexit"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
untested callexit.exp
@@ -33,10 +31,7 @@ if [target_info exists gdb,cannot_call_functions] {
# Start with a fresh gdb.
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
if { ![runto_main] } {
fail "Can't run to main"
diff --git a/gdb/testsuite/gdb.base/callfuncs.exp b/gdb/testsuite/gdb.base/callfuncs.exp
index 6e1ebab..e3f49f9 100644
--- a/gdb/testsuite/gdb.base/callfuncs.exp
+++ b/gdb/testsuite/gdb.base/callfuncs.exp
@@ -16,9 +16,7 @@
# This file was written by Fred Fish. (fnf@cygnus.com)
# and modified by Bob Manson. (manson@cygnus.com)
-set testfile "callfuncs"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
set compile_flags {debug}
if [support_complex_tests] {
diff --git a/gdb/testsuite/gdb.base/catch-load.exp b/gdb/testsuite/gdb.base/catch-load.exp
index c66318e..4bcaa44 100644
--- a/gdb/testsuite/gdb.base/catch-load.exp
+++ b/gdb/testsuite/gdb.base/catch-load.exp
@@ -24,9 +24,7 @@ if {[get_compiler_info]} {
return -1
}
-set testfile catch-load
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug shlib_load}] != "" } {
untested catch-load.exp
return -1
@@ -34,7 +32,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
set testfile2 catch-load-so
set srcfile2 ${testfile2}.c
-set binfile2 ${objdir}/${subdir}/${testfile2}.so
+set binfile2 [standard_output_file ${testfile2}.so]
set binfile2_dlopen [shlib_target_file ${testfile2}.so]
if { [gdb_compile_shlib "${srcdir}/${subdir}/${srcfile2}" ${binfile2} {debug}] != "" } {
untested catch-load.exp
diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp
index 4a05292..395fcd4 100644
--- a/gdb/testsuite/gdb.base/catch-syscall.exp
+++ b/gdb/testsuite/gdb.base/catch-syscall.exp
@@ -38,10 +38,7 @@ if { ![istarget "x86_64-*-linux*"] && ![istarget "i\[34567\]86-*-linux*"]
continue
}
-global srcfile
-set testfile "catch-syscall"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
# All (but the last) syscalls from the example code
# They are ordered according to the file, so do not change this.
diff --git a/gdb/testsuite/gdb.base/charset.exp b/gdb/testsuite/gdb.base/charset.exp
index d8d471e..a5dbb28 100644
--- a/gdb/testsuite/gdb.base/charset.exp
+++ b/gdb/testsuite/gdb.base/charset.exp
@@ -21,10 +21,9 @@
# Test GDB's character set support.
-set testfile "charset"
-set srcfile ${testfile}.c
-set srcmallocfile ${testfile}-malloc.c
-if { [prepare_for_testing ${testfile}.exp ${testfile} [list $srcfile $srcmallocfile]] } {
+standard_testfile .c charset-malloc.c
+
+if { [prepare_for_testing ${testfile}.exp ${testfile} [list $srcfile $srcfile2]] } {
return -1
}
diff --git a/gdb/testsuite/gdb.base/checkpoint.exp b/gdb/testsuite/gdb.base/checkpoint.exp
index d9c28e06..b86fead 100644
--- a/gdb/testsuite/gdb.base/checkpoint.exp
+++ b/gdb/testsuite/gdb.base/checkpoint.exp
@@ -25,9 +25,7 @@ if {![istarget "*-*-linux*"]} then {
}
-set testfile "checkpoint"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
untested checkpoint.exp
@@ -36,10 +34,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
# Start with a fresh gdb
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
global gdb_prompt
diff --git a/gdb/testsuite/gdb.base/chng-syms.exp b/gdb/testsuite/gdb.base/chng-syms.exp
index 8ae0390..d729f1a 100644
--- a/gdb/testsuite/gdb.base/chng-syms.exp
+++ b/gdb/testsuite/gdb.base/chng-syms.exp
@@ -18,9 +18,7 @@
# Test that GDB cleans up properly after errors that result when a
# breakpoint is reset.
-set testfile "chng-syms"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DVARIABLE=var1}] != "" } {
untested chng-syms.exp
@@ -53,10 +51,7 @@ proc expect_to_stop_here { ident } {
return 1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
gdb_test "break stop_here if (var1 == 42)" \
"Breakpoint.*at.* file .*$srcfile, line.*" \
diff --git a/gdb/testsuite/gdb.base/code-expr.exp b/gdb/testsuite/gdb.base/code-expr.exp
index 529a699..de2f03a 100644
--- a/gdb/testsuite/gdb.base/code-expr.exp
+++ b/gdb/testsuite/gdb.base/code-expr.exp
@@ -22,19 +22,14 @@
# test running programs
#
-set testfile "cvexpr"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile cvexpr.c
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
untested code-expr.exp
return -1
}
-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"
diff --git a/gdb/testsuite/gdb.base/code_elim.exp b/gdb/testsuite/gdb.base/code_elim.exp
index 4be9200..c603077 100644
--- a/gdb/testsuite/gdb.base/code_elim.exp
+++ b/gdb/testsuite/gdb.base/code_elim.exp
@@ -20,8 +20,8 @@ set testfile1 code_elim1
set testfile2 code_elim2
set srcfile1 ${testfile1}.c
set srcfile2 ${testfile2}.c
-set binfile1 ${objdir}/${subdir}/${testfile1}
-set binfile2 ${objdir}/${subdir}/${testfile2}
+set binfile1 [standard_output_file ${testfile1}]
+set binfile2 [standard_output_file ${testfile2}]
set opts [list debug]
lappend opts "additional_flags=-ffunction-sections"
lappend opts "additional_flags=-fdata-sections"
diff --git a/gdb/testsuite/gdb.base/commands.exp b/gdb/testsuite/gdb.base/commands.exp
index 39ad3f3..b608e0c 100644
--- a/gdb/testsuite/gdb.base/commands.exp
+++ b/gdb/testsuite/gdb.base/commands.exp
@@ -17,6 +17,8 @@
# test special commands (if, while, etc)
#
+standard_testfile
+
if { [prepare_for_testing commands.exp commands run.c {debug additional_flags=-DFAKEARGV}] } {
return -1
}
@@ -555,7 +557,9 @@ proc stray_arg0_test { } {
# Test that GDB is able to source a file with an indented comment.
proc source_file_with_indented_comment {} {
- set fd [open "file1" w]
+ set file1 [standard_output_file file1]
+
+ set fd [open "$file1" w]
puts $fd \
{define my_fun
#indented comment
@@ -563,40 +567,44 @@ end
echo Done!\n}
close $fd
- gdb_test "source file1" "Done!" "source file with indented comment"
+ gdb_test "source $file1" "Done!" "source file with indented comment"
}
# Test that GDB can handle arguments when sourcing files recursively.
# If the arguments are overwritten with ####### then the test has failed.
proc recursive_source_test {} {
- set fd [open "file1" w]
+ set file1 [standard_output_file file1]
+ set file2 [standard_output_file file2]
+ set file3 [standard_output_file file3]
+
+ set fd [open "$file1" w]
puts $fd \
-{source file2
-abcdef qwerty}
+"source $file2
+abcdef qwerty"
close $fd
- set fd [open "file2" w]
+ set fd [open "$file2" w]
puts $fd \
-{define abcdef
- echo 1: <<<$arg0>>>\n
- source file3
- echo 2: <<<$arg0>>>\n
-end}
+"define abcdef
+ echo 1: <<<\$arg0>>>\\n
+ source $file3
+ echo 2: <<<\$arg0>>>\\n
+end"
close $fd
- set fd [open "file3" w]
+ set fd [open "$file3" w]
puts $fd \
"echo in file3\\n
#################################################################"
close $fd
- gdb_test "source file1" \
+ gdb_test "source $file1" \
"1: <<<qwerty>>>\[\r\n]+in file3\[\r\n]+2: <<<qwerty>>>" \
"recursive source test"
- file delete file1
- file delete file2
- file delete file3
+ file delete $file1
+ file delete $file2
+ file delete $file3
}
proc gdb_test_no_prompt { command result msg } {
diff --git a/gdb/testsuite/gdb.base/completion.exp b/gdb/testsuite/gdb.base/completion.exp
index 80cfbff..b3147da 100644
--- a/gdb/testsuite/gdb.base/completion.exp
+++ b/gdb/testsuite/gdb.base/completion.exp
@@ -50,35 +50,17 @@
# test running programs
#
-set testfile "break"
-set srcfile ${testfile}.c
-set srcfile1 ${testfile}1.c
-set binfile ${objdir}/${subdir}/${testfile}
-
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debug nowarnings}] != "" } {
- untested completion.exp
- return -1
-}
-
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug nowarnings}] != "" } {
- untested completion.exp
- return -1
-}
-
-if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug nowarnings}] != "" } {
- untested completion.exp
- return -1
-}
+standard_testfile break.c break1.c
if [get_compiler_info] {
return -1
}
-gdb_exit
-
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+if {[prepare_for_testing $testfile.exp $testfile \
+ [list $srcfile $srcfile2] {debug nowarnings}]} {
+ untested $testfile.exp
+ return -1
+}
if ![runto_main] then {
perror "tests suppressed"
diff --git a/gdb/testsuite/gdb.base/complex.exp b/gdb/testsuite/gdb.base/complex.exp
index 5cf4845..f29b405 100644
--- a/gdb/testsuite/gdb.base/complex.exp
+++ b/gdb/testsuite/gdb.base/complex.exp
@@ -14,28 +14,16 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-set testfile complex
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-set options debug
-
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $options] != "" } {
- # No support for __complex__, presumably.
- unsupported "print complex packed value in C"
- unsupported "print complex value in C"
- return 0
-}
-
-# Start with a fresh gdb.
+standard_testfile
if [get_compiler_info] {
return -1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load $binfile
+if {[prepare_for_testing $testfile.exp $testfile $srcfile debug]} {
+ untested $testfile.exp
+ return -1
+}
if [runto f2] then {
get_debug_format
diff --git a/gdb/testsuite/gdb.base/cond-expr.exp b/gdb/testsuite/gdb.base/cond-expr.exp
index 95dbe03..4358844 100644
--- a/gdb/testsuite/gdb.base/cond-expr.exp
+++ b/gdb/testsuite/gdb.base/cond-expr.exp
@@ -31,19 +31,15 @@
# haven't tried to compile one, or the compilation failed for some reason.
# In either case, just notify the user and skip the tests in this file.
-set testfile "int-type"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile int-type.c
+
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
untested cond-expr.exp
return -1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
if ![runto_main] then {
diff --git a/gdb/testsuite/gdb.base/condbreak.exp b/gdb/testsuite/gdb.base/condbreak.exp
index c09228c..faccb5b 100644
--- a/gdb/testsuite/gdb.base/condbreak.exp
+++ b/gdb/testsuite/gdb.base/condbreak.exp
@@ -21,46 +21,30 @@
# test running programs
#
-set testfile "break"
-set srcfile ${testfile}.c
-set srcfile1 ${testfile}1.c
-set binfile ${objdir}/${subdir}/${testfile}
-
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debug nowarnings}] != "" } {
- untested condbreak.exp
- return -1
-}
-
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug nowarnings}] != "" } {
- untested condbreak.exp
- return -1
-}
+standard_testfile break.c break1.c
-if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug nowarnings}] != "" } {
- untested condbreak.exp
- return -1
+if {[prepare_for_testing ${testfile}.exp $testfile [list $srcfile $srcfile2] \
+ {debug nowarnings}]} {
+ return -1
}
if [get_compiler_info] {
return -1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
set bp_location6 [gdb_get_line_number "set breakpoint 6 here"]
-set bp_location8 [gdb_get_line_number "set breakpoint 8 here" $srcfile1]
-set bp_location9 [gdb_get_line_number "set breakpoint 9 here" $srcfile1]
-set bp_location13 [gdb_get_line_number "set breakpoint 13 here" $srcfile1]
-set bp_location14 [gdb_get_line_number "set breakpoint 14 here" $srcfile1]
-set bp_location15 [gdb_get_line_number "set breakpoint 15 here" $srcfile1]
-set bp_location16 [gdb_get_line_number "set breakpoint 16 here" $srcfile1]
-set bp_location17 [gdb_get_line_number "set breakpoint 17 here" $srcfile1]
-set bp_location18 [gdb_get_line_number "set breakpoint 18 here" $srcfile1]
+set bp_location8 [gdb_get_line_number "set breakpoint 8 here" $srcfile2]
+set bp_location9 [gdb_get_line_number "set breakpoint 9 here" $srcfile2]
+set bp_location13 [gdb_get_line_number "set breakpoint 13 here" $srcfile2]
+set bp_location14 [gdb_get_line_number "set breakpoint 14 here" $srcfile2]
+set bp_location15 [gdb_get_line_number "set breakpoint 15 here" $srcfile2]
+set bp_location16 [gdb_get_line_number "set breakpoint 16 here" $srcfile2]
+set bp_location17 [gdb_get_line_number "set breakpoint 17 here" $srcfile2]
+set bp_location18 [gdb_get_line_number "set breakpoint 18 here" $srcfile2]
#
# test break at function
@@ -73,7 +57,7 @@ gdb_test "break main" \
# test conditional break at function
#
gdb_test "break marker1 if 1==1" \
- "Breakpoint.*at.* file .*$srcfile1, line.*"
+ "Breakpoint.*at.* file .*$srcfile2, line.*"
gdb_test_no_output "delete 2"
@@ -89,7 +73,7 @@ gdb_test_no_output "delete 3"
# test conditional break at function
#
gdb_test "break marker1 if (1==1)" \
- "Breakpoint.*at.* file .*$srcfile1, line.*"
+ "Breakpoint.*at.* file .*$srcfile2, line.*"
#
# test conditional break at line number
@@ -98,16 +82,16 @@ gdb_test "break $srcfile:$bp_location1 if (1==1)" \
"Breakpoint.*at.* file .*$srcfile, line $bp_location1\\."
gdb_test "break marker2 if (a==43)" \
- "Breakpoint.*at.* file .*$srcfile1, line.*"
+ "Breakpoint.*at.* file .*$srcfile2, line.*"
#
# Check break involving inferior function call.
# Ensure there is at least one additional breakpoint with higher VMA.
#
gdb_test "break marker3 if (multi_line_if_conditional(1,1,1)==0)" \
- "Breakpoint.*at.* file .*$srcfile1, line.*"
+ "Breakpoint.*at.* file .*$srcfile2, line.*"
gdb_test "break marker4" \
- "Breakpoint.*at.* file .*$srcfile1, line.*"
+ "Breakpoint.*at.* file .*$srcfile2, line.*"
#
# check to see what breakpoints are set
@@ -129,15 +113,15 @@ if {$hp_aCC_compiler} {
gdb_test "info break" \
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$bp_location6.*
-\[0-9\]+\[\t \]+breakpoint keep y.* in marker1$marker1_proto at .*$srcfile1:($bp_location15|$bp_location16).*
+\[0-9\]+\[\t \]+breakpoint keep y.* in marker1$marker1_proto at .*$srcfile2:($bp_location15|$bp_location16).*
\[\t \]+stop only if \\(1==1\\).*
\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$bp_location1.*
\[\t \]+stop only if \\(1==1\\).*
-\[0-9\]+\[\t \]+breakpoint keep y.* in marker2$marker2_proto at .*$srcfile1:($bp_location8|$bp_location9).*
+\[0-9\]+\[\t \]+breakpoint keep y.* in marker2$marker2_proto at .*$srcfile2:($bp_location8|$bp_location9).*
\[\t \]+stop only if \\(a==43\\).*
-\[0-9\]+\[\t \]+breakpoint keep y.* in marker3$marker3_proto at .*$srcfile1:($bp_location17|$bp_location18).*
+\[0-9\]+\[\t \]+breakpoint keep y.* in marker3$marker3_proto at .*$srcfile2:($bp_location17|$bp_location18).*
\[\t \]+stop only if \\(multi_line_if_conditional\\(1,1,1\\)==0\\).*
-\[0-9\]+\[\t \]+breakpoint keep y.* in marker4$marker4_proto at .*$srcfile1:($bp_location13|$bp_location14).*" \
+\[0-9\]+\[\t \]+breakpoint keep y.* in marker4$marker4_proto at .*$srcfile2:($bp_location13|$bp_location14).*" \
"breakpoint info"
@@ -195,10 +179,10 @@ gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.
#
# Until the Dwarf2 writer gets fixed, I'm going to XFAIL its behavior.
gdb_test_multiple "continue" "run until breakpoint at marker1" {
- -re "Continuing\\..*Breakpoint \[0-9\]+, marker1 \\(\\) at .*$srcfile1:($bp_location15|$bp_location16).*($bp_location15|$bp_location16)\[\t \]+.*$gdb_prompt $" {
+ -re "Continuing\\..*Breakpoint \[0-9\]+, marker1 \\(\\) at .*$srcfile2:($bp_location15|$bp_location16).*($bp_location15|$bp_location16)\[\t \]+.*$gdb_prompt $" {
pass "run until breakpoint at marker1"
}
- -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker1 \\(\\) at .*$srcfile1:($bp_location15|$bp_location16).*($bp_location15|$bp_location16)\[\t \]+.*$gdb_prompt $" {
+ -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker1 \\(\\) at .*$srcfile2:($bp_location15|$bp_location16).*($bp_location15|$bp_location16)\[\t \]+.*$gdb_prompt $" {
xfail "run until breakpoint at marker1"
}
}
@@ -207,10 +191,10 @@ gdb_test_multiple "continue" "run until breakpoint at marker1" {
# Same issues here as above.
setup_xfail hppa2.0w-*-* 11512CLLbs
gdb_test_multiple "continue" "run until breakpoint at marker2" {
- -re "Continuing\\..*Breakpoint \[0-9\]+, marker2 \\(a=43\\) at .*$srcfile1:($bp_location8|$bp_location9).*($bp_location8|$bp_location9)\[\t \]+.*$gdb_prompt $" {
+ -re "Continuing\\..*Breakpoint \[0-9\]+, marker2 \\(a=43\\) at .*$srcfile2:($bp_location8|$bp_location9).*($bp_location8|$bp_location9)\[\t \]+.*$gdb_prompt $" {
pass "run until breakpoint at marker2"
}
- -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker2 \\(a=43\\) at .*$srcfile1:($bp_location8|$bp_location9).*($bp_location8|$bp_location9)\[\t \]+.*$gdb_prompt $" {
+ -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker2 \\(a=43\\) at .*$srcfile2:($bp_location8|$bp_location9).*($bp_location8|$bp_location9)\[\t \]+.*$gdb_prompt $" {
xfail "run until breakpoint at marker2"
}
}
@@ -244,20 +228,20 @@ gdb_test "break *main if (1==1) ta 999" \
set test "run until breakpoint at marker3"
gdb_test_multiple "continue" $test {
- -re "Continuing\\..*Breakpoint \[0-9\]+, marker3 \\(a=$hex \"stack\", b=$hex \"trace\"\\) at .*$srcfile1:($bp_location17|$bp_location18).*($bp_location17|$bp_location18)\[\t \]+.*$gdb_prompt $" {
+ -re "Continuing\\..*Breakpoint \[0-9\]+, marker3 \\(a=$hex \"stack\", b=$hex \"trace\"\\) at .*$srcfile2:($bp_location17|$bp_location18).*($bp_location17|$bp_location18)\[\t \]+.*$gdb_prompt $" {
pass $test
}
- -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker3 \\(a=$hex \"stack\", b=$hex \"trace\"\\) at .*$srcfile1:($bp_location17|$bp_location18).*($bp_location17|$bp_location18)\[\t \]+.*$gdb_prompt $" {
+ -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker3 \\(a=$hex \"stack\", b=$hex \"trace\"\\) at .*$srcfile2:($bp_location17|$bp_location18).*($bp_location17|$bp_location18)\[\t \]+.*$gdb_prompt $" {
xfail $test
}
}
set test "run until breakpoint at marker4"
gdb_test_multiple "continue" $test {
- -re "Continuing\\..*Breakpoint \[0-9\]+, marker4 \\(d=177601976\\) at .*$srcfile1:($bp_location13|$bp_location14).*($bp_location13|$bp_location14)\[\t \]+.*$gdb_prompt $" {
+ -re "Continuing\\..*Breakpoint \[0-9\]+, marker4 \\(d=177601976\\) at .*$srcfile2:($bp_location13|$bp_location14).*($bp_location13|$bp_location14)\[\t \]+.*$gdb_prompt $" {
pass $test
}
- -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker4 \\(d=177601976\\) at .*$srcfile1:($bp_location13|$bp_location14).*($bp_location13|$bp_location14)\[\t \]+.*$gdb_prompt $" {
+ -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker4 \\(d=177601976\\) at .*$srcfile2:($bp_location13|$bp_location14).*($bp_location13|$bp_location14)\[\t \]+.*$gdb_prompt $" {
xfail $test
}
}
diff --git a/gdb/testsuite/gdb.base/consecutive.exp b/gdb/testsuite/gdb.base/consecutive.exp
index dd29431..be70e9f 100644
--- a/gdb/testsuite/gdb.base/consecutive.exp
+++ b/gdb/testsuite/gdb.base/consecutive.exp
@@ -20,24 +20,17 @@
#
-set testfile "consecutive"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
- untested consecutive.exp
+if [get_compiler_info] {
return -1
}
-if [get_compiler_info] {
+if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug nowarnings}]} {
+ untested $testfile.exp
return -1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
if ![runto_main] then {
perror "couldn't run to breakpoint"
continue
diff --git a/gdb/testsuite/gdb.base/constvars.exp b/gdb/testsuite/gdb.base/constvars.exp
index 0e07349..554e265 100644
--- a/gdb/testsuite/gdb.base/constvars.exp
+++ b/gdb/testsuite/gdb.base/constvars.exp
@@ -27,9 +27,7 @@
# test running programs
#
-set testfile "constvars"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
# Create and source the file that provides information about the compiler
# used to compile the test case.
@@ -42,10 +40,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable debug
return -1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
#
diff --git a/gdb/testsuite/gdb.base/corefile.exp b/gdb/testsuite/gdb.base/corefile.exp
index 054ed3e..24a33a3 100644
--- a/gdb/testsuite/gdb.base/corefile.exp
+++ b/gdb/testsuite/gdb.base/corefile.exp
@@ -21,13 +21,7 @@ if ![isnative] then {
return
}
-set testfile "coremaker"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
- untested corefile.exp
- return -1
-}
+standard_testfile coremaker.c
# Create and source the file that provides information about the compiler
# used to compile the test case.
@@ -35,6 +29,11 @@ if [get_compiler_info] {
return -1
}
+if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} {
+ untested $testfile.exp
+ return -1
+}
+
set corefile [core_find $binfile {coremmap.data}]
if {$corefile == ""} {
return 0
@@ -49,7 +48,7 @@ if {$corefile == ""} {
#
# Another problem is that on some systems (solaris for example), there
# is apparently a limit on the length of a fully specified path to
-# the coremaker executable, at about 80 chars. For this case, consider
+# the corefile executable, at about 80 chars. For this case, consider
# it a pass, but note that the program name is bad.
gdb_exit
@@ -65,7 +64,7 @@ expect {
-re "Couldn't find .* registers in core file.*$gdb_prompt $" {
fail "args: -core=[file tail $corefile] (couldn't find regs)"
}
- -re "Core was generated by .*coremaker.*\r\n\#0 .*\(\).*\r\n$gdb_prompt $" {
+ -re "Core was generated by .*corefile.*\r\n\#0 .*\(\).*\r\n$gdb_prompt $" {
pass "args: -core=[file tail $corefile]"
}
-re "Core was generated by .*\r\n\#0 .*\(\).*\r\n$gdb_prompt $" {
@@ -93,7 +92,7 @@ if $verbose>1 then {
eval "spawn $GDB $INTERNAL_GDBFLAGS $GDBFLAGS $binfile -core=$corefile"
expect {
- -re "Core was generated by .*coremaker.*\r\n\#0 .*\(\).*\r\n$gdb_prompt $" {
+ -re "Core was generated by .*corefile.*\r\n\#0 .*\(\).*\r\n$gdb_prompt $" {
pass "args: execfile -core=[file tail $corefile]"
}
-re "Core was generated by .*\r\n\#0 .*\(\).*\r\n$gdb_prompt $" {
@@ -124,7 +123,7 @@ gdb_test_multiple "core-file $corefile" "core-file command" {
send_gdb "y\n"
exp_continue
}
- -re "Core was generated by .*coremaker.*\r\n\#0 .*\(\).*\r\n$gdb_prompt $" {
+ -re "Core was generated by .*corefile.*\r\n\#0 .*\(\).*\r\n$gdb_prompt $" {
pass "core-file command"
}
-re "Core was generated by .*\r\n\#0 .*\(\).*\r\n$gdb_prompt $" {
diff --git a/gdb/testsuite/gdb.base/ctxobj.exp b/gdb/testsuite/gdb.base/ctxobj.exp
index cd68dfc..f803a12 100644
--- a/gdb/testsuite/gdb.base/ctxobj.exp
+++ b/gdb/testsuite/gdb.base/ctxobj.exp
@@ -30,8 +30,8 @@ set executable ctxobj-m
set libsrc [list "${srcdir}/${subdir}/ctxobj-v.c" \
"${srcdir}/${subdir}/ctxobj-f.c"]
-set libobj1 "${objdir}/${subdir}/libctxobj1.so"
-set libobj2 "${objdir}/${subdir}/libctxobj2.so"
+set libobj1 [standard_output_file libctxobj1.so]
+set libobj2 [standard_output_file libctxobj2.so]
set libobj1_opts { debug additional_flags=-fPIC
additional_flags=-DVERSION=104
@@ -47,7 +47,7 @@ if { [gdb_compile_shlib $libsrc $libobj2 $libobj2_opts ] != "" } {
return -1
}
if { [gdb_compile "${srcdir}/${subdir}/${executable}.c" \
- "${objdir}/${subdir}/${executable}" \
+ [standard_output_file ${executable}] \
executable \
[list debug shlib=${libobj1} shlib=${libobj2}]]
!= ""} {
diff --git a/gdb/testsuite/gdb.base/cursal.exp b/gdb/testsuite/gdb.base/cursal.exp
index a5840cb..fb58dd4 100644
--- a/gdb/testsuite/gdb.base/cursal.exp
+++ b/gdb/testsuite/gdb.base/cursal.exp
@@ -14,9 +14,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-set testfile "cursal"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != ""} {
untested "Couldn't compile $srcfile"
diff --git a/gdb/testsuite/gdb.base/cvexpr.exp b/gdb/testsuite/gdb.base/cvexpr.exp
index 7ae8548..c5e4faf 100644
--- a/gdb/testsuite/gdb.base/cvexpr.exp
+++ b/gdb/testsuite/gdb.base/cvexpr.exp
@@ -22,19 +22,14 @@
# test running programs
#
-set testfile "cvexpr"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
untested cvexpr.exp
return -1
}
-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"
diff --git a/gdb/testsuite/gdb.base/dbx.exp b/gdb/testsuite/gdb.base/dbx.exp
index 31bda5d..7d89b81 100644
--- a/gdb/testsuite/gdb.base/dbx.exp
+++ b/gdb/testsuite/gdb.base/dbx.exp
@@ -14,28 +14,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. */
-set testfile1 "average"
-set testfile2 "sum"
-set testfile "dbx-test"
-set binfile1 ${objdir}/${subdir}/${testfile1}
-set binfile2 ${objdir}/${subdir}/${testfile2}
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile average.c sum.c
-
-
-if { [gdb_compile "${srcdir}/${subdir}/average.c" "${binfile1}.o" object {debug}] != "" } {
- untested dbx.exp
- return -1
-}
-
-if { [gdb_compile "${srcdir}/${subdir}/sum.c" "${binfile2}.o" object {debug}] != "" } {
- untested dbx.exp
- return -1
-}
-
-if { [gdb_compile "${binfile1}.o ${binfile2}.o" ${binfile} executable {debug}] != "" } {
- untested dbx.exp
- return -1
+if {[build_executable $testfile.exp $testfile \
+ [list $srcfile $srcfile2] debug] == -1} {
+ untested $testfile.exp
+ return -1
}
#
diff --git a/gdb/testsuite/gdb.base/default.exp b/gdb/testsuite/gdb.base/default.exp
index 9230ee8..e6fef15 100644
--- a/gdb/testsuite/gdb.base/default.exp
+++ b/gdb/testsuite/gdb.base/default.exp
@@ -521,6 +521,9 @@ gdb_test "set height" "Argument required .integer to set it to.*" "set height"
gdb_test_no_output "set history expansion" "set history expansion"
#test set history filename
gdb_test "set history filename" "Argument required .filename to set it to.*" "set history filename"
+# Make sure the history ends up in the right place.
+gdb_test_no_output "set history filename [standard_output_file .gdb_history]" \
+ "set the history filename"
#test set history save
gdb_test_no_output "set history save" "set history save"
#test set history size
diff --git a/gdb/testsuite/gdb.base/define.exp b/gdb/testsuite/gdb.base/define.exp
index 9b7eef9..6b647f2 100644
--- a/gdb/testsuite/gdb.base/define.exp
+++ b/gdb/testsuite/gdb.base/define.exp
@@ -20,31 +20,13 @@
# test running programs
#
-set testfile "break"
-set srcfile ${testfile}.c
-set srcfile1 ${testfile}1.c
-set binfile ${objdir}/${subdir}/${testfile}
-
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debug nowarnings}] != "" } {
- untested define.exp
- return -1
-}
-
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug nowarnings}] != "" } {
- untested define.exp
- return -1
-}
+standard_testfile break.c break1.c
-if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug nowarnings}] != "" } {
- untested define.exp
- return -1
+if {[prepare_for_testing ${testfile}.exp ${testfile} \
+ [list $srcfile $srcfile2] {debug nowarnings}]} {
+ return -1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
set bp_location11 [gdb_get_line_number "set breakpoint 11 here"]
diff --git a/gdb/testsuite/gdb.base/del.exp b/gdb/testsuite/gdb.base/del.exp
index febcfc6..958d491 100644
--- a/gdb/testsuite/gdb.base/del.exp
+++ b/gdb/testsuite/gdb.base/del.exp
@@ -17,21 +17,13 @@
# shortcuts of the "delete" command never stop working.
-set testfile del
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
- untested "Couldn't compile test program"
+standard_testfile
+
+if {[prepare_for_testing $testfile.exp $testfile $srcfile debug]} {
+ untested $testfile.exp
return -1
}
-# Get things started.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
# A function to test that ALIAS is working as a shortcut of the "delete"
# command.
diff --git a/gdb/testsuite/gdb.base/detach.exp b/gdb/testsuite/gdb.base/detach.exp
index 3d2e90c..0a61d11 100644
--- a/gdb/testsuite/gdb.base/detach.exp
+++ b/gdb/testsuite/gdb.base/detach.exp
@@ -27,10 +27,8 @@ if [is_remote target] then {
return 0
}
-set testfile "attach"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-set escapedbinfile [string_to_regexp ${objdir}/${subdir}/${testfile}]
+standard_testfile attach.c
+set escapedbinfile [string_to_regexp ${binfile}]
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
untested detach.exp
diff --git a/gdb/testsuite/gdb.base/dfp-test.exp b/gdb/testsuite/gdb.base/dfp-test.exp
index f121808..ce402df 100644
--- a/gdb/testsuite/gdb.base/dfp-test.exp
+++ b/gdb/testsuite/gdb.base/dfp-test.exp
@@ -18,9 +18,7 @@
# This file is part of the gdb testsuite. It is intended to test that
# gdb could correctly handle decimal floating point introduced in IEEE 754R.
-set testfile "dfp-test"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
# Try to compile the test case. If we can't, assume the
# toolchain does not yet provide DFP support and bail out.
@@ -29,10 +27,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {quie
return -1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
if ![runto_main] then {
perror "couldn't run to breakpoint"
diff --git a/gdb/testsuite/gdb.base/display.exp b/gdb/testsuite/gdb.base/display.exp
index fa44003..5db84cc 100644
--- a/gdb/testsuite/gdb.base/display.exp
+++ b/gdb/testsuite/gdb.base/display.exp
@@ -16,13 +16,10 @@
# display.exp Test display commands
# Also do some printing stuff for coverage's sake.
#
-set testfile display
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
-
-
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
+if {[prepare_for_testing $testfile.exp $testfile $srcfile \
+ {debug nowarnings}]} {
untested display.exp
return -1
}
@@ -36,11 +33,6 @@ verbose "Timeout is now $timeout seconds" 2
# use this to debug:
#log_user 1
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
# Some coverage stuff
#
if !$use_gdb_stub {
diff --git a/gdb/testsuite/gdb.base/dmsym.exp b/gdb/testsuite/gdb.base/dmsym.exp
index 02b1a9c..822eed7 100644
--- a/gdb/testsuite/gdb.base/dmsym.exp
+++ b/gdb/testsuite/gdb.base/dmsym.exp
@@ -21,16 +21,18 @@ set testfile dmsym_main
# This is why we use gdb_compile instead of relying on the usual
# call to prepare_for_testing.
+set dmsym_o [standard_output_file dmsym.o]
+
if {[gdb_compile "${srcdir}/${subdir}/dmsym.c" \
- ${objdir}/${subdir}/dmsym.o \
+ $dmsym_o \
object {}] != ""} {
untested dmsym.exp
return -1
}
if {[gdb_compile \
- [list ${srcdir}/${subdir}/dmsym_main.c ${objdir}/${subdir}/dmsym.o] \
- ${objdir}/${subdir}/${testfile} \
+ [list ${srcdir}/${subdir}/dmsym_main.c $dmsym_o] \
+ [standard_output_file ${testfile}] \
executable {debug}] != ""} {
untested dmsym.exp
return -1
diff --git a/gdb/testsuite/gdb.base/dump.exp b/gdb/testsuite/gdb.base/dump.exp
index b2d0b3a..ea93b89 100644
--- a/gdb/testsuite/gdb.base/dump.exp
+++ b/gdb/testsuite/gdb.base/dump.exp
@@ -17,10 +17,8 @@
# This is a test for the gdb command "dump".
-set testfile "dump"
+standard_testfile
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
set options {debug}
set is64bitonly "no"
diff --git a/gdb/testsuite/gdb.base/dup-sect.exp b/gdb/testsuite/gdb.base/dup-sect.exp
index 6076801..fcc762e 100644
--- a/gdb/testsuite/gdb.base/dup-sect.exp
+++ b/gdb/testsuite/gdb.base/dup-sect.exp
@@ -33,11 +33,9 @@ if {![istarget *-*-linux*]
return 0
}
-set testfile dup-sect
-set srcfile ${testfile}.S
+standard_testfile .S
set srcmainfile start.c
set executable ${testfile}
-set binfile ${objdir}/${subdir}/${executable}
if {[build_executable ${testfile}.exp $executable [list ${srcfile} ${srcmainfile}] {}] == -1} {
return -1