Convert files gdb.base/[n-r]*.exp to use standard_output_file et al.
* gdb.base/nextoverexit.exp, gdb.base/nextoverexit.exp,
gdb.base/nodebug.exp, gdb.base/nofield.exp, gdb.base/nostdlib.exp,
gdb.base/opaque.exp, gdb.base/overlays.exp, gdb.base/pc-fp.exp,
gdb.base/pending.exp, gdb.base/permissions.exp,
gdb.base/pie-execl.exp, gdb.base/pointers.exp,
gdb.base/pr11022.exp, gdb.base/print-file-var.exp,
gdb.base/printcmds.exp, gdb.base/prologue.exp,
gdb.base/psymtab.exp, gdb.base/ptr-typedef.exp,
gdb.base/ptype.exp, gdb.base/randomize.exp,
gdb.base/readline-ask.exp, gdb.base/recpar.exp,
gdb.base/recurse.exp, gdb.base/relativedebug.exp,
gdb.base/relocate.exp, gdb.base/remote.exp, gdb.base/reread.exp,
gdb.base/return-nodebug.exp, gdb.base/return2.exp: Use
standard_testfile, standard_output_file, prepare_for_testing,
clean_restart.
+2013-06-27 Tom Tromey <tromey@redhat.com>
+
+ * gdb.base/nextoverexit.exp, gdb.base/nextoverexit.exp,
+ gdb.base/nodebug.exp, gdb.base/nofield.exp, gdb.base/nostdlib.exp,
+ gdb.base/opaque.exp, gdb.base/overlays.exp, gdb.base/pc-fp.exp,
+ gdb.base/pending.exp, gdb.base/permissions.exp,
+ gdb.base/pie-execl.exp, gdb.base/pointers.exp,
+ gdb.base/pr11022.exp, gdb.base/print-file-var.exp,
+ gdb.base/printcmds.exp, gdb.base/prologue.exp,
+ gdb.base/psymtab.exp, gdb.base/ptr-typedef.exp,
+ gdb.base/ptype.exp, gdb.base/randomize.exp,
+ gdb.base/readline-ask.exp, gdb.base/recpar.exp,
+ gdb.base/recurse.exp, gdb.base/relativedebug.exp,
+ gdb.base/relocate.exp, gdb.base/remote.exp, gdb.base/reread.exp,
+ gdb.base/return-nodebug.exp, gdb.base/return2.exp: Use
+ standard_testfile, standard_output_file, prepare_for_testing,
+ clean_restart.
+
2013-06-27 Tom Tromey <tromey@redhat.com>
* hook-stop-continue.exp, hook-stop-frame.exp, huge.exp,
# 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 "nextoverexit"
-set executable $testfile
-set srcfile $testfile.c
-set binfile $objdir/$subdir/$testfile
+standard_testfile
if {[prepare_for_testing $testfile.exp $testfile $testfile.c]} {
return -1
# Test that things still (sort of) work when compiled without -g.
-set testfile nodebug
-set srcfile $srcdir/$subdir/$testfile.c
-set binfile $objdir/$subdir/$testfile
+standard_testfile .c
if [get_compiler_info] {
return -1
set exec_opts ""
}
-if { [gdb_compile $srcfile $binfile executable $exec_opts] != "" } {
+if { [gdb_compile $srcdir/$subdir/$srcfile $binfile executable $exec_opts] != "" } {
untested "Couldn't compile $srcfile."
return -1
}
# Start with a fresh gdb.
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load $binfile
+clean_restart $binfile
if [runto inner] then {
# 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 "nofield"
-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
set eol "\[\r\n\]+"
set sp "\[ \t\]*"
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
gdb_test "ptype struct not_empty" \
"type = struct not_empty {$eol${sp}void \\*e;$eol${sp}void \\*u;$eol}" \
# 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 "nostdlib"
-set srcfile ${testfile}.c
-set executable ${testfile}
-set binfile ${objdir}/${subdir}/${executable}
+standard_testfile .c
# If we're using a stub, breakpoints at the entry point will not trigger.
# See also the comment in break-entry.exp.
return -1
}
-clean_restart $executable
+clean_restart $binfile
gdb_breakpoint "*marker"
gdb_breakpoint "*_start"
# This file was written by Fred Fish. (fnf@cygnus.com)
-set testfile "opaque"
-set binfile ${objdir}/${subdir}/opaque
-
-#if { [gdb_compile "${srcdir}/${subdir}/opaque0.c ${srcdir}/${subdir}/opaque1.c" "${binfile}" executable {debug}] != "" } {
-# gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
-#}
-
-if { [gdb_compile "${srcdir}/${subdir}/opaque0.c" "${binfile}0.o" object {debug}] != "" } {
- untested opaque.exp
- return -1
-}
-
-if { [gdb_compile "${srcdir}/${subdir}/opaque1.c" "${binfile}1.o" object {debug}] != "" } {
- untested opaque.exp
- return -1
-}
-
-if { [gdb_compile "${binfile}0.o ${binfile}1.o" ${binfile} executable {debug}] != "" } {
- untested opaque.exp
- return -1
-}
-
-
# Create and source the file that provides information about the compiler
# used to compile the test case.
if [get_compiler_info] {
return -1
}
-# Start with a fresh gdb.
+standard_testfile opaque0.c opaque1.c
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+if {[prepare_for_testing $testfile.exp $testfile \
+ [list $srcfile $srcfile2] debug]} {
+ untested $testfile.exp
+ return -1
+}
#
# Test basic opaque structure handling (statically).
return
}
-set testfile "overlays"
-set binfile ${objdir}/${subdir}/${testfile}
-set srcfile ${testfile}.c
+standard_testfile overlays.c ovlymgr.c foo.c bar.c baz.c grbx.c
-if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${testfile}.o" object {debug}] != ""} then {
- untested overlays.exp
- return -1
-}
-if {[gdb_compile "${srcdir}/${subdir}/ovlymgr.c" ovlymgr.o object {debug}] != ""} then {
- untested overlays.exp
- return -1
-}
-if {[gdb_compile "${srcdir}/${subdir}/foo.c" foo.o object {debug} ] != ""} then {
- untested overlays.exp
- return -1
-}
-
-if {[gdb_compile "${srcdir}/${subdir}/bar.c" bar.o object {debug}] != ""} then {
- untested overlays.exp
- return -1
-}
-if {[gdb_compile "${srcdir}/${subdir}/baz.c" baz.o object {debug}] != ""} then {
- untested overlays.exp
- return -1
-}
-if {[gdb_compile "${srcdir}/${subdir}/grbx.c" grbx.o object {debug}] != ""} then {
- untested overlays.exp
- return -1
-}
-if {[gdb_compile "${testfile}.o ovlymgr.o foo.o bar.o baz.o grbx.o" ${binfile} executable "ldscript=-Wl,-T$linker_script"] != "" } {
+if {[build_executable $testfile.exp $testfile \
+ [list $srcfile $srcfile2 $srcfile3 $srcfile4 $srcfile5 $srcfile6] \
+ {debug ldscript=-Wl,-T$linker_script}] == -1} {
untested overlays.exp
return -1
}
# test running programs
#
-set testfile "pc-fp"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
- untested pc-fp.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
return 0
}
-set testfile "pending"
+standard_testfile .c
set libfile "pendshr"
-set srcfile $testfile.c
set libsrc $srcdir/$subdir/$libfile.c
-set binfile $objdir/$subdir/$testfile
-set lib_sl $objdir/$subdir/$libfile.sl
+set lib_sl [standard_output_file $libfile.sl]
set lib_opts debug
set exec_opts [list debug shlib=$lib_sl]
# The permissions flags are only fully functional with stubs or targets
# that can run asynchronously.
-set testfile permission
-set srcfile start.c
-set binfile ${objdir}/${subdir}/${testfile}
-
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
- untested permissions.exp
- return -1
- }
+standard_testfile start.c
+
+if {[build_executable $testfile.exp $testfile \
+ $srcfile {debug nowarnings}] == -1} {
+ untested $testfile.exp
+ return -1
+}
if [get_compiler_info] {
return -1
continue
}
-set testfile "pie-execl"
-set srcfile ${testfile}.c
+standard_testfile .c
set executable1 ${testfile}1
set executable2 ${testfile}2
-set binfile1 ${objdir}/${subdir}/${executable1}
-set binfile2 ${objdir}/${subdir}/${executable2}
+set binfile1 ${binfile}1
+set binfile2 ${binfile}2
set binfile2_test_msg OBJDIR/${subdir}/${executable2}
# Use conditional compilation according to `BIN' as GDB remembers the source
# test running programs
#
-set testfile "pointers"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
untested pointers.exp
return -1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
#
return 0
}
-set testfile "pr11022"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
+
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
untested pr11022.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 {
fail "Can't run to main"
set lib1 "print-file-var-lib1"
set lib2 "print-file-var-lib2"
-set libobj1 "${objdir}/${subdir}/${lib1}.so"
-set libobj2 "${objdir}/${subdir}/${lib2}.so"
+set libobj1 [standard_output_file ${lib1}.so]
+set libobj2 [standard_output_file ${lib2}.so]
set lib_opts { debug additional_flags=-fPIC }
return -1
}
if { [gdb_compile "${srcdir}/${subdir}/${executable}.c" \
- "${objdir}/${subdir}/${executable}" \
+ [standard_output_file ${executable}] \
executable \
[list debug shlib=${libobj1} shlib=${libobj2}]]
!= ""} {
# This file was written by Fred Fish. (fnf@cygnus.com)
-set testfile "printcmds"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
+
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
untested printcmds.exp
return -1
if { [skip_cplus_tests] } { continue }
-set testfile "prologue"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
untested prologue.exp
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"
if { [skip_cplus_tests] } { continue }
-set testfile "psymtab"
-set binfile ${objdir}/${subdir}/${testfile}
-
-if { [gdb_compile "${srcdir}/${subdir}/${testfile}1.c" "${testfile}1.o" object {debug}] != "" } {
- untested psymtab.exp
- return -1
-}
-
-if { [gdb_compile "${srcdir}/${subdir}/${testfile}2.c" "${testfile}2.o" object {debug}] != "" } {
- untested psymtab.exp
- return -1
-}
-
-if { [gdb_compile "${testfile}1.o ${testfile}2.o" ${binfile} executable {debug}] != "" } {
- untested psymtab.exp
- return -1
-}
+standard_testfile psymtab1.c psymtab2.c
# Create and source the file that provides information about the compiler
# used to compile the test case.
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]} {
+ untested $testfile.exp
+ return -1
+}
# Disable the prompt for whether to set pending breakpoints.
# We don't want a breakpoint, we just want to verify the symbol
# 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 ptr-typedef
-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 test program"
return -1
# Get things started.
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
if ![runto marker1] {
untested "Couldn't run to marker1"
# test running programs
#
-set testfile "ptype"
-set srcfile0 ${testfile}.c
-set srcfile1 ${testfile}1.c
-set binfile ${objdir}/${subdir}/${testfile}
-
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile0}" "${binfile}0.o" object {debug}] != "" } {
- untested ptype.exp
- return -1
-}
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug}] != "" } {
- untested ptype.exp
- return -1
-}
-if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug}] != "" } {
- untested ptype.exp
- return -1
+standard_testfile .c ptype1.c
+
+if {[prepare_for_testing ${testfile}.exp ${testfile} \
+ [list $srcfile $srcfile2] {debug nowarnings}]} {
+ return -1
}
# Create and source the file that provides information about the compiler
return -1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
# Test ptype of unnamed enumeration members before any action causes
# the partial symbol table to be expanded to full symbols. This fails
# with stabs compilers which fail to use a nameless stab (such as
# 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 randomize
-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}
-
proc address_get { testname } {
global gdb_prompt
# 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 readline-ask
-set executable ${testfile}.x
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${executable}
+standard_testfile .c
set inputrc ${srcdir}/${subdir}/${testfile}.inputrc
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {debug}] != "" } {
# INPUTRC gets reset for the next testfile.
setenv INPUTRC $inputrc
-clean_restart ${executable}
+clean_restart ${binfile}
gdb_test_no_output "set width 50"
gdb_test_no_output "set height 3"
# 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 recpar
-set srcfile ${testfile}.c
+standard_testfile .c
+
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
return -1
}
# This file was written by Jeff Law. (law@cs.utah.edu)
-set testfile "recurse"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
- untested recurse.exp
- return -1
-}
-
-# 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
+}
proc recurse_tests {} {
continue
}
-set testfile relativedebug
-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 test program"
return -1
# Get things started.
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
runto_main
# relocate.exp -- Expect script to test loading symbols from unrelocated
# object files.
-set testfile relocate
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}.o
+standard_testfile .c
+append binfile .o
remote_exec build "rm -f ${binfile}"
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {debug}] != "" } {
return
}
-set testfile "remote"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
gdb_start
set testfile1 "reread1"
set srcfile1 ${testfile1}.c
# Cygwin needs $EXEEXT.
-set binfile1 ${objdir}/${subdir}/${testfile1}$EXEEXT
+set binfile1 [standard_output_file ${testfile1}$EXEEXT]
if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile1}" executable {debug nowarnings}] != "" } {
untested reread.exp
set testfile2 "reread2"
set srcfile2 ${testfile2}.c
-set binfile2 ${objdir}/${subdir}/${testfile2}$EXEEXT
+set binfile2 [standard_output_file ${testfile2}$EXEEXT]
if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" executable {debug nowarnings}] != ""
&& [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" executable {debug nowarnings additional_flags=-DNO_SECTIONS}] != ""} {
# Start with a fresh gdb.
set testfile "reread"
-set binfile ${objdir}/${subdir}/${testfile}$EXEEXT
+set binfile [standard_output_file ${testfile}$EXEEXT]
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
set typeesc [string map {{ } {\ }} $type]
set typenospace [string map {{ } -} $type]
- set testfile "return-nodebug"
- set srcfile ${testfile}.c
- set srcfile1 ${testfile}1.c
- set binfile ${objdir}/${subdir}/${testfile}-${typenospace}
+ standard_testfile .c return-nodebug1.c
set additional_flags "additional_flags=-DTYPE=$typeesc"
- if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object [list debug $additional_flags]] != "" } {
+ if {[prepare_for_testing_full $testfile.exp \
+ [list ${testfile}-${typenospace} debug \
+ $srcfile [list debug $additional_flags] \
+ $srcfile2 [list $additional_flags]]]} {
continue
}
- # This one is compiled without debug info.
- if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object [list $additional_flags]] != "" } {
- continue
- }
-
- if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug}] != "" } {
- continue
- }
-
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
- gdb_load ${binfile}
-
do_test $type
}
# This file was written by Michael Snyder (msnyder@redhat.com)
-set testfile "return2"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
+
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
untested return2.exp
return -1
# Start with a fresh gdb.
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
set timeout 30
return2_tests