mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-29 13:04:46 +08:00
test suite update - gdb.base/[h-m]
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.
This commit is contained in:
parent
289f9037cb
commit
f8b41b0022
@ -1,3 +1,16 @@
|
||||
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,
|
||||
|
@ -13,19 +13,12 @@
|
||||
# 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"
|
||||
}
|
||||
|
@ -13,19 +13,12 @@
|
||||
# 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"
|
||||
}
|
||||
|
@ -23,9 +23,7 @@ if [target_info exists gdb,skip_huge_test] {
|
||||
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}" \
|
||||
@ -39,10 +37,7 @@ if { $size < 10 } {
|
||||
|
||||
# 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
|
||||
|
@ -13,20 +13,12 @@
|
||||
# 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" ".*"
|
||||
|
@ -31,9 +31,7 @@ if { ![support_displaced_stepping] } {
|
||||
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
|
||||
|
@ -15,20 +15,13 @@
|
||||
|
||||
# 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"
|
||||
|
@ -19,13 +19,11 @@ if { [skip_shlib_tests] || [is_remote target] } {
|
||||
# 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] {
|
||||
@ -40,7 +38,8 @@ foreach libsepdebug {NO IN SEP} { with_test_prefix "$libsepdebug" {
|
||||
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
|
||||
}
|
||||
|
@ -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 "info-macros"
|
||||
set srcfile ${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
standard_testfile .c
|
||||
|
||||
get_compiler_info
|
||||
if ![test_compiler_info gcc*] {
|
||||
|
@ -13,8 +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 "info-os"
|
||||
set srcfile ${testfile}.c
|
||||
standard_testfile .c
|
||||
|
||||
# This test is Linux-only.
|
||||
if ![istarget *-*-linux*] then {
|
||||
|
@ -18,33 +18,14 @@
|
||||
|
||||
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 {[prepare_for_testing $testfile.exp $testfile \
|
||||
[list $srcfile $srcfile2] {debug nowarnings}]} {
|
||||
untested $testfile.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
|
||||
}
|
||||
|
||||
# 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" {
|
||||
|
@ -14,8 +14,9 @@
|
||||
# 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
|
||||
}
|
||||
|
||||
|
@ -13,15 +13,12 @@
|
||||
# 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.
|
||||
|
@ -15,9 +15,9 @@
|
||||
|
||||
# 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
|
||||
}
|
||||
|
||||
|
@ -24,18 +24,16 @@ if [target_info exists gdb,noinferiorio] {
|
||||
}
|
||||
|
||||
|
||||
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
|
||||
|
@ -28,10 +28,9 @@ if {[get_compiler_info]} {
|
||||
# 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
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ if {[get_compiler_info]} {
|
||||
|
||||
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
|
||||
@ -41,7 +41,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
|
||||
|
||||
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
|
||||
@ -50,7 +50,7 @@ if { [gdb_compile_shlib "${srcdir}/${subdir}/${srcfile2}" ${binfile2} {debug add
|
||||
|
||||
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
|
||||
|
@ -16,9 +16,7 @@
|
||||
|
||||
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}] != "" } {
|
||||
@ -29,10 +27,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
|
||||
|
||||
# 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"
|
||||
|
@ -13,7 +13,7 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set testfile "kill-after-signal"
|
||||
standard_testfile .c
|
||||
|
||||
if { ![can_single_step_to_signal_handler] } {
|
||||
untested ${testfile}.exp
|
||||
|
@ -23,11 +23,9 @@ if [is_remote target] then {
|
||||
# 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
|
||||
}
|
||||
|
@ -14,8 +14,7 @@
|
||||
# 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
|
||||
@ -23,24 +22,9 @@ if [is_remote host] {
|
||||
}
|
||||
|
||||
|
||||
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
|
||||
@ -54,11 +38,6 @@ if [get_compiler_info] {
|
||||
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.. $" {
|
||||
|
||||
|
@ -78,19 +78,14 @@
|
||||
# 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.
|
||||
|
@ -16,30 +16,16 @@
|
||||
# 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 {[prepare_for_testing $testfile.exp $testfile [list $srcfile $srcfile2] \
|
||||
{debug}]} {
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Create and source the file that provides information about the compiler
|
||||
# used to compile the test case.
|
||||
if [get_compiler_info] {
|
||||
|
@ -25,9 +25,7 @@
|
||||
# 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
|
||||
@ -38,10 +36,7 @@ if [get_compiler_info] {
|
||||
return -1
|
||||
}
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
clean_restart ${binfile}
|
||||
|
||||
|
||||
#
|
||||
|
@ -22,9 +22,7 @@ if [target_info exists no_long_long] {
|
||||
return 0
|
||||
}
|
||||
|
||||
set testfile long_long
|
||||
set srcfile ${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
standard_testfile .c
|
||||
|
||||
# What compiler are we using?
|
||||
#
|
||||
@ -46,10 +44,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [con
|
||||
# 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"
|
||||
|
@ -18,9 +18,7 @@
|
||||
#
|
||||
|
||||
|
||||
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
|
||||
@ -31,10 +29,7 @@ if [get_compiler_info] {
|
||||
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"
|
||||
|
@ -15,10 +15,8 @@
|
||||
# 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}
|
||||
|
||||
@ -36,10 +34,7 @@ if {[gdb_compile "${srcdir}/${subdir}/macscp1.c" "${objfile}" \
|
||||
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
|
||||
|
@ -47,31 +47,14 @@
|
||||
|
||||
|
||||
|
||||
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 maint.exp
|
||||
return -1
|
||||
if {[prepare_for_testing $testfile.exp $testfile \
|
||||
[list $srcfile $srcfile2] {debug nowarnings}]} {
|
||||
untested $testfile.exp
|
||||
return -1
|
||||
}
|
||||
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug nowarnings}] != "" } {
|
||||
untested maint.exp
|
||||
return -1
|
||||
}
|
||||
|
||||
if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug nowarnings}] != "" } {
|
||||
untested maint.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"
|
||||
@ -168,7 +151,7 @@ if [istarget "*-*-cygwin*"] {
|
||||
|
||||
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"
|
||||
@ -197,7 +180,7 @@ set keep_looking 1
|
||||
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 }
|
||||
|
||||
@ -226,18 +209,19 @@ gdb_test "maint print psymbols" \
|
||||
"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"
|
||||
@ -248,7 +232,8 @@ if { ! $have_gdb_index } {
|
||||
-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" }
|
||||
@ -264,13 +249,14 @@ gdb_test "maint print msymbols" \
|
||||
"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"
|
||||
@ -278,7 +264,8 @@ gdb_expect {
|
||||
-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" }
|
||||
@ -309,7 +296,8 @@ gdb_test_multiple "maint print msymbols msymbols_output2 ${subdir}/${testfile}"
|
||||
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"
|
||||
@ -339,14 +327,15 @@ gdb_test "maint print symbols" \
|
||||
# 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"
|
||||
@ -354,7 +343,8 @@ gdb_expect {
|
||||
-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" }
|
||||
@ -401,18 +391,18 @@ set text_section ".text"
|
||||
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"
|
||||
}
|
||||
}
|
||||
|
@ -17,8 +17,7 @@
|
||||
|
||||
# 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
|
||||
|
@ -14,9 +14,7 @@
|
||||
# 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.
|
||||
@ -27,23 +25,15 @@ if [get_compiler_info] {
|
||||
|
||||
# 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
|
||||
|
@ -37,9 +37,7 @@ set additional_flags "additional_flags=${storage}"
|
||||
# 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
|
||||
@ -50,10 +48,7 @@ if [get_compiler_info] {
|
||||
return -1
|
||||
}
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
clean_restart ${binfile}
|
||||
|
||||
|
||||
#
|
||||
|
@ -21,8 +21,9 @@ if {$gcc_compiled == 0} {
|
||||
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
|
||||
}
|
||||
|
||||
|
@ -13,14 +13,14 @@
|
||||
# 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
|
||||
}
|
||||
|
||||
|
@ -25,9 +25,7 @@ if {![istarget "hppa*-hp-hpux*"] && ![istarget "*-*-linux*"]} then {
|
||||
}
|
||||
|
||||
|
||||
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
|
||||
@ -36,10 +34,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
|
||||
|
||||
# Start with a fresh gdb
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
clean_restart ${binfile}
|
||||
|
||||
global gdb_prompt
|
||||
|
||||
@ -142,10 +137,7 @@ if {![istarget "*-*-linux*"]} then {
|
||||
|
||||
# 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
|
||||
|
Loading…
Reference in New Issue
Block a user