test suite update - gdb.base/[n-r]

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.
This commit is contained in:
Tom Tromey 2013-06-27 18:53:49 +00:00
parent f8b41b0022
commit 822bd149bf
29 changed files with 108 additions and 257 deletions

View File

@ -1,3 +1,21 @@
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> 2013-06-27 Tom Tromey <tromey@redhat.com>
* hook-stop-continue.exp, hook-stop-frame.exp, huge.exp, * hook-stop-continue.exp, hook-stop-frame.exp, huge.exp,

View File

@ -12,10 +12,7 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set testfile "nextoverexit" standard_testfile
set executable $testfile
set srcfile $testfile.c
set binfile $objdir/$subdir/$testfile
if {[prepare_for_testing $testfile.exp $testfile $testfile.c]} { if {[prepare_for_testing $testfile.exp $testfile $testfile.c]} {
return -1 return -1

View File

@ -16,9 +16,7 @@
# Test that things still (sort of) work when compiled without -g. # Test that things still (sort of) work when compiled without -g.
set testfile nodebug standard_testfile .c
set srcfile $srcdir/$subdir/$testfile.c
set binfile $objdir/$subdir/$testfile
if [get_compiler_info] { if [get_compiler_info] {
return -1 return -1
@ -32,17 +30,14 @@ if [test_compiler_info "xlc-*"] {
set exec_opts "" 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." untested "Couldn't compile $srcfile."
return -1 return -1
} }
# Start with a fresh gdb. # Start with a fresh gdb.
gdb_exit clean_restart $binfile
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load $binfile
if [runto inner] then { if [runto inner] then {

View File

@ -13,9 +13,8 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set testfile "nofield" standard_testfile .c
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
untested "Couldn't compile ${srcfile}" untested "Couldn't compile ${srcfile}"
return -1 return -1
@ -24,10 +23,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debu
set eol "\[\r\n\]+" set eol "\[\r\n\]+"
set sp "\[ \t\]*" set sp "\[ \t\]*"
gdb_exit clean_restart ${binfile}
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
gdb_test "ptype struct not_empty" \ gdb_test "ptype struct not_empty" \
"type = struct not_empty {$eol${sp}void \\*e;$eol${sp}void \\*u;$eol}" \ "type = struct not_empty {$eol${sp}void \\*e;$eol${sp}void \\*u;$eol}" \

View File

@ -13,10 +13,7 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set testfile "nostdlib" standard_testfile .c
set srcfile ${testfile}.c
set executable ${testfile}
set binfile ${objdir}/${subdir}/${executable}
# If we're using a stub, breakpoints at the entry point will not trigger. # If we're using a stub, breakpoints at the entry point will not trigger.
# See also the comment in break-entry.exp. # See also the comment in break-entry.exp.
@ -48,7 +45,7 @@ if {$err != ""} {
return -1 return -1
} }
clean_restart $executable clean_restart $binfile
gdb_breakpoint "*marker" gdb_breakpoint "*marker"
gdb_breakpoint "*_start" gdb_breakpoint "*_start"

View File

@ -16,41 +16,19 @@
# This file was written by Fred Fish. (fnf@cygnus.com) # 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 # Create and source the file that provides information about the compiler
# used to compile the test case. # used to compile the test case.
if [get_compiler_info] { if [get_compiler_info] {
return -1 return -1
} }
# Start with a fresh gdb. standard_testfile opaque0.c opaque1.c
gdb_exit if {[prepare_for_testing $testfile.exp $testfile \
gdb_start [list $srcfile $srcfile2] debug]} {
gdb_reinitialize_dir $srcdir/$subdir untested $testfile.exp
gdb_load ${binfile} return -1
}
# #
# Test basic opaque structure handling (statically). # Test basic opaque structure handling (statically).

View File

@ -39,36 +39,11 @@ if [istarget "*-*-linux*"] then {
return return
} }
set testfile "overlays" standard_testfile overlays.c ovlymgr.c foo.c bar.c baz.c grbx.c
set binfile ${objdir}/${subdir}/${testfile}
set srcfile ${testfile}.c
if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${testfile}.o" object {debug}] != ""} then { if {[build_executable $testfile.exp $testfile \
untested overlays.exp [list $srcfile $srcfile2 $srcfile3 $srcfile4 $srcfile5 $srcfile6] \
return -1 {debug ldscript=-Wl,-T$linker_script}] == -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"] != "" } {
untested overlays.exp untested overlays.exp
return -1 return -1
} }

View File

@ -24,23 +24,16 @@
# test running programs # test running programs
# #
set testfile "pc-fp" standard_testfile
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
untested pc-fp.exp
return -1
}
if [get_compiler_info] { if [get_compiler_info] {
return -1 return -1
} }
gdb_exit if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug nowarnings}]} {
gdb_start untested $testfile.exp
gdb_reinitialize_dir $srcdir/$subdir return -1
gdb_load ${binfile} }
if ![runto_main] then { if ![runto_main] then {
perror "couldn't run to breakpoint" perror "couldn't run to breakpoint"

View File

@ -23,12 +23,10 @@ if {[skip_shlib_tests]} {
return 0 return 0
} }
set testfile "pending" standard_testfile .c
set libfile "pendshr" set libfile "pendshr"
set srcfile $testfile.c
set libsrc $srcdir/$subdir/$libfile.c set libsrc $srcdir/$subdir/$libfile.c
set binfile $objdir/$subdir/$testfile set lib_sl [standard_output_file $libfile.sl]
set lib_sl $objdir/$subdir/$libfile.sl
set lib_opts debug set lib_opts debug
set exec_opts [list debug shlib=$lib_sl] set exec_opts [list debug shlib=$lib_sl]

View File

@ -18,14 +18,13 @@
# The permissions flags are only fully functional with stubs or targets # The permissions flags are only fully functional with stubs or targets
# that can run asynchronously. # that can run asynchronously.
set testfile permission standard_testfile start.c
set srcfile start.c
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } { if {[build_executable $testfile.exp $testfile \
untested permissions.exp $srcfile {debug nowarnings}] == -1} {
return -1 untested $testfile.exp
} return -1
}
if [get_compiler_info] { if [get_compiler_info] {
return -1 return -1

View File

@ -26,12 +26,11 @@ if [is_remote target] {
continue continue
} }
set testfile "pie-execl" standard_testfile .c
set srcfile ${testfile}.c
set executable1 ${testfile}1 set executable1 ${testfile}1
set executable2 ${testfile}2 set executable2 ${testfile}2
set binfile1 ${objdir}/${subdir}/${executable1} set binfile1 ${binfile}1
set binfile2 ${objdir}/${subdir}/${executable2} set binfile2 ${binfile}2
set binfile2_test_msg OBJDIR/${subdir}/${executable2} set binfile2_test_msg OBJDIR/${subdir}/${executable2}
# Use conditional compilation according to `BIN' as GDB remembers the source # Use conditional compilation according to `BIN' as GDB remembers the source

View File

@ -25,9 +25,7 @@
# test running programs # test running programs
# #
set testfile "pointers" standard_testfile .c
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } { if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
untested pointers.exp untested pointers.exp
@ -38,10 +36,7 @@ if [get_compiler_info] {
return -1 return -1
} }
gdb_exit clean_restart ${binfile}
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
# #

View File

@ -17,9 +17,8 @@ if {[skip_hw_watchpoint_tests]} {
return 0 return 0
} }
set testfile "pr11022" standard_testfile .c
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
untested pr11022.exp untested pr11022.exp
return -1 return -1
@ -27,10 +26,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
# Start with a fresh gdb. # Start with a fresh gdb.
gdb_exit clean_restart ${binfile}
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
if ![runto_main] then { if ![runto_main] then {
fail "Can't run to main" fail "Can't run to main"

View File

@ -22,8 +22,8 @@ set executable print-file-var-main
set lib1 "print-file-var-lib1" set lib1 "print-file-var-lib1"
set lib2 "print-file-var-lib2" set lib2 "print-file-var-lib2"
set libobj1 "${objdir}/${subdir}/${lib1}.so" set libobj1 [standard_output_file ${lib1}.so]
set libobj2 "${objdir}/${subdir}/${lib2}.so" set libobj2 [standard_output_file ${lib2}.so]
set lib_opts { debug additional_flags=-fPIC } set lib_opts { debug additional_flags=-fPIC }
@ -38,7 +38,7 @@ if { [gdb_compile_shlib ${srcdir}/${subdir}/${lib2}.c \
return -1 return -1
} }
if { [gdb_compile "${srcdir}/${subdir}/${executable}.c" \ if { [gdb_compile "${srcdir}/${subdir}/${executable}.c" \
"${objdir}/${subdir}/${executable}" \ [standard_output_file ${executable}] \
executable \ executable \
[list debug shlib=${libobj1} shlib=${libobj2}]] [list debug shlib=${libobj1} shlib=${libobj2}]]
!= ""} { != ""} {

View File

@ -20,9 +20,8 @@
# This file was written by Fred Fish. (fnf@cygnus.com) # This file was written by Fred Fish. (fnf@cygnus.com)
set testfile "printcmds" standard_testfile .c
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
untested printcmds.exp untested printcmds.exp
return -1 return -1

View File

@ -16,19 +16,14 @@
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
set testfile "prologue" standard_testfile .c
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
untested prologue.exp untested prologue.exp
return -1 return -1
} }
gdb_exit clean_restart ${binfile}
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
if ![runto_main] then { if ![runto_main] then {
perror "couldn't run to breakpoint" perror "couldn't run to breakpoint"

View File

@ -26,23 +26,7 @@
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
set testfile "psymtab" standard_testfile psymtab1.c psymtab2.c
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
}
# Create and source the file that provides information about the compiler # Create and source the file that provides information about the compiler
# used to compile the test case. # used to compile the test case.
@ -50,10 +34,11 @@ if [get_compiler_info] {
return -1 return -1
} }
gdb_exit if {[prepare_for_testing $testfile.exp $testfile \
gdb_start [list $srcfile $srcfile2] debug]} {
gdb_reinitialize_dir $srcdir/$subdir untested $testfile.exp
gdb_load ${binfile} return -1
}
# Disable the prompt for whether to set pending breakpoints. # Disable the prompt for whether to set pending breakpoints.
# We don't want a breakpoint, we just want to verify the symbol # We don't want a breakpoint, we just want to verify the symbol

View File

@ -13,9 +13,8 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set testfile ptr-typedef standard_testfile .c
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
untested "Couldn't compile test program" untested "Couldn't compile test program"
return -1 return -1
@ -23,10 +22,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
# Get things started. # Get things started.
gdb_exit clean_restart ${binfile}
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
if ![runto marker1] { if ![runto marker1] {
untested "Couldn't run to marker1" untested "Couldn't run to marker1"

View File

@ -19,22 +19,11 @@
# test running programs # test running programs
# #
set testfile "ptype" standard_testfile .c ptype1.c
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}] != "" } { if {[prepare_for_testing ${testfile}.exp ${testfile} \
untested ptype.exp [list $srcfile $srcfile2] {debug nowarnings}]} {
return -1 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
} }
# Create and source the file that provides information about the compiler # Create and source the file that provides information about the compiler
@ -43,11 +32,6 @@ if [get_compiler_info] {
return -1 return -1
} }
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
# Test ptype of unnamed enumeration members before any action causes # Test ptype of unnamed enumeration members before any action causes
# the partial symbol table to be expanded to full symbols. This fails # the partial symbol table to be expanded to full symbols. This fails
# with stabs compilers which fail to use a nameless stab (such as # with stabs compilers which fail to use a nameless stab (such as

View File

@ -13,21 +13,13 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set testfile randomize standard_testfile
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile} if {[prepare_for_testing $testfile.exp $testfile $srcfile debug]} {
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { untested $testfile.exp
untested "Couldn't compile test program"
return -1 return -1
} }
# Get things started.
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
proc address_get { testname } { proc address_get { testname } {
global gdb_prompt global gdb_prompt

View File

@ -13,10 +13,7 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set testfile readline-ask standard_testfile .c
set executable ${testfile}.x
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${executable}
set inputrc ${srcdir}/${subdir}/${testfile}.inputrc set inputrc ${srcdir}/${subdir}/${testfile}.inputrc
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {debug}] != "" } { if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {debug}] != "" } {
@ -26,7 +23,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {debug}]
# INPUTRC gets reset for the next testfile. # INPUTRC gets reset for the next testfile.
setenv INPUTRC $inputrc setenv INPUTRC $inputrc
clean_restart ${executable} clean_restart ${binfile}
gdb_test_no_output "set width 50" gdb_test_no_output "set width 50"
gdb_test_no_output "set height 3" gdb_test_no_output "set height 3"

View File

@ -13,8 +13,8 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set testfile recpar standard_testfile .c
set srcfile ${testfile}.c
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } { if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
return -1 return -1
} }

View File

@ -16,21 +16,13 @@
# This file was written by Jeff Law. (law@cs.utah.edu) # This file was written by Jeff Law. (law@cs.utah.edu)
set testfile "recurse" standard_testfile
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile} if {[prepare_for_testing $testfile.exp $testfile $srcfile debug]} {
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { untested $testfile.exp
untested recurse.exp return -1
return -1
} }
# Start with a fresh gdb.
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
proc recurse_tests {} { proc recurse_tests {} {
# Disable hardware watchpoints if necessary. # Disable hardware watchpoints if necessary.

View File

@ -18,9 +18,8 @@ if [target_info exists gdb,nosignals] {
continue continue
} }
set testfile relativedebug standard_testfile .c
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
untested "Couldn't compile test program" untested "Couldn't compile test program"
return -1 return -1
@ -28,10 +27,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
# Get things started. # Get things started.
gdb_exit clean_restart ${binfile}
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
runto_main runto_main

View File

@ -16,9 +16,8 @@
# relocate.exp -- Expect script to test loading symbols from unrelocated # relocate.exp -- Expect script to test loading symbols from unrelocated
# object files. # object files.
set testfile relocate standard_testfile .c
set srcfile ${testfile}.c append binfile .o
set binfile ${objdir}/${subdir}/${testfile}.o
remote_exec build "rm -f ${binfile}" remote_exec build "rm -f ${binfile}"
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {debug}] != "" } { if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {debug}] != "" } {

View File

@ -20,9 +20,7 @@ if {! [is_remote target]} {
return return
} }
set testfile "remote" standard_testfile .c
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
gdb_start gdb_start

View File

@ -20,7 +20,7 @@ set prototypes 1
set testfile1 "reread1" set testfile1 "reread1"
set srcfile1 ${testfile1}.c set srcfile1 ${testfile1}.c
# Cygwin needs $EXEEXT. # 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}] != "" } { if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile1}" executable {debug nowarnings}] != "" } {
untested reread.exp untested reread.exp
@ -31,7 +31,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile1}" executable {d
set testfile2 "reread2" set testfile2 "reread2"
set srcfile2 ${testfile2}.c 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}] != "" if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" executable {debug nowarnings}] != ""
&& [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" executable {debug nowarnings additional_flags=-DNO_SECTIONS}] != ""} { && [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" executable {debug nowarnings additional_flags=-DNO_SECTIONS}] != ""} {
@ -42,7 +42,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" executable {d
# Start with a fresh gdb. # Start with a fresh gdb.
set testfile "reread" set testfile "reread"
set binfile ${objdir}/${subdir}/${testfile}$EXEEXT set binfile [standard_output_file ${testfile}$EXEEXT]
gdb_start gdb_start
gdb_reinitialize_dir $srcdir/$subdir gdb_reinitialize_dir $srcdir/$subdir

View File

@ -45,30 +45,16 @@ foreach type {{signed char} {short} {int} {long} {long long} {float} {double}} {
set typeesc [string map {{ } {\ }} $type] set typeesc [string map {{ } {\ }} $type]
set typenospace [string map {{ } -} $type] set typenospace [string map {{ } -} $type]
set testfile "return-nodebug" standard_testfile .c return-nodebug1.c
set srcfile ${testfile}.c
set srcfile1 ${testfile}1.c
set binfile ${objdir}/${subdir}/${testfile}-${typenospace}
set additional_flags "additional_flags=-DTYPE=$typeesc" 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 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 do_test $type
} }

View File

@ -16,9 +16,8 @@
# This file was written by Michael Snyder (msnyder@redhat.com) # This file was written by Michael Snyder (msnyder@redhat.com)
set testfile "return2" standard_testfile .c
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
untested return2.exp untested return2.exp
return -1 return -1
@ -103,10 +102,7 @@ proc return2_tests { } {
# Start with a fresh gdb. # Start with a fresh gdb.
gdb_exit clean_restart ${binfile}
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
set timeout 30 set timeout 30
return2_tests return2_tests