aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/testsuite/ChangeLog11
-rw-r--r--gdb/testsuite/gdb.base/a2-run.exp5
-rw-r--r--gdb/testsuite/gdb.base/all-bin.exp18
-rw-r--r--gdb/testsuite/gdb.base/annota1.exp13
-rw-r--r--gdb/testsuite/gdb.base/annota3.exp9
-rw-r--r--gdb/testsuite/gdb.base/anon.exp4
-rw-r--r--gdb/testsuite/gdb.base/args.exp20
-rw-r--r--gdb/testsuite/gdb.base/arithmet.exp19
-rw-r--r--gdb/testsuite/gdb.base/arrayidx.exp10
-rw-r--r--gdb/testsuite/gdb.base/assign.exp10
-rw-r--r--gdb/testsuite/gdb.base/async-shell.exp4
-rw-r--r--gdb/testsuite/gdb.base/async.exp10
-rw-r--r--gdb/testsuite/gdb.base/attach-pie-misread.exp10
-rw-r--r--gdb/testsuite/gdb.base/attach-pie-noexec.exp3
-rw-r--r--gdb/testsuite/gdb.base/attach-twice.exp3
-rw-r--r--gdb/testsuite/gdb.base/attach.exp12
-rw-r--r--gdb/testsuite/gdb.base/auxv.exp16
-rw-r--r--gdb/testsuite/gdb.base/bang.exp12
-rw-r--r--gdb/testsuite/gdb.base/bfp-test.exp10
-rw-r--r--gdb/testsuite/gdb.base/bigcore.exp11
-rw-r--r--gdb/testsuite/gdb.base/bitfields.exp13
-rw-r--r--gdb/testsuite/gdb.base/bitfields2.exp9
-rw-r--r--gdb/testsuite/gdb.base/break-entry.exp4
-rw-r--r--gdb/testsuite/gdb.base/break-interp.exp11
-rw-r--r--gdb/testsuite/gdb.base/break-on-linker-gcd-function.exp12
-rw-r--r--gdb/testsuite/gdb.base/breakpoint-shadow.exp14
26 files changed, 98 insertions, 175 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index cf3bd6c..c022aec 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,14 @@
+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,
+ attach-twice.exp, attach.exp, auxv.exp, bang.exp, bfp-test.exp,
+ bigcore.exp, bitfields.exp, bitfields2.exp, break-entry.exp,
+ break-interp.exp, break-on-linker-gcd-function.exp,
+ breakpoint-shadow.exp: Use standard_testfile,
+ standard_output_file, prepare_for_testing, clean_restart.
+
2013-06-26 Yao Qi <yao@codesourcery.com>
* gdb.trace/mi-trace-frame-collected.exp: New.
diff --git a/gdb/testsuite/gdb.base/a2-run.exp b/gdb/testsuite/gdb.base/a2-run.exp
index bd70928..c8467dc 100644
--- a/gdb/testsuite/gdb.base/a2-run.exp
+++ b/gdb/testsuite/gdb.base/a2-run.exp
@@ -24,8 +24,9 @@ if [gdb_skip_stdio_test "a2run.exp"] {
# test running programs
#
-set testfile a2-run
-if { [prepare_for_testing ${testfile}.exp $testfile run.c] } {
+standard_testfile run.c
+
+if { [prepare_for_testing ${testfile}.exp $testfile $srcfile] } {
return -1
}
diff --git a/gdb/testsuite/gdb.base/all-bin.exp b/gdb/testsuite/gdb.base/all-bin.exp
index 53f6d5b..815844a 100644
--- a/gdb/testsuite/gdb.base/all-bin.exp
+++ b/gdb/testsuite/gdb.base/all-bin.exp
@@ -27,24 +27,16 @@
# test running programs
#
-set testfile "all-types"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
- untested all-bin.exp
- return -1
- }
+standard_testfile all-types.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 $srcfile debug]} {
+ untested $testfile.exp
+ return -1
+}
#
# set it up at a breakpoint so we can play with the variable values
diff --git a/gdb/testsuite/gdb.base/annota1.exp b/gdb/testsuite/gdb.base/annota1.exp
index 2015154..541108a 100644
--- a/gdb/testsuite/gdb.base/annota1.exp
+++ b/gdb/testsuite/gdb.base/annota1.exp
@@ -31,9 +31,7 @@ set breakpoints_invalid "\r\n\032\032breakpoints-invalid\r\n"
# test running programs
#
-set testfile "annota1"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
untested annota1.exp
@@ -41,10 +39,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
# The commands we test here produce many lines of output; disable "press
# <return> to continue" prompts.
@@ -445,10 +440,10 @@ if { [remote_file host exists core] } {
}
proc thread_test {} {
- global objdir subdir srcdir testfile
+ global subdir srcdir testfile
global gdb_prompt old_gdb_prompt
set srcfile watch_thread_num.c
- set binfile ${objdir}/${subdir}/${testfile}-watch_thread_num
+ set binfile [standard_output_file ${testfile}-watch_thread_num]
set gdb_prompt $old_gdb_prompt
if { ![get_compiler_info] && [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] == "" } {
diff --git a/gdb/testsuite/gdb.base/annota3.exp b/gdb/testsuite/gdb.base/annota3.exp
index a742d09..1d98a4f 100644
--- a/gdb/testsuite/gdb.base/annota3.exp
+++ b/gdb/testsuite/gdb.base/annota3.exp
@@ -30,9 +30,7 @@ if [is_remote target] then {
# test running programs
#
-set testfile "annota3"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}$EXEEXT
+standard_testfile .c
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
untested annota3.exp
@@ -40,10 +38,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
# The commands we test here produce many lines of output; disable "press
# <return> to continue" prompts.
diff --git a/gdb/testsuite/gdb.base/anon.exp b/gdb/testsuite/gdb.base/anon.exp
index 3edb10a..6d69aac 100644
--- a/gdb/testsuite/gdb.base/anon.exp
+++ b/gdb/testsuite/gdb.base/anon.exp
@@ -14,8 +14,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-set testfile "anon"
-set srcfile $testfile.c
+standard_testfile .c
+
if { [prepare_for_testing $testfile.exp $testfile $srcfile {debug}] } {
return -1
}
diff --git a/gdb/testsuite/gdb.base/args.exp b/gdb/testsuite/gdb.base/args.exp
index 5ba9393..9fdbcaf 100644
--- a/gdb/testsuite/gdb.base/args.exp
+++ b/gdb/testsuite/gdb.base/args.exp
@@ -23,30 +23,22 @@ if [target_info exists noargs] {
return
}
-set testfile "args"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
- untested args.exp
+if {[build_executable $testfile.exp $testfile \
+ $srcfile {debug nowarnings}] == -1} {
+ untested $testfile.exp
return -1
}
proc args_test { name arglist } {
global srcdir
global subdir
- global binfile
+ global testfile
global hex
global decimal
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
-
- # No loading needs to be done when the target is `exec'. Some targets
- # require that the program be loaded, however, and it doesn't hurt
- # for `exec'.
- gdb_load $binfile
+ clean_restart $testfile
runto_main
gdb_breakpoint [gdb_get_line_number "set breakpoint here"]
diff --git a/gdb/testsuite/gdb.base/arithmet.exp b/gdb/testsuite/gdb.base/arithmet.exp
index f44d1e2..4143f22 100644
--- a/gdb/testsuite/gdb.base/arithmet.exp
+++ b/gdb/testsuite/gdb.base/arithmet.exp
@@ -26,19 +26,12 @@
# test running programs
#
-set testfile "int-type"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
- untested arithmet.exp
- return -1
- }
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+standard_testfile int-type.c
+
+if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug nowarnings}]} {
+ untested $testfile.exp
+ return -1
+}
#
diff --git a/gdb/testsuite/gdb.base/arrayidx.exp b/gdb/testsuite/gdb.base/arrayidx.exp
index 387b34f..37ed4c3 100644
--- a/gdb/testsuite/gdb.base/arrayidx.exp
+++ b/gdb/testsuite/gdb.base/arrayidx.exp
@@ -17,18 +17,14 @@
# gdb can correctly print arrays with indexes for each element of the
# array.
-set testfile "arrayidx"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
+
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
untested "Couldn't compile ${srcfile}"
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/assign.exp b/gdb/testsuite/gdb.base/assign.exp
index fd9486a..61197ee 100644
--- a/gdb/testsuite/gdb.base/assign.exp
+++ b/gdb/testsuite/gdb.base/assign.exp
@@ -25,9 +25,7 @@
# test running programs
#
-set testfile "all-types"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile all-types.c
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
untested assign.exp
@@ -35,11 +33,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
}
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
#
diff --git a/gdb/testsuite/gdb.base/async-shell.exp b/gdb/testsuite/gdb.base/async-shell.exp
index 89ceebe..186637c 100644
--- a/gdb/testsuite/gdb.base/async-shell.exp
+++ b/gdb/testsuite/gdb.base/async-shell.exp
@@ -13,7 +13,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 async-shell
+standard_testfile
if { ![support_displaced_stepping] } {
unsupported "displaced stepping"
@@ -25,7 +25,7 @@ if [target_info exists use_gdb_stub] {
return 0
}
-if { [prepare_for_testing ${testfile}.exp ${testfile}] } {
+if { [prepare_for_testing ${testfile}.exp ${testfile} $srcfile] } {
return -1
}
diff --git a/gdb/testsuite/gdb.base/async.exp b/gdb/testsuite/gdb.base/async.exp
index f75552e..11e0824 100644
--- a/gdb/testsuite/gdb.base/async.exp
+++ b/gdb/testsuite/gdb.base/async.exp
@@ -18,16 +18,14 @@
# test running programs
#
-set testfile "async"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
- untested async.exp
+if [get_compiler_info] {
return -1
}
-if [get_compiler_info] {
+if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} {
+ untested $testfile.exp
return -1
}
diff --git a/gdb/testsuite/gdb.base/attach-pie-misread.exp b/gdb/testsuite/gdb.base/attach-pie-misread.exp
index 0640a63..443804d 100644
--- a/gdb/testsuite/gdb.base/attach-pie-misread.exp
+++ b/gdb/testsuite/gdb.base/attach-pie-misread.exp
@@ -21,13 +21,11 @@ if { ![isnative] || [is_remote host] || [target_info exists use_gdb_stub]
load_lib prelink-support.exp
-set test "attach-pie-misread"
-set srcfile ${test}.c
-set genfile ${objdir}/${subdir}/${test}-gen.h
-set executable ${test}
-set binfile ${objdir}/${subdir}/${executable}
+standard_testfile .c
+set genfile [standard_output_file ${testfile}-gen.h]
+set executable $testfile
-if {[build_executable_own_libs ${test}.exp $executable $srcfile [list additional_flags=-fPIE ldflags=-pie]] == ""} {
+if {[build_executable_own_libs ${testfile}.exp $executable $srcfile [list additional_flags=-fPIE ldflags=-pie]] == ""} {
return -1
}
diff --git a/gdb/testsuite/gdb.base/attach-pie-noexec.exp b/gdb/testsuite/gdb.base/attach-pie-noexec.exp
index cb48a55..9aa5d83 100644
--- a/gdb/testsuite/gdb.base/attach-pie-noexec.exp
+++ b/gdb/testsuite/gdb.base/attach-pie-noexec.exp
@@ -18,9 +18,8 @@ if [is_remote target] then {
return 0
}
-set testfile attach-pie-noexec
+standard_testfile .c
set executable ${testfile}
-set binfile ${objdir}/${subdir}/${executable}
if { [prepare_for_testing ${testfile}.exp $executable "" [list debug "additional_flags=-fPIE -pie"]] } {
return -1
diff --git a/gdb/testsuite/gdb.base/attach-twice.exp b/gdb/testsuite/gdb.base/attach-twice.exp
index 2a79c35..0a0035b 100644
--- a/gdb/testsuite/gdb.base/attach-twice.exp
+++ b/gdb/testsuite/gdb.base/attach-twice.exp
@@ -18,9 +18,8 @@ if [is_remote target] then {
return 0
}
-set testfile attach-twice
+standard_testfile
set executable ${testfile}
-set binfile ${objdir}/${subdir}/${executable}
if { [prepare_for_testing ${testfile}.exp $executable] } {
return -1
diff --git a/gdb/testsuite/gdb.base/attach.exp b/gdb/testsuite/gdb.base/attach.exp
index 929ac9a..edd3d0c 100644
--- a/gdb/testsuite/gdb.base/attach.exp
+++ b/gdb/testsuite/gdb.base/attach.exp
@@ -30,12 +30,9 @@ if [is_remote target] then {
return 0
}
-set testfile "attach"
-set srcfile ${testfile}.c
-set srcfile2 ${testfile}2.c
-set binfile ${objdir}/${subdir}/${testfile}
-set binfile2 ${objdir}/${subdir}/${testfile}2
-set escapedbinfile [string_to_regexp ${objdir}/${subdir}/${testfile}]
+standard_testfile attach.c attach2.c
+set binfile2 ${binfile}2
+set escapedbinfile [string_to_regexp $binfile]
#execute_anywhere "rm -f ${binfile} ${binfile2}"
remote_exec build "rm -f ${binfile} ${binfile2}"
@@ -67,7 +64,6 @@ proc do_attach_tests {} {
global escapedbinfile
global srcfile
global testfile
- global objdir
global subdir
global timeout
@@ -298,7 +294,7 @@ proc do_attach_tests {} {
# when we're cd'd to some directory that doesn't contain the
# a.out. (We use the source path set by the "dir" command.)
- gdb_test "dir ${objdir}/${subdir}" "Source directories searched: .*" \
+ gdb_test "dir [standard_output_file {}]" "Source directories searched: .*" \
"set source path"
gdb_test "cd /tmp" "Working directory /tmp." \
diff --git a/gdb/testsuite/gdb.base/auxv.exp b/gdb/testsuite/gdb.base/auxv.exp
index b1d0662..ab51b2c 100644
--- a/gdb/testsuite/gdb.base/auxv.exp
+++ b/gdb/testsuite/gdb.base/auxv.exp
@@ -24,11 +24,10 @@ if { ! [istarget "*-*-linux*"] && ! [istarget "*-*-solaris*"] } {
}
-set testfile "auxv"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-set corefile ${objdir}/${subdir}/${testfile}.corefile
-set gcorefile ${objdir}/${subdir}/${testfile}.gcore
+standard_testfile .c
+
+set corefile ${binfile}.corefile
+set gcorefile ${binfile}.gcore
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \
{debug additional_flags=-DUSE_RLIMIT}] != ""
@@ -40,16 +39,13 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \
# Use a fresh directory to confine the native core dumps.
# Make it the working directory for gdb and its child.
-set coredir "${objdir}/${subdir}/coredir.[getpid]"
+set coredir [standard_output_file coredir.[getpid]]
file mkdir $coredir
set core_works [expr [isnative] && ! [is_remote target]]
# Run GDB on the test program up to where it will dump core.
-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"
diff --git a/gdb/testsuite/gdb.base/bang.exp b/gdb/testsuite/gdb.base/bang.exp
index e1ef8cf..6fd3a59 100644
--- a/gdb/testsuite/gdb.base/bang.exp
+++ b/gdb/testsuite/gdb.base/bang.exp
@@ -16,20 +16,14 @@
# This is a test that verifies that GDB is able to "run" when the name
# of the executable file contains a '!'.
-set testfile "args"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/bang!
+standard_testfile args.c
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
+if {[prepare_for_testing $testfile.exp ${testfile}! $srcfile \
+ {debug nowarnings}]} {
untested bang.exp
return -1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
# Verify that we can run the program and that it terminates normally.
gdb_run_cmd
diff --git a/gdb/testsuite/gdb.base/bfp-test.exp b/gdb/testsuite/gdb.base/bfp-test.exp
index 5c55308..42830c4 100644
--- a/gdb/testsuite/gdb.base/bfp-test.exp
+++ b/gdb/testsuite/gdb.base/bfp-test.exp
@@ -16,18 +16,14 @@
# This file is part of the gdb testsuite. It is intended to test that
# gdb could correctly handle floating point constant with a suffix.
-set testfile "bfp-test"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
+
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
untested "Couldn't compile ${srcfile}"
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/bigcore.exp b/gdb/testsuite/gdb.base/bigcore.exp
index 5cc0144..ac3c5fb 100644
--- a/gdb/testsuite/gdb.base/bigcore.exp
+++ b/gdb/testsuite/gdb.base/bigcore.exp
@@ -46,10 +46,8 @@ if { [istarget "*-*-*irix*"] } {
return
}
-set testfile "bigcore"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-set corefile ${objdir}/${subdir}/${testfile}.corefile
+standard_testfile .c
+set corefile ${binfile}.corefile
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
untested bigcore.exp
@@ -58,10 +56,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
# Run GDB on the bigcore program up-to where it will dump core.
-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"
diff --git a/gdb/testsuite/gdb.base/bitfields.exp b/gdb/testsuite/gdb.base/bitfields.exp
index a5b85ea..ceba529 100644
--- a/gdb/testsuite/gdb.base/bitfields.exp
+++ b/gdb/testsuite/gdb.base/bitfields.exp
@@ -16,11 +16,10 @@
# This file was written by Fred Fish. (fnf@cygnus.com)
-set testfile "bitfields"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
- untested bitfields.exp
+standard_testfile
+
+if {[prepare_for_testing $testfile.exp $testfile $srcfile debug]} {
+ untested $testfile.exp
return -1
}
@@ -270,10 +269,6 @@ proc bitfield_internalvar {} {
gdb_test "print \$myvar.f" "\\$\[0-9\]\+ = -1"
}
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
gdb_test_no_output "set print sevenbit-strings"
bitfield_uniqueness
diff --git a/gdb/testsuite/gdb.base/bitfields2.exp b/gdb/testsuite/gdb.base/bitfields2.exp
index 843da17..41a9e3b 100644
--- a/gdb/testsuite/gdb.base/bitfields2.exp
+++ b/gdb/testsuite/gdb.base/bitfields2.exp
@@ -23,9 +23,8 @@
#
-set testfile "bitfields2"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
+
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
untested bitfields2.exp
return -1
@@ -279,9 +278,7 @@ proc bitfield_set {} {
gdb_stop_suppressing_tests
}
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
gdb_test_no_output "set print sevenbit-strings"
runto_main
diff --git a/gdb/testsuite/gdb.base/break-entry.exp b/gdb/testsuite/gdb.base/break-entry.exp
index 78f65db..69484e7 100644
--- a/gdb/testsuite/gdb.base/break-entry.exp
+++ b/gdb/testsuite/gdb.base/break-entry.exp
@@ -25,14 +25,14 @@
# continues the process with the equivalent of "jump *$PC", which
# triggers any breakpoint at $PC. The latter is what we want to test.
-set testfile break-entry
+standard_testfile start.c
if [target_info exists use_gdb_stub] {
untested ${testfile}.exp
return
}
-if { [prepare_for_testing ${testfile}.exp ${testfile} start.c {additional_flags=-static}] } {
+if { [prepare_for_testing ${testfile}.exp ${testfile} $srcfile {additional_flags=-static}] } {
return -1
}
diff --git a/gdb/testsuite/gdb.base/break-interp.exp b/gdb/testsuite/gdb.base/break-interp.exp
index 8707e3b..fe9cbb4 100644
--- a/gdb/testsuite/gdb.base/break-interp.exp
+++ b/gdb/testsuite/gdb.base/break-interp.exp
@@ -22,11 +22,11 @@ if { ![isnative] || [is_remote host] || [target_info exists use_gdb_stub]
load_lib prelink-support.exp
set test "break-interp"
-set binprefix ${objdir}/${subdir}/${test}
+set binprefix [standard_output_file ${test}]
# Only to get the $interp_system name.
set srcfile_test "start.c"
set binfile_test ${test}-test
-set binfile_lib ${objdir}/${subdir}/${test}.so
+set binfile_lib ${binprefix}.so
set srcfile "${test}-main.c"
set srcfile_lib "${test}-lib.c"
@@ -83,7 +83,7 @@ gdb_test_multiple $test $test {
}
}
-set interp_system [section_get ${objdir}/${subdir}/$binfile_test .interp]
+set interp_system [section_get [standard_output_file $binfile_test] .interp]
set interp_system_debug [system_debug_get $interp_system]
verbose -log "$interp_system has debug $interp_system_debug"
@@ -390,10 +390,11 @@ proc test_ld {file ifmain trynosym displacement} {
if $ifmain {
gdb_test_no_output "set args segv"
} else {
- global objdir binfile_test
+ global binfile_test
# ld.so needs some executable to run to reach _dl_debug_state.
- gdb_test_no_output "set args ${objdir}/${subdir}/$binfile_test" "set args OBJDIR/${subdir}/$binfile_test"
+ gdb_test_no_output "set args [standard_output_file $binfile_test]" \
+ "set args OBJDIR/${subdir}/$binfile_test"
}
reach $solib_bp "run" $displacement
diff --git a/gdb/testsuite/gdb.base/break-on-linker-gcd-function.exp b/gdb/testsuite/gdb.base/break-on-linker-gcd-function.exp
index 13db347..7a4ef83 100644
--- a/gdb/testsuite/gdb.base/break-on-linker-gcd-function.exp
+++ b/gdb/testsuite/gdb.base/break-on-linker-gcd-function.exp
@@ -25,23 +25,19 @@
#
if { [skip_cplus_tests] } { continue }
-set testfile "break-on-linker-gcd-function"
-set srcfile ${testfile}.cc
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .cc
if [get_compiler_info "c++"] {
return -1
}
set additional_flags {-ffunction-sections -Wl,--gc-sections}
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \
- [list debug c++ additional_flags=$additional_flags]] != "" } {
- untested $srcfile
+if {[prepare_for_testing $testfile.exp $testfile $srcfile \
+ [list debug c++ additional_flags=$additional_flags]]} {
+ untested $testfile.exp
return -1
}
-clean_restart $testfile
-
# Single hex digit
set xd {[0-9a-f]}
diff --git a/gdb/testsuite/gdb.base/breakpoint-shadow.exp b/gdb/testsuite/gdb.base/breakpoint-shadow.exp
index dc96274..009c6df 100644
--- a/gdb/testsuite/gdb.base/breakpoint-shadow.exp
+++ b/gdb/testsuite/gdb.base/breakpoint-shadow.exp
@@ -13,19 +13,13 @@
# 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 breakpoint-shadow
-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
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
# We need to start the inferior to place the breakpoints in the memory at all.
if ![runto_main] {
untested start