aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-06-27 19:00:47 +0000
committerTom Tromey <tromey@redhat.com>2013-06-27 19:00:47 +0000
commit62cef5152a9ce7e5ddb906e4ea6bb4e70407f23b (patch)
tree1bc376a29f3833a00d6da755ec6aa46072eec0cf
parent0ab77f5fa21b665be0d099ea8eca2485c2d58f93 (diff)
downloadgdb-62cef5152a9ce7e5ddb906e4ea6bb4e70407f23b.zip
gdb-62cef5152a9ce7e5ddb906e4ea6bb4e70407f23b.tar.gz
gdb-62cef5152a9ce7e5ddb906e4ea6bb4e70407f23b.tar.bz2
test suite update - gdb.base/[t-z]
Convert files gdb.base/[t-z]*.exp to use standard_output_file et al. * gdb.base/testenv.exp, gdb.base/tui-layout.exp, gdb.base/twice.exp, gdb.base/type-opaque.exp, gdb.base/unload.exp, gdb.base/unwindonsignal.exp, gdb.base/valgrind-db-attach.exp, gdb.base/valgrind-infcall.exp, gdb.base/value-double-free.exp, gdb.base/varargs.exp, gdb.base/watch-cond-infcall.exp, gdb.base/watch-cond.exp, gdb.base/watch-non-mem.exp, gdb.base/watch-read.exp, gdb.base/watch-vfork.exp, gdb.base/watch_thread_num.exp, gdb.base/watchpoint-cond-gone.exp, gdb.base/watchpoint-delete.exp, gdb.base/watchpoint-hw.exp, gdb.base/watchpoint-solib.exp, gdb.base/watchpoint.exp, gdb.base/watchpoints.exp, gdb.base/wchar.exp, gdb.base/whatis.exp: Use standard_testfile, standard_output_file, prepare_for_testing, clean_restart.
-rw-r--r--gdb/testsuite/ChangeLog16
-rw-r--r--gdb/testsuite/gdb.base/testenv.exp4
-rw-r--r--gdb/testsuite/gdb.base/tui-layout.exp5
-rw-r--r--gdb/testsuite/gdb.base/twice.exp14
-rw-r--r--gdb/testsuite/gdb.base/type-opaque.exp13
-rw-r--r--gdb/testsuite/gdb.base/unload.exp8
-rw-r--r--gdb/testsuite/gdb.base/unwindonsignal.exp19
-rw-r--r--gdb/testsuite/gdb.base/valgrind-db-attach.exp7
-rw-r--r--gdb/testsuite/gdb.base/valgrind-infcall.exp9
-rw-r--r--gdb/testsuite/gdb.base/value-double-free.exp16
-rw-r--r--gdb/testsuite/gdb.base/varargs.exp10
-rw-r--r--gdb/testsuite/gdb.base/watch-cond-infcall.exp4
-rw-r--r--gdb/testsuite/gdb.base/watch-cond.exp4
-rw-r--r--gdb/testsuite/gdb.base/watch-non-mem.exp4
-rw-r--r--gdb/testsuite/gdb.base/watch-read.exp3
-rw-r--r--gdb/testsuite/gdb.base/watch-vfork.exp6
-rw-r--r--gdb/testsuite/gdb.base/watch_thread_num.exp9
-rw-r--r--gdb/testsuite/gdb.base/watchpoint-cond-gone.exp14
-rw-r--r--gdb/testsuite/gdb.base/watchpoint-delete.exp4
-rw-r--r--gdb/testsuite/gdb.base/watchpoint-hw.exp14
-rw-r--r--gdb/testsuite/gdb.base/watchpoint-solib.exp6
-rw-r--r--gdb/testsuite/gdb.base/watchpoint.exp4
-rw-r--r--gdb/testsuite/gdb.base/watchpoints.exp17
-rw-r--r--gdb/testsuite/gdb.base/wchar.exp4
-rw-r--r--gdb/testsuite/gdb.base/whatis.exp10
25 files changed, 81 insertions, 143 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index ca53806..9727afc 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,21 @@
2013-06-27 Tom Tromey <tromey@redhat.com>
+ * gdb.base/testenv.exp, gdb.base/tui-layout.exp,
+ gdb.base/twice.exp, gdb.base/type-opaque.exp, gdb.base/unload.exp,
+ gdb.base/unwindonsignal.exp, gdb.base/valgrind-db-attach.exp,
+ gdb.base/valgrind-infcall.exp, gdb.base/value-double-free.exp,
+ gdb.base/varargs.exp, gdb.base/watch-cond-infcall.exp,
+ gdb.base/watch-cond.exp, gdb.base/watch-non-mem.exp,
+ gdb.base/watch-read.exp, gdb.base/watch-vfork.exp,
+ gdb.base/watch_thread_num.exp, gdb.base/watchpoint-cond-gone.exp,
+ gdb.base/watchpoint-delete.exp, gdb.base/watchpoint-hw.exp,
+ gdb.base/watchpoint-solib.exp, gdb.base/watchpoint.exp,
+ gdb.base/watchpoints.exp, gdb.base/wchar.exp, gdb.base/whatis.exp:
+ Use standard_testfile, standard_output_file, prepare_for_testing,
+ clean_restart.
+
+2013-06-27 Tom Tromey <tromey@redhat.com>
+
* gdb.base/save-bp.exp, gdb.base/savedregs.exp,
gdb.base/scope.exp, gdb.base/sep.exp, gdb.base/sepsymtab.exp,
gdb.base/set-lang-auto.exp, gdb.base/setshow.exp,
diff --git a/gdb/testsuite/gdb.base/testenv.exp b/gdb/testsuite/gdb.base/testenv.exp
index ae8d2fa..e9a4d3d 100644
--- a/gdb/testsuite/gdb.base/testenv.exp
+++ b/gdb/testsuite/gdb.base/testenv.exp
@@ -23,9 +23,7 @@ if { [is_remote target] } {
return 0
}
-set testfile "testenv"
-set srcfile ${testfile}.c
-set binfile ${testfile}
+standard_testfile .c
# Compile binary
# and start with a fresh gdb
diff --git a/gdb/testsuite/gdb.base/tui-layout.exp b/gdb/testsuite/gdb.base/tui-layout.exp
index 265ead4..8f97b54 100644
--- a/gdb/testsuite/gdb.base/tui-layout.exp
+++ b/gdb/testsuite/gdb.base/tui-layout.exp
@@ -13,8 +13,9 @@
# 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 tui-layout
-if { [prepare_for_testing ${testfile}.exp ${testfile} start.c] } {
+standard_testfile start.c
+
+if { [prepare_for_testing ${testfile}.exp ${testfile} $srcfile] } {
return -1
}
diff --git a/gdb/testsuite/gdb.base/twice.exp b/gdb/testsuite/gdb.base/twice.exp
index fada7a1..936ddcb 100644
--- a/gdb/testsuite/gdb.base/twice.exp
+++ b/gdb/testsuite/gdb.base/twice.exp
@@ -14,29 +14,25 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-set testfile twice-tmp
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_output_file twice.c
set options debug
lappend options "additional_flags=-I."
-set fileid [open ${objdir}/${subdir}/${srcfile} w]
+set local_srcfile [standard_output_file twice-tmp.c]
+set fileid [open $local_srcfile w]
puts $fileid "#include \"twice.c\""
close $fileid
remote_download host ${srcdir}/${subdir}/twice.c twice.c
-if { [gdb_compile "${objdir}/${subdir}/${srcfile}" "${binfile}" executable $options] != "" } {
+if { [gdb_compile $local_srcfile "${binfile}" executable $options] != "" } {
untested twice.exp
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 {
# Test that GDB can still detect whether we have line numbers
diff --git a/gdb/testsuite/gdb.base/type-opaque.exp b/gdb/testsuite/gdb.base/type-opaque.exp
index 633d763..7caaeb1 100644
--- a/gdb/testsuite/gdb.base/type-opaque.exp
+++ b/gdb/testsuite/gdb.base/type-opaque.exp
@@ -19,13 +19,11 @@ if {[skip_shlib_tests]} {
return -1
}
-set testfile type-opaque-main
-set libfile type-opaque-lib
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile type-opaque-main.c
+set libfile type-opaque-lib
set libsrc "${srcdir}/${subdir}/${libfile}.c"
-set libobj "${objdir}/${subdir}/${libfile}.so"
+set libobj [standard_output_file ${libfile}.so]
set execsrc "${srcdir}/${subdir}/${srcfile}"
remote_exec build "rm -f ${binfile}"
@@ -41,10 +39,7 @@ if { [gdb_compile_shlib $libsrc $libobj {debug}] != ""
return -1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
gdb_load_shlibs ${libobj}
if ![runto_main] then {
diff --git a/gdb/testsuite/gdb.base/unload.exp b/gdb/testsuite/gdb.base/unload.exp
index 9198b3d..adb2f05 100644
--- a/gdb/testsuite/gdb.base/unload.exp
+++ b/gdb/testsuite/gdb.base/unload.exp
@@ -31,12 +31,12 @@ set libname2 "${libfile2}.sl"
set libsrcfile ${libfile}.c
set libsrcfile2 ${libfile2}.c
set srcfile $srcdir/$subdir/$testfile.c
-set binfile $objdir/$subdir/$testfile
-set shlibdir ${objdir}/${subdir}
+set binfile [standard_output_file $testfile]
+set shlibdir [standard_output_file {}]
set libsrc $srcdir/$subdir/$libfile.c
set libsrc2 $srcdir/$subdir/$libfile2.c
-set lib_sl $objdir/$subdir/$libname
-set lib_sl2 $objdir/$subdir/$libname2
+set lib_sl [standard_output_file $libname]
+set lib_sl2 [standard_output_file $libname2]
set lib_dlopen [shlib_target_file ${libname}]
set lib_dlopen2 [shlib_target_file ${libname2}]
set lib_syms [shlib_symbol_file ${libname}]
diff --git a/gdb/testsuite/gdb.base/unwindonsignal.exp b/gdb/testsuite/gdb.base/unwindonsignal.exp
index cba27aa..c3c040f 100644
--- a/gdb/testsuite/gdb.base/unwindonsignal.exp
+++ b/gdb/testsuite/gdb.base/unwindonsignal.exp
@@ -24,15 +24,6 @@ if [target_info exists gdb,nosignals] {
}
-set testfile "unwindonsignal"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
- untested unwindonsignal.exp
- return -1
-}
-
# Some targets can't do function calls, so don't even bother with this
# test.
if [target_info exists gdb,cannot_call_functions] {
@@ -41,12 +32,12 @@ if [target_info exists gdb,cannot_call_functions] {
continue
}
-# Start with a fresh gdb.
+standard_testfile
-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_main] } {
fail "Can't run to main"
diff --git a/gdb/testsuite/gdb.base/valgrind-db-attach.exp b/gdb/testsuite/gdb.base/valgrind-db-attach.exp
index b1e1ec6..56c6914 100644
--- a/gdb/testsuite/gdb.base/valgrind-db-attach.exp
+++ b/gdb/testsuite/gdb.base/valgrind-db-attach.exp
@@ -18,11 +18,8 @@ if [is_remote target] {
return 0
}
-set test valgrind-db-attach
-set srcfile $test.c
-set executable $test
-set binfile ${objdir}/${subdir}/${executable}
-if {[build_executable $test.exp $executable $srcfile {debug}] == -1} {
+standard_testfile .c
+if {[build_executable $testfile.exp $testfile $srcfile {debug}] == -1} {
return -1
}
diff --git a/gdb/testsuite/gdb.base/valgrind-infcall.exp b/gdb/testsuite/gdb.base/valgrind-infcall.exp
index 6d2893a..349b32d 100644
--- a/gdb/testsuite/gdb.base/valgrind-infcall.exp
+++ b/gdb/testsuite/gdb.base/valgrind-infcall.exp
@@ -18,11 +18,8 @@ if [is_remote target] {
return 0
}
-set test valgrind-infcall
-set srcfile $test.c
-set executable $test
-set binfile ${objdir}/${subdir}/${executable}
-if {[build_executable $test.exp $executable $srcfile {debug}] == -1} {
+standard_testfile .c
+if {[build_executable $testfile.exp $testfile $srcfile {debug}] == -1} {
return -1
}
@@ -84,7 +81,7 @@ unset gdb_spawn_id
set board [host_info name]
unset_board_info fileid
-clean_restart $executable
+clean_restart $testfile
gdb_test "$vgdbcmd" " in \\.?_start .*" "target remote for vgdb"
diff --git a/gdb/testsuite/gdb.base/value-double-free.exp b/gdb/testsuite/gdb.base/value-double-free.exp
index f3d098f..f47a454 100644
--- a/gdb/testsuite/gdb.base/value-double-free.exp
+++ b/gdb/testsuite/gdb.base/value-double-free.exp
@@ -13,21 +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 value-double-free
-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}
-
if ![runto_main] {
return -1
}
diff --git a/gdb/testsuite/gdb.base/varargs.exp b/gdb/testsuite/gdb.base/varargs.exp
index 70de81d..7a427ff 100644
--- a/gdb/testsuite/gdb.base/varargs.exp
+++ b/gdb/testsuite/gdb.base/varargs.exp
@@ -30,9 +30,8 @@
set prototypes 0
-set testfile "varargs"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+
+standard_testfile .c
if [get_compiler_info] {
return -1
@@ -56,10 +55,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
# 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/watch-cond-infcall.exp b/gdb/testsuite/gdb.base/watch-cond-infcall.exp
index 403ec84..5dcec5b 100644
--- a/gdb/testsuite/gdb.base/watch-cond-infcall.exp
+++ b/gdb/testsuite/gdb.base/watch-cond-infcall.exp
@@ -16,9 +16,7 @@
# Test for watchpoints with conditions that involve inferior function
# calls.
-set testfile "watch-cond-infcall"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
if { [build_executable ${testfile}.exp ${testfile} ${testfile}.c {debug}] } {
untested ${testfile}.exp
diff --git a/gdb/testsuite/gdb.base/watch-cond.exp b/gdb/testsuite/gdb.base/watch-cond.exp
index 184aacc..2f2a05b 100644
--- a/gdb/testsuite/gdb.base/watch-cond.exp
+++ b/gdb/testsuite/gdb.base/watch-cond.exp
@@ -17,9 +17,7 @@
# Tests involving watchpoint conditions with local expressions.
#
-set testfile "watch-cond"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
untested ${testfile}.exp
diff --git a/gdb/testsuite/gdb.base/watch-non-mem.exp b/gdb/testsuite/gdb.base/watch-non-mem.exp
index cb08985..7e7e2bc 100644
--- a/gdb/testsuite/gdb.base/watch-non-mem.exp
+++ b/gdb/testsuite/gdb.base/watch-non-mem.exp
@@ -17,9 +17,7 @@
# Tests watchpoints that watch expressions that don't involve memory.
#
-set testfile "watch-non-mem"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
untested ${testfile}.exp
diff --git a/gdb/testsuite/gdb.base/watch-read.exp b/gdb/testsuite/gdb.base/watch-read.exp
index 9a5e388..95a6964 100644
--- a/gdb/testsuite/gdb.base/watch-read.exp
+++ b/gdb/testsuite/gdb.base/watch-read.exp
@@ -22,8 +22,7 @@
# watching the same memory as read watchpoints.
#
-set testfile "watch-read"
-set srcfile ${testfile}.c
+standard_testfile .c
if {[skip_hw_watchpoint_access_tests]} {
return 0
diff --git a/gdb/testsuite/gdb.base/watch-vfork.exp b/gdb/testsuite/gdb.base/watch-vfork.exp
index 51d8eae6..bb14147 100644
--- a/gdb/testsuite/gdb.base/watch-vfork.exp
+++ b/gdb/testsuite/gdb.base/watch-vfork.exp
@@ -20,9 +20,9 @@ if { [is_remote target] } {
return 0
}
-global srcfile
-set testfile "watch-vfork"
-if { [build_executable ${testfile}.exp ${testfile} ${testfile}.c {debug}] } {
+standard_testfile .c
+
+if { [build_executable ${testfile}.exp ${testfile} $srcfile {debug}] } {
untested ${testfile}.exp
return -1
}
diff --git a/gdb/testsuite/gdb.base/watch_thread_num.exp b/gdb/testsuite/gdb.base/watch_thread_num.exp
index d8995fc..fb02917 100644
--- a/gdb/testsuite/gdb.base/watch_thread_num.exp
+++ b/gdb/testsuite/gdb.base/watch_thread_num.exp
@@ -25,9 +25,7 @@ if {[skip_hw_watchpoint_tests]} {
return 0
}
-set testfile watch_thread_num
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
# What compiler are we using?
#
@@ -39,10 +37,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 "run to main"
diff --git a/gdb/testsuite/gdb.base/watchpoint-cond-gone.exp b/gdb/testsuite/gdb.base/watchpoint-cond-gone.exp
index 44f1f7e..9c908ca 100644
--- a/gdb/testsuite/gdb.base/watchpoint-cond-gone.exp
+++ b/gdb/testsuite/gdb.base/watchpoint-cond-gone.exp
@@ -13,24 +13,18 @@
# 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 "watchpoint-cond-gone"
-set srcfile ${testfile}.c
-set srcfilestripped ${testfile}-stripped.c
-set objfilestripped ${objdir}/${subdir}/${testfile}-stripped.o
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c watchpoint-cond-gone-stripped.c
# We need to generate a function without DWARF to crash older GDB.
# Stepping into a dynamic function trampoline or stepping out of MAIN may work
# but it is not a reliable FAIL case.
-if { [gdb_compile "${srcdir}/${subdir}/${srcfilestripped}" "${objfilestripped}" object {}] != ""
- || [gdb_compile "${srcdir}/${subdir}/${srcfile} ${objfilestripped}" "${binfile}" executable {debug}] != "" } {
- untested watchpoint-cond-gone.exp
+if {[prepare_for_testing_full $testfile.exp \
+ [list $testfile debug $srcfile debug $srcfile2 {}]]} {
+ untested $testfile.exp
return -1
}
-clean_restart ${testfile}
-
# Problem does not occur otherwise.
gdb_test_no_output "set can-use-hw-watchpoints 0"
diff --git a/gdb/testsuite/gdb.base/watchpoint-delete.exp b/gdb/testsuite/gdb.base/watchpoint-delete.exp
index 0a32f1e..6fc1042 100644
--- a/gdb/testsuite/gdb.base/watchpoint-delete.exp
+++ b/gdb/testsuite/gdb.base/watchpoint-delete.exp
@@ -13,9 +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 "watchpoint-delete"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
untested ${testfile}.exp
diff --git a/gdb/testsuite/gdb.base/watchpoint-hw.exp b/gdb/testsuite/gdb.base/watchpoint-hw.exp
index a1e4def..9021f41 100644
--- a/gdb/testsuite/gdb.base/watchpoint-hw.exp
+++ b/gdb/testsuite/gdb.base/watchpoint-hw.exp
@@ -18,19 +18,13 @@ if {[skip_hw_watchpoint_tests]} {
return 0
}
-set testfile watchpoint-hw
-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}
-
# Create the watchpoint before the inferior gets started. Now the native CPU
# target is still not active and its `to_can_use_hw_breakpoint' is not
# installed, therefore only a software watchpoint gets created.
diff --git a/gdb/testsuite/gdb.base/watchpoint-solib.exp b/gdb/testsuite/gdb.base/watchpoint-solib.exp
index b4fdb69..03ccf44 100644
--- a/gdb/testsuite/gdb.base/watchpoint-solib.exp
+++ b/gdb/testsuite/gdb.base/watchpoint-solib.exp
@@ -26,10 +26,10 @@ set libfile "watchpoint-solib-shr"
set libname "${libfile}.sl"
set libsrcfile ${libfile}.c
set srcfile $srcdir/$subdir/$testfile.c
-set binfile $objdir/$subdir/$testfile
-set shlibdir ${objdir}/${subdir}
+set binfile [standard_output_file $testfile]
+set shlibdir [standard_output_file {}]
set libsrc $srcdir/$subdir/$libfile.c
-set lib_sl $objdir/$subdir/$libname
+set lib_sl [standard_output_file $libname]
set lib_dlopen [shlib_target_file ${libname}]
set lib_syms [shlib_symbol_file ${libname}]
diff --git a/gdb/testsuite/gdb.base/watchpoint.exp b/gdb/testsuite/gdb.base/watchpoint.exp
index 5961ef6..e0f7adc 100644
--- a/gdb/testsuite/gdb.base/watchpoint.exp
+++ b/gdb/testsuite/gdb.base/watchpoint.exp
@@ -16,9 +16,7 @@
# This file was written by Fred Fish. (fnf@cygnus.com)
-set testfile "watchpoint"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
if [get_compiler_info] {
return -1
diff --git a/gdb/testsuite/gdb.base/watchpoints.exp b/gdb/testsuite/gdb.base/watchpoints.exp
index c26b766..7c10d81 100644
--- a/gdb/testsuite/gdb.base/watchpoints.exp
+++ b/gdb/testsuite/gdb.base/watchpoints.exp
@@ -16,9 +16,7 @@
# This file was written by Pierre Muller. (muller@ics.u-strasbg.fr)
-set testfile "watchpoints"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
set wp_set 1
@@ -26,18 +24,11 @@ if [get_compiler_info] {
return -1
}
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
- untested watchpoint.exp
- return -1
+if {[prepare_for_testing $testfile.exp $testfile $srcfile debug]} {
+ untested $testfile.exp
+ return -1
}
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load $binfile
-
# Disable hardware watchpoints if necessary.
if [target_info exists gdb,no_hardware_watchpoints] {
gdb_test_no_output "set can-use-hw-watchpoints 0" ""
diff --git a/gdb/testsuite/gdb.base/wchar.exp b/gdb/testsuite/gdb.base/wchar.exp
index 8757cca..b3d3019 100644
--- a/gdb/testsuite/gdb.base/wchar.exp
+++ b/gdb/testsuite/gdb.base/wchar.exp
@@ -13,8 +13,8 @@
# 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 wchar
-set srcfile ${testfile}.c
+standard_testfile .c
+
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
return -1
}
diff --git a/gdb/testsuite/gdb.base/whatis.exp b/gdb/testsuite/gdb.base/whatis.exp
index 40f317a..7cfaf2b 100644
--- a/gdb/testsuite/gdb.base/whatis.exp
+++ b/gdb/testsuite/gdb.base/whatis.exp
@@ -25,9 +25,8 @@ if [target_info exists no_long_long] {
set exec_opts [list debug]
}
-set testfile whatis
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
+
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $exec_opts] != "" } {
untested whatis.exp
return -1
@@ -41,10 +40,7 @@ if [get_compiler_info] {
# Start with a fresh gdb.
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load $binfile
+clean_restart $binfile
# Define a procedure to set up an xfail for all targets that put out a
# `long' type as an `int' type.