Convert files gdb.base/[h-m]*.exp to use standard_output_file et al.
* hook-stop-continue.exp, hook-stop-frame.exp, huge.exp,
included.exp, inferior-died.exp, infnan.exp, info-fun.exp,
info-macros.exp, info-os.exp, info-proc.exp, info-target.exp,
infoline.exp, interp.exp, interrupt.exp, jit-simple.exp,
jit-so.exp, jump.exp, kill-after-signal.exp, label.exp, langs.exp,
lineinc.exp, list.exp, logical.exp, long_long.exp, longjmp.exp,
macscp.exp, maint.exp, memattr.exp, mips_pro.exp, miscexprs.exp,
morestack.exp, moribund-step.exp, multi-forks.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,
+ included.exp, inferior-died.exp, infnan.exp, info-fun.exp,
+ info-macros.exp, info-os.exp, info-proc.exp, info-target.exp,
+ infoline.exp, interp.exp, interrupt.exp, jit-simple.exp,
+ jit-so.exp, jump.exp, kill-after-signal.exp, label.exp, langs.exp,
+ lineinc.exp, list.exp, logical.exp, long_long.exp, longjmp.exp,
+ macscp.exp, maint.exp, memattr.exp, mips_pro.exp, miscexprs.exp,
+ morestack.exp, moribund-step.exp, multi-forks.exp: Use
+ standard_testfile, standard_output_file, prepare_for_testing,
+ clean_restart.
+
2013-06-27 Tom Tromey <tromey@redhat.com>
* ena-dis-br.exp, enum_cond.exp, enumval.exp, environ.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 "hook-stop-continue"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
if { [prepare_for_testing ${testfile}.exp "${testfile}" "${testfile}.c" {debug nowarnings}] } {
return -1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
if ![runto_main] then {
perror "Couldn't run to main"
}
# 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 "hook-stop-frame"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
-if { [prepare_for_testing ${testfile}.exp "${testfile}" "${testfile}.c" {debug nowarnings}] } {
+if { [prepare_for_testing ${testfile}.exp "${testfile}" $srcfile {debug nowarnings}] } {
return -1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
if ![runto_main] then {
perror "Couldn't run to main"
}
return
}
-set testfile "huge"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
for { set size [expr 2 * 1024 * 1024] } { $size > 10 } { set size [expr $size / 2] } {
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}
set prev_timeout $timeout
set timeout 30
# 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 "included"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
- untested included.exp
+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}
-
gdb_test_no_output "set listsize 1"
gdb_test "list main" ".*"
return -1
}
-set testfile "inferior-died"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
if { [prepare_for_testing ${testfile}.exp ${testfile} ${testfile}.c] } {
return -1
# Script to test floating point infinities and NaNs.
-set testfile "infnan"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
- untested infnan.exp
+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}
-
runto_main
gdb_test "print a" "\\\$$decimal = inf"
# Library file.
set libname "info-fun-solib"
set srcfile_lib ${srcdir}/${subdir}/${libname}.c
-set binfile_lib ${objdir}/${subdir}/${libname}.so
+set binfile_lib [standard_output_file ${libname}.so]
set lib_flags {}
# Binary file.
-set testfile "info-fun"
-set srcfile ${srcdir}/${subdir}/${testfile}.c
+standard_testfile .c
set executable ${testfile}
-set binfile ${objdir}/${subdir}/${executable}
set bin_flags [list debug shlib=${binfile_lib}]
if [get_compiler_info] {
lappend sep_lib_flags {debug}
}
if { [gdb_compile_shlib ${srcfile_lib} ${binfile_lib} $sep_lib_flags] != ""
- || [gdb_compile ${srcfile} ${binfile} executable $bin_flags] != "" } {
+ || [gdb_compile $srcdir/$subdir/${srcfile} ${binfile} \
+ executable $bin_flags] != "" } {
untested "Could not compile $binfile_lib or $binfile."
return -1
}
# 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 "info-macros"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
get_compiler_info
if ![test_compiler_info gcc*] {
# 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 "info-os"
-set srcfile ${testfile}.c
+standard_testfile .c
# This test is Linux-only.
if ![istarget *-*-linux*] then {
set ws "\[ \t\]+"
-set testfile "break"
-set srcfile ${testfile}.c
-set srcfile1 ${testfile}1.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile break.c break1.c
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debug nowarnings}] != "" } {
- untested info-proc.exp
- return -1
-}
-
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug nowarnings}] != "" } {
- untested info-proc.exp
- return -1
-}
-
-if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug nowarnings}] != "" } {
- untested info-proc.exp
- return -1
+if {[prepare_for_testing $testfile.exp $testfile \
+ [list $srcfile $srcfile2] {debug nowarnings}]} {
+ untested $testfile.exp
+ return -1
}
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
gdb_test "help info proc" "Show /proc process information about .*"
gdb_test_multiple "info proc" "info proc without a process" {
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-set testfile info-target
-if { [prepare_for_testing ${testfile}.exp $testfile start.c] } {
+standard_testfile start.c
+
+if { [prepare_for_testing ${testfile}.exp $testfile $srcfile] } {
return -1
}
# 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 infoline
-set srcfile ${testfile}.c
+standard_testfile
if { [prepare_for_testing ${testfile}.exp ${testfile}] } {
return -1
}
-clean_restart ${testfile}
-
# Verify that the "info line" command does not skip function prologues.
# If it did, GDB would tell us that the line we're interested in starts
# at <twice+N> where N is different from zero.
# interp.exp Test interpreter-exec command
-set testfile "interp"
+standard_testfile
-if { [prepare_for_testing ${testfile}.exp ${testfile} ${testfile}.c {debug}] } {
+if { [prepare_for_testing ${testfile}.exp ${testfile} $srcfile {debug}] } {
return -1
}
}
-set testfile interrupt
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
set options { debug }
if { ! [target_info exists gdb,nosignals] } {
lappend options "additional_flags=-DSIGNALS"
}
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $options] != "" } {
- untested interrupt.exp
- return -1
+if {[build_executable $testfile.exp $testfile $srcfile $options] == -1} {
+ untested $testfile.exp
+ return -1
}
gdb_start
# test running programs
#
-set testfile jit-simple
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+standard_testfile
+
+if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} {
untested jit-simple.exp
return -1
}
set testfile jit-dlmain
set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+set binfile [standard_output_file ${testfile}]
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug shlib_load}] != "" } {
untested jit-so.exp
return -1
set testfile2 jit-main
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 additional_flags="-DMAIN=jit_dl_main"}] != "" } {
untested jit.exp
set solib_testfile "jit-solib"
set solib_srcfile "${srcdir}/${subdir}/${solib_testfile}.c"
-set solib_binfile "${objdir}/${subdir}/${solib_testfile}.so"
+set solib_binfile [standard_output_file ${solib_testfile}.so]
set solib_binfile_test_msg "SHLIBDIR/${solib_testfile}.so"
# Note: compiling without debug info: the library goes through symbol
clear_xfail "*-*-*"
-set testfile "jump"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
# Build the test case
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
# Start with a fresh gdb
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
if ![runto_main] then {
perror "Couldn't run to main"
# 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 "kill-after-signal"
+standard_testfile .c
if { ![can_single_step_to_signal_handler] } {
untested ${testfile}.exp
# test running programs
#
-set testfile "label"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
-if { [prepare_for_testing ${testfile}.exp $testfile ${testfile}.c debug] } {
+if { [prepare_for_testing ${testfile}.exp $testfile ${srcfile} debug] } {
untested label.exp
return -1
}
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-set testfile langs
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile langs0.c langs1.c langs2.c
if [is_remote host] {
remote_download host ${srcdir}/${subdir}/langs1.f
}
-if { [gdb_compile "${srcdir}/${subdir}/langs0.c" "${binfile}0.o" object {debug}] != "" } {
- untested langs.exp
- return -1
-}
-
-if { [gdb_compile "${srcdir}/${subdir}/langs1.c" "${binfile}1.o" object {debug}] != "" } {
- untested langs.exp
- return -1
-}
-
-if { [gdb_compile "${srcdir}/${subdir}/langs2.c" "${binfile}2.o" object {debug}] != "" } {
- untested langs.exp
- return -1
-}
-
-if { [gdb_compile "${binfile}0.o ${binfile}1.o ${binfile}2.o" ${binfile} executable {debug}] != "" } {
- untested langs.exp
- return -1
+if {[prepare_for_testing ${testfile}.exp ${testfile} \
+ [list $srcfile $srcfile2 $srcfile3] {debug}]} {
+ return -1
}
set oldtimeout $timeout
return -1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load $binfile
-
gdb_test_multiple "b langs0" "break on nonexistent function in langs.exp" {
-re "Function \"langs0\" not defined\..*Make breakpoint pending on future shared library load.*y or .n.. $" {
# read the above debugging info.
-set testfile "lineinc"
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
-
-if {[gdb_compile "${srcdir}/${subdir}/${testfile}.c" ${binfile} executable {debug}] != ""} {
+if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" ${binfile} executable {debug}] != ""} {
untested lineinc.exp
return -1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
# Any command that causes GDB to read the debugging info for the
# lineinc.c compilation unit will do here.
# This file was written by Fred Fish. (fnf@cygnus.com)
-set testfile "list"
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile list0.c list1.c
# Need to download the header to the host.
remote_download host ${srcdir}/${subdir}/list0.h list0.h
-
-if { [gdb_compile "${srcdir}/${subdir}/list0.c" "${binfile}0.o" object {debug}] != "" } {
- untested list.exp
- return -1
-}
-
-if { [gdb_compile "${srcdir}/${subdir}/list1.c" "${binfile}1.o" object {debug}] != "" } {
- untested list.exp
- return -1
-}
-
-if { [gdb_compile "${binfile}0.o ${binfile}1.o" ${binfile} executable {debug}] != "" } {
- untested list.exp
- return -1
+if {[prepare_for_testing $testfile.exp $testfile [list $srcfile $srcfile2] \
+ {debug}]} {
+ return -1
}
-
-
# Create and source the file that provides information about the compiler
# used to compile the test case.
if [get_compiler_info] {
# test running programs
#
-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 logical.exp
return -1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
#
return 0
}
-set testfile long_long
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
# What compiler are we using?
#
# use this to debug:
#log_user 1
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
if { ![runto known_types] } then {
fail "run to known_types"
#
-set testfile "longjmp"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
untested longjmp.exp
return -1
}
-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"
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-set srcfile macscp1.c
-set testfile "macscp"
-set objfile ${objdir}/${subdir}/${testfile}.o
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile macscp1.c
+set objfile [standard_output_file ${testfile}.o]
set options { debug additional_flags=-DFROM_COMMANDLINE=ARG}
return -1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
# Ask GDB to show the current definition of MACRO, and return a list
-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 maint.exp
- return -1
-}
-
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug nowarnings}] != "" } {
- untested maint.exp
- return -1
-}
+standard_testfile break.c break1.c
-if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug nowarnings}] != "" } {
- untested maint.exp
- return -1
+if {[prepare_for_testing $testfile.exp $testfile \
+ [list $srcfile $srcfile2] {debug nowarnings}]} {
+ untested $testfile.exp
+ return -1
}
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-
# The commands we test here produce many lines of output; disable "press
# <return> to continue" prompts.
gdb_test_no_output "set height 0"
send_gdb "maint print statistics\n"
gdb_expect {
- -re "Statistics for\[^\n\r\]*break\[^\n\r\]*:\r\n Number of \"minimal\" symbols read: $decimal\r\n( Number of \"partial\" symbols read: $decimal\r\n)? Number of \"full\" symbols read: $decimal\r\n Number of \"types\" defined: $decimal\r\n( Number of psym tables \\(not yet expanded\\): $decimal\r\n)?( Number of read CUs: $decimal\r\n Number of unread CUs: $decimal\r\n)? Number of symbol tables: $decimal\r\n Number of symbol tables with line tables: $decimal\r\n Number of symbol tables with blockvectors: $decimal\r\n Total memory used for objfile obstack: $decimal\r\n Total memory used for BFD obstack: $decimal\r\n Total memory used for psymbol cache: $decimal\r\n Total memory used for macro cache: $decimal\r\n Total memory used for file name cache: $decimal\r\n" {
+ -re "Statistics for\[^\n\r\]*maint\[^\n\r\]*:\r\n Number of \"minimal\" symbols read: $decimal\r\n( Number of \"partial\" symbols read: $decimal\r\n)? Number of \"full\" symbols read: $decimal\r\n Number of \"types\" defined: $decimal\r\n( Number of psym tables \\(not yet expanded\\): $decimal\r\n)?( Number of read CUs: $decimal\r\n Number of unread CUs: $decimal\r\n)? Number of symbol tables: $decimal\r\n Number of symbol tables with line tables: $decimal\r\n Number of symbol tables with blockvectors: $decimal\r\n Total memory used for objfile obstack: $decimal\r\n Total memory used for BFD obstack: $decimal\r\n Total memory used for psymbol cache: $decimal\r\n Total memory used for macro cache: $decimal\r\n Total memory used for file name cache: $decimal\r\n" {
gdb_expect {
-re "$gdb_prompt $" {
pass "maint print statistics"
while {$keep_looking} {
gdb_expect {
- -re ".*Object file.*break($EXEEXT)?: Objfile at $hex, bfd at $hex, \[0-9\]* minsyms\[\r\t \]+\n" { set header 1 }
+ -re ".*Object file.*maint($EXEEXT)?: Objfile at $hex, bfd at $hex, \[0-9\]* minsyms\[\r\t \]+\n" { set header 1 }
-re ".*Psymtabs:\[\r\t \]+\n" { set psymtabs 1 }
-re ".*Symtabs:\[\r\t \]+\n" { set symtabs 1 }
"maint print psymbols w/o args"
if { ! $have_gdb_index } {
- send_gdb "maint print psymbols psymbols_output ${srcdir}/${subdir}/${srcfile}\n"
+ set psymbols_output [standard_output_file psymbols_output]
+ send_gdb "maint print psymbols $psymbols_output ${srcdir}/${subdir}/${srcfile}\n"
gdb_expect {
- -re "^maint print psymbols psymbols_output \[^\n\]*\r\n$gdb_prompt $" {
- send_gdb "shell ls psymbols_output\n"
+ -re "^maint print psymbols $psymbols_output \[^\n\]*\r\n$gdb_prompt $" {
+ send_gdb "shell ls $psymbols_output\n"
gdb_expect {
- -re "psymbols_output\r\n$gdb_prompt $" {
+ -re "$psymbols_output\r\n$gdb_prompt $" {
# We want this grep to be as specific as possible,
# so it's less likely to match symbol file names in
# psymbols_output. Yes, this actually happened;
# poor expect got tons of output, and timed out
# trying to match it. --- Jim Blandy <jimb@cygnus.com>
- send_gdb "shell grep 'main.*function' psymbols_output\n"
+ send_gdb "shell grep 'main.*function' $psymbols_output\n"
gdb_expect {
-re ".main., function, $hex.*$gdb_prompt $" {
pass "maint print psymbols 1"
-re ".*$gdb_prompt $" { fail "maint print psymbols" }
timeout { fail "(timeout) maint print psymbols" }
}
- gdb_test "shell rm -f psymbols_output" ".*"
+ gdb_test "shell rm -f $psymbols_output" ".*" \
+ "shell rm -f psymbols_output"
}
-re ".*$gdb_prompt $" { fail "maint print psymbols" }
timeout { fail "(timeout) maint print psymbols" }
"maint print msymbols w/o args"
-send_gdb "maint print msymbols msymbols_output ${binfile}\n"
+set msymbols_output [standard_output_file msymbols_output]
+send_gdb "maint print msymbols $msymbols_output ${binfile}\n"
gdb_expect {
- -re "^maint print msymbols msymbols_output \[^\n\]*\r\n$gdb_prompt $" {
- send_gdb "shell ls msymbols_output\n"
+ -re "^maint print msymbols $msymbols_output \[^\n\]*\r\n$gdb_prompt $" {
+ send_gdb "shell ls $msymbols_output\n"
gdb_expect {
- -re "msymbols_output\r\n$gdb_prompt $" {
- send_gdb "shell grep factorial msymbols_output\n"
+ -re "$msymbols_output\r\n$gdb_prompt $" {
+ send_gdb "shell grep factorial $msymbols_output\n"
gdb_expect {
-re "\\\[ *$decimal\\\] \[tT\]\[ \t\]+$hex \\.?factorial.*$gdb_prompt $" {
pass "maint print msymbols"
-re ".*$gdb_prompt $" { fail "maint print msymbols" }
timeout { fail "(timeout) maint print msymbols" }
}
- gdb_test "shell rm -f msymbols_output" ".*"
+ gdb_test "shell rm -f $msymbols_output" ".*" \
+ "shell rm -f msymbols_output"
}
-re ".*$gdb_prompt $" { fail "maint print msymbols" }
timeout { fail "(timeout) maint print msymbols" }
fail "(timeout) maint print msymbols"
}
}
- gdb_test "shell rm -f msymbols_output2" ".*"
+ gdb_test "shell rm -f msymbols_output2" ".*" \
+ "shell rm -f msymbols_output2"
}
-re ".*$gdb_prompt $" {
fail "maint print msymbols"
# dump the symbol information for the entire C library - over 500MB nowadays
# for GNU libc.
-send_gdb "maint print symbols symbols_output ${srcdir}/${subdir}/${srcfile}\n"
+set symbols_output [standard_output_file symbols_output]
+send_gdb "maint print symbols $symbols_output ${srcdir}/${subdir}/${srcfile}\n"
gdb_expect {
- -re "^maint print symbols symbols_output \[^\n\]*\r\n$gdb_prompt $" {
- send_gdb "shell ls symbols_output\n"
+ -re "^maint print symbols $symbols_output \[^\n\]*\r\n$gdb_prompt $" {
+ send_gdb "shell ls $symbols_output\n"
gdb_expect {
- -re "symbols_output\r\n$gdb_prompt $" {
+ -re "$symbols_output\r\n$gdb_prompt $" {
# See comments for `maint print psymbols'.
- send_gdb "shell grep 'main(.*block' symbols_output\n"
+ send_gdb "shell grep 'main(.*block' $symbols_output\n"
gdb_expect {
-re "int main\\(int, char \\*\\*, char \\*\\*\\); block.*$gdb_prompt $" {
pass "maint print symbols"
-re ".*$gdb_prompt $" { fail "maint print symbols" }
timeout { fail "(timeout) maint print symbols" }
}
- gdb_test "shell rm -f symbols_output" ".*"
+ gdb_test "shell rm -f $symbols_output" ".*" \
+ "shell rm -f symbols_output"
}
-re ".*$gdb_prompt $" { fail "maint print symbols" }
timeout { fail "(timeout) maint print symbols" }
set data_section ".data"
gdb_test_multiple "maint info sections" "maint info sections" {
- -re "Exec file:\r\n.*break($EXEEXT)?., file type.*ER_RO.*$gdb_prompt $" {
+ -re "Exec file:\r\n.*maint($EXEEXT)?., file type.*ER_RO.*$gdb_prompt $" {
# Looks like RealView which uses different section names.
set text_section ER_RO
set data_section ER_RW
pass "maint info sections"
}
- -re "Exec file:\r\n.*break($EXEEXT)?., file type.*neardata.*$gdb_prompt $" {
+ -re "Exec file:\r\n.*maint($EXEEXT)?., file type.*neardata.*$gdb_prompt $" {
# c6x doesn't have .data section. It has .neardata and .fardata section.
set data_section ".neardata"
pass "maint info sections"
}
- -re "Exec file:\r\n.*break($EXEEXT)?., file type.*$gdb_prompt $" {
+ -re "Exec file:\r\n.*maint($EXEEXT)?., file type.*$gdb_prompt $" {
pass "maint info sections"
}
}
# Test the memory attribute commands.
-set testfile "memattr"
-set srcfile ${testfile}.c
+standard_testfile .c
if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
return -1
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-set testfile mips_pro
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
# Create and source the file that provides information about the compiler
# used to compile the test case.
# This test must be compiled with -O2 if using gcc.
+set options debug
if { [test_compiler_info gcc-*-*] } then {
- if { [gdb_compile "${srcdir}/$subdir/${srcfile}" "${binfile}" \
- executable {debug additional_flags=-O2 additional_flags=-fno-inline}] != "" } {
- untested mips_pro.exp
- return -1
- }
-} else {
- if { [gdb_compile "${srcdir}/$subdir/${srcfile}" "${binfile}" executable {debug}] != "" } {
- untested mips_pro.exp
- return -1
- }
+ lappend options additional_flags=-O2 additional_flags=-fno-inline
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+if {[prepare_for_testing $testfile.exp $testfile $srcfile $options]} {
+ untested $testfile.exp
+ return -1
+}
if [runto middle] then {
# PR 3016
# test running programs
#
-set testfile "miscexprs"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug ${additional_flags} nowarnings]] != "" } {
untested miscexprs.exp
return -1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
#
return -1
}
-set testfile morestack
-if { [prepare_for_testing ${testfile}.exp ${testfile} ${testfile}.c {additional_flags=-fsplit-stack}] } {
+standard_testfile
+
+if { [prepare_for_testing ${testfile}.exp ${testfile} $srcfile {additional_flags=-fsplit-stack}] } {
return -1
}
# 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 moribund-step
+standard_testfile start.c
if { ![support_displaced_stepping] } {
unsupported "displaced stepping"
return -1
}
-if { [prepare_for_testing ${testfile}.exp ${testfile} start.c] } {
+if { [prepare_for_testing ${testfile}.exp ${testfile} $srcfile] } {
return -1
}
}
-set testfile "multi-forks"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
untested multi-forks.exp
# Start with a fresh gdb
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
global gdb_prompt
# Start with a fresh gdb
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
runto_main
gdb_breakpoint $exit_bp_loc