test suite update - gdb.base/[ab]
authorTom Tromey <tromey@redhat.com>
Thu, 27 Jun 2013 18:47:53 +0000 (18:47 +0000)
committerTom Tromey <tromey@redhat.com>
Thu, 27 Jun 2013 18:47:53 +0000 (18:47 +0000)
Convert files gdb.base/[ab]*.exp to use standard_output_file et al.

* a2-run.exp, all-bin.exp, annota1.exp, annota3.exp, anon.exp,
args.exp, arithmet.exp, arrayidx.exp, assign.exp, async-shell.exp,
async.exp, attach-pie-misread.exp, attach-pie-noexec.exp,
attach-twice.exp, attach.exp, auxv.exp, bang.exp, bfp-test.exp,
bigcore.exp, bitfields.exp, bitfields2.exp, break-entry.exp,
break-interp.exp, break-on-linker-gcd-function.exp,
breakpoint-shadow.exp: Use standard_testfile,
standard_output_file, prepare_for_testing, clean_restart.

26 files changed:
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/a2-run.exp
gdb/testsuite/gdb.base/all-bin.exp
gdb/testsuite/gdb.base/annota1.exp
gdb/testsuite/gdb.base/annota3.exp
gdb/testsuite/gdb.base/anon.exp
gdb/testsuite/gdb.base/args.exp
gdb/testsuite/gdb.base/arithmet.exp
gdb/testsuite/gdb.base/arrayidx.exp
gdb/testsuite/gdb.base/assign.exp
gdb/testsuite/gdb.base/async-shell.exp
gdb/testsuite/gdb.base/async.exp
gdb/testsuite/gdb.base/attach-pie-misread.exp
gdb/testsuite/gdb.base/attach-pie-noexec.exp
gdb/testsuite/gdb.base/attach-twice.exp
gdb/testsuite/gdb.base/attach.exp
gdb/testsuite/gdb.base/auxv.exp
gdb/testsuite/gdb.base/bang.exp
gdb/testsuite/gdb.base/bfp-test.exp
gdb/testsuite/gdb.base/bigcore.exp
gdb/testsuite/gdb.base/bitfields.exp
gdb/testsuite/gdb.base/bitfields2.exp
gdb/testsuite/gdb.base/break-entry.exp
gdb/testsuite/gdb.base/break-interp.exp
gdb/testsuite/gdb.base/break-on-linker-gcd-function.exp
gdb/testsuite/gdb.base/breakpoint-shadow.exp

index cf3bd6cb8ea21942d8dd79e3683a041b38c5d3be..c022aec7afce5cddd669027bb125cd6eadac5b35 100644 (file)
@@ -1,3 +1,14 @@
+2013-06-27  Tom Tromey  <tromey@redhat.com>
+
+       * a2-run.exp, all-bin.exp, annota1.exp, annota3.exp, anon.exp,
+       args.exp, arithmet.exp, arrayidx.exp, assign.exp, async-shell.exp,
+       async.exp, attach-pie-misread.exp, attach-pie-noexec.exp,
+       attach-twice.exp, attach.exp, auxv.exp, bang.exp, bfp-test.exp,
+       bigcore.exp, bitfields.exp, bitfields2.exp, break-entry.exp,
+       break-interp.exp, break-on-linker-gcd-function.exp,
+       breakpoint-shadow.exp: Use standard_testfile,
+       standard_output_file, prepare_for_testing, clean_restart.
+
 2013-06-26  Yao Qi  <yao@codesourcery.com>
 
        * gdb.trace/mi-trace-frame-collected.exp: New.
index bd70928d9dfb6922185ea7ad2ba400ba41b3f5c1..c8467dc31b56c4fd43c8790ecc365bbdec40e340 100644 (file)
@@ -24,8 +24,9 @@ if [gdb_skip_stdio_test "a2run.exp"] {
 # test running programs
 #
 
-set testfile a2-run
-if { [prepare_for_testing ${testfile}.exp $testfile run.c] } {
+standard_testfile run.c
+
+if { [prepare_for_testing ${testfile}.exp $testfile $srcfile] } {
     return -1
 }
 
index 53f6d5b40bf37d4f3df75f87c3bb8709580fcd57..815844aa2cac68d7519e536bf27dbcc5340915a1 100644 (file)
 # test running programs
 #
 
-set testfile "all-types"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
-    untested all-bin.exp
-    return -1
-    }
+standard_testfile all-types.c
 
 if [get_compiler_info] {
     return -1
 }
 
-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
+}
 
 #
 # set it up at a breakpoint so we can play with the variable values
index 2015154021ee884189ae13bb594f2fb38e774eea..541108ac7fc15e717894e0d4b7e38b92453830bb 100644 (file)
@@ -31,9 +31,7 @@ set breakpoints_invalid "\r\n\032\032breakpoints-invalid\r\n"
 # test running programs
 #
 
-set testfile "annota1"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
     untested annota1.exp
@@ -41,10 +39,7 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
 }
 
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 
 # The commands we test here produce many lines of output; disable "press 
 # <return> to continue" prompts.
@@ -445,10 +440,10 @@ if { [remote_file host exists core] } {
 }
 
 proc thread_test {} {
-    global objdir subdir srcdir testfile
+    global subdir srcdir testfile
     global gdb_prompt old_gdb_prompt
     set srcfile watch_thread_num.c
-    set binfile ${objdir}/${subdir}/${testfile}-watch_thread_num
+    set binfile [standard_output_file ${testfile}-watch_thread_num]
     set gdb_prompt $old_gdb_prompt
 
     if { ![get_compiler_info] && [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] == "" } {
index a742d09b148db3857373bf06f73f1b0d43c579f3..1d98a4f76ce58b1dabd8969b7b36ae1c6965b360 100644 (file)
@@ -30,9 +30,7 @@ if [is_remote target] then {
 # test running programs
 #
 
-set testfile "annota3"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}$EXEEXT
+standard_testfile .c
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
     untested annota3.exp
@@ -40,10 +38,7 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
 }
 
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 
 # The commands we test here produce many lines of output; disable "press 
 # <return> to continue" prompts.
index 3edb10a1b9ca7494e15d9b290bb4876e3b0bff76..6d69aac0e8700b31984eb7e3bf5a658fa4ac9c3f 100644 (file)
@@ -14,8 +14,8 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
-set testfile "anon"
-set srcfile $testfile.c
+standard_testfile .c
+
 if { [prepare_for_testing $testfile.exp $testfile $srcfile {debug}] } {
     return -1
 }
index 5ba93937e1e7885a786fbfbdfed3d862a1b6bba5..9fdbcaf7a9993f17c415ed15830465ab97502f12 100644 (file)
@@ -23,30 +23,22 @@ if [target_info exists noargs] {
     return
 }
 
-set testfile "args"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
-    untested args.exp
+if {[build_executable $testfile.exp $testfile \
+        $srcfile {debug nowarnings}] == -1} {
+    untested $testfile.exp
     return -1
 }
 
 proc args_test { name arglist } {
     global srcdir
     global subdir
-    global binfile
+    global testfile
     global hex
     global decimal
 
-    gdb_exit
-    gdb_start
-    gdb_reinitialize_dir $srcdir/$subdir
-
-    # No loading needs to be done when the target is `exec'.  Some targets
-    # require that the program be loaded, however, and it doesn't hurt
-    # for `exec'.
-    gdb_load $binfile
+    clean_restart $testfile
 
     runto_main
     gdb_breakpoint [gdb_get_line_number "set breakpoint here"]
index f44d1e2fec87db6c4ba4079944cd31dae7a81583..4143f22f7a1d55678bc34aa1844f3e194f2fda1b 100644 (file)
 # test running programs
 #
 
-set testfile "int-type"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
-     untested arithmet.exp
-     return -1
-    }
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+standard_testfile int-type.c
+
+if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug nowarnings}]} {
+    untested $testfile.exp
+    return -1
+}
 
 
 #
index 387b34f02ea0ce995853a80e7a6464acbfaad425..37ed4c3494b89bccc14b6b664124b3135b9ab578 100644 (file)
 # gdb can correctly print arrays with indexes for each element of the
 # array.
 
-set testfile "arrayidx"
-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
 }
 
-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"
index fd9486af5286e12546e16010910d31142420dc0d..61197eed2eef19af6e41288bfe5cc30974134f90 100644 (file)
@@ -25,9 +25,7 @@
 # test running programs
 #
 
-set testfile "all-types"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile all-types.c
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
      untested assign.exp
@@ -35,11 +33,7 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
     }
 
 
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 
 
 #
index 89ceebe8d5e6ebd47e6a9fc958eadf0ab1489972..186637c4520735e9bc723c6c15b9b281e788616d 100644 (file)
@@ -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 async-shell
+standard_testfile
 
 if { ![support_displaced_stepping] } { 
     unsupported "displaced stepping"
@@ -25,7 +25,7 @@ if [target_info exists use_gdb_stub] {
     return 0
 }
 
-if { [prepare_for_testing ${testfile}.exp ${testfile}] } {
+if { [prepare_for_testing ${testfile}.exp ${testfile} $srcfile] } {
     return -1
 }
 
index f75552e6aaefb3c4c566830a8e39d21712b71e72..11e0824f0322d7be9755bcef1ea4f0feb981365e 100644 (file)
 # test running programs
 #
 
-set testfile "async"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
-    untested async.exp
+if [get_compiler_info] {
     return -1
 }
 
-if [get_compiler_info] {
+if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} {
+    untested $testfile.exp
     return -1
 }
 
index 0640a63ed44b37b991bc62920d1514129cfe8843..443804d53b211c68a462c01b8a63487e65e461df 100644 (file)
@@ -21,13 +21,11 @@ if { ![isnative] || [is_remote host] || [target_info exists use_gdb_stub]
 
 load_lib prelink-support.exp
 
-set test "attach-pie-misread"
-set srcfile ${test}.c
-set genfile ${objdir}/${subdir}/${test}-gen.h
-set executable ${test}
-set binfile ${objdir}/${subdir}/${executable}
+standard_testfile .c
+set genfile [standard_output_file ${testfile}-gen.h]
+set executable $testfile
 
-if {[build_executable_own_libs ${test}.exp $executable $srcfile [list additional_flags=-fPIE ldflags=-pie]] == ""} {
+if {[build_executable_own_libs ${testfile}.exp $executable $srcfile [list additional_flags=-fPIE ldflags=-pie]] == ""} {
     return -1
 }
 
index cb48a5551d983294dd370ee1d05fad6c480a5b30..9aa5d83451dc87489c81d376f1cc4922de0b23c0 100644 (file)
@@ -18,9 +18,8 @@ if [is_remote target] then {
     return 0
 }
 
-set testfile attach-pie-noexec
+standard_testfile .c
 set executable ${testfile}
-set binfile ${objdir}/${subdir}/${executable}
 
 if { [prepare_for_testing ${testfile}.exp $executable "" [list debug "additional_flags=-fPIE -pie"]] } {
     return -1
index 2a79c35e31a537ab7b7db48b0c317df428175c97..0a0035b587d4168878ee61f1187b338c214a5a2c 100644 (file)
@@ -18,9 +18,8 @@ if [is_remote target] then {
     return 0
 }
 
-set testfile attach-twice
+standard_testfile
 set executable ${testfile}
-set binfile ${objdir}/${subdir}/${executable}
 
 if { [prepare_for_testing ${testfile}.exp $executable] } {
     return -1
index 929ac9aa426ab419307113d069a8bd3a79683a98..edd3d0c1a8567da57457e0eec02a126d6da7d273 100644 (file)
@@ -30,12 +30,9 @@ if [is_remote target] then {
     return 0
 }
 
-set testfile "attach"
-set srcfile  ${testfile}.c
-set srcfile2 ${testfile}2.c
-set binfile  ${objdir}/${subdir}/${testfile}
-set binfile2 ${objdir}/${subdir}/${testfile}2
-set escapedbinfile  [string_to_regexp ${objdir}/${subdir}/${testfile}]
+standard_testfile attach.c attach2.c
+set binfile2 ${binfile}2
+set escapedbinfile  [string_to_regexp $binfile]
 
 #execute_anywhere "rm -f ${binfile} ${binfile2}"
 remote_exec build "rm -f ${binfile} ${binfile2}"
@@ -67,7 +64,6 @@ proc do_attach_tests {} {
     global escapedbinfile
     global srcfile
     global testfile
-    global objdir
     global subdir
     global timeout
     
@@ -298,7 +294,7 @@ proc do_attach_tests {} {
     # when we're cd'd to some directory that doesn't contain the
     # a.out.  (We use the source path set by the "dir" command.)
     
-    gdb_test "dir ${objdir}/${subdir}" "Source directories searched: .*" \
+    gdb_test "dir [standard_output_file {}]" "Source directories searched: .*" \
        "set source path"
 
     gdb_test "cd /tmp" "Working directory /tmp." \
index b1d066208f4fe0fb212f9c233c4ffa34ba91c6b2..ab51b2c0421b0e9e5914a6c36f7df1a3302497d1 100644 (file)
@@ -24,11 +24,10 @@ if { ! [istarget "*-*-linux*"] && ! [istarget "*-*-solaris*"] } {
 }
 
 
-set testfile "auxv"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-set corefile ${objdir}/${subdir}/${testfile}.corefile
-set gcorefile ${objdir}/${subdir}/${testfile}.gcore
+standard_testfile .c
+
+set corefile ${binfile}.corefile
+set gcorefile ${binfile}.gcore
 
 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \
                  {debug additional_flags=-DUSE_RLIMIT}] != ""
@@ -40,16 +39,13 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \
 
 # Use a fresh directory to confine the native core dumps.
 # Make it the working directory for gdb and its child.
-set coredir "${objdir}/${subdir}/coredir.[getpid]"
+set coredir [standard_output_file coredir.[getpid]]
 file mkdir $coredir
 set core_works [expr [isnative] && ! [is_remote target]]
 
 # Run GDB on the test program up to where it will dump core.
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 gdb_test_no_output "set print sevenbit-strings"
 gdb_test_no_output "set width 0"
 
index e1ef8cf9f1bd7238f9e2f287e770d47c9675beb9..6fd3a594d93dbe0a5e26811eccae8576069df87f 100644 (file)
 # This is a test that verifies that GDB is able to "run" when the name
 # of the executable file contains a '!'.
 
-set testfile "args"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/bang!
+standard_testfile args.c
 
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
+if {[prepare_for_testing $testfile.exp ${testfile}! $srcfile \
+        {debug nowarnings}]} {
     untested bang.exp
     return -1
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
 # Verify that we can run the program and that it terminates normally.
 
 gdb_run_cmd
index 5c55308ef989f6eddabbf23ef7c2edf85e4b5f1e..42830c4f934519032d43d9db114eb368734f8a53 100644 (file)
 # This file is part of the gdb testsuite.  It is intended to test that
 # gdb could correctly handle floating point constant with a suffix.
 
-set testfile "bfp-test"
-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
 }
 
-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"
index 5cc0144053215316f9ce59faa17123ce7b766d65..ac3c5fb745e2ee2028d9a8ee9a5ee55ccd5a9656 100644 (file)
@@ -46,10 +46,8 @@ if { [istarget "*-*-*irix*"] } {
     return
 }
 
-set testfile "bigcore"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-set corefile ${objdir}/${subdir}/${testfile}.corefile
+standard_testfile .c
+set corefile ${binfile}.corefile
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
      untested bigcore.exp
@@ -58,10 +56,7 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
 
 # Run GDB on the bigcore program up-to where it will dump core.
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 gdb_test_no_output "set print sevenbit-strings"
 gdb_test_no_output "set width 0"
 
index a5b85eaec6c9e9a9786faafe23dcf46a68a67928..ceba529892c1ae73e26977cec0b2bb923db740d7 100644 (file)
 # This file was written by Fred Fish. (fnf@cygnus.com)
 
 
-set testfile "bitfields"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-    untested bitfields.exp
+standard_testfile
+
+if {[prepare_for_testing $testfile.exp $testfile $srcfile debug]} {
+    untested $testfile.exp
     return -1
 }
 
@@ -270,10 +269,6 @@ proc bitfield_internalvar {} {
     gdb_test "print \$myvar.f" "\\$\[0-9\]\+ = -1"
 }
 
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
 gdb_test_no_output "set print sevenbit-strings"
 
 bitfield_uniqueness
index 843da17a18b6aaf26bb4be3fc5f0b893fd576537..41a9e3bb09f6d6214c895e05a09a90cb1c798ee5 100644 (file)
@@ -23,9 +23,8 @@
 #
 
 
-set testfile "bitfields2"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
+
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
     untested bitfields2.exp
     return -1
@@ -279,9 +278,7 @@ proc bitfield_set {} {
     gdb_stop_suppressing_tests
 }
 
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 
 gdb_test_no_output "set print sevenbit-strings"
 runto_main
index 78f65dbbdf60ebba75dc02365e2ea34b31f9f80f..69484e7d2982be3c48f54f3aef54449a121a1701 100644 (file)
 # continues the process with the equivalent of "jump *$PC", which
 # triggers any breakpoint at $PC.  The latter is what we want to test.
 
-set testfile break-entry
+standard_testfile start.c
 
 if [target_info exists use_gdb_stub] {
     untested ${testfile}.exp
     return
 }
 
-if { [prepare_for_testing ${testfile}.exp ${testfile} start.c {additional_flags=-static}] } {
+if { [prepare_for_testing ${testfile}.exp ${testfile} $srcfile {additional_flags=-static}] } {
     return -1
 }
 
index 8707e3bb77955829fb2e765b0b4c87cd87d950a7..fe9cbb480ab6b51a46d9b394c1a2d1790083bd4b 100644 (file)
@@ -22,11 +22,11 @@ if { ![isnative] || [is_remote host] || [target_info exists use_gdb_stub]
 load_lib prelink-support.exp
 
 set test "break-interp"
-set binprefix ${objdir}/${subdir}/${test}
+set binprefix [standard_output_file ${test}]
 # Only to get the $interp_system name.
 set srcfile_test "start.c"
 set binfile_test ${test}-test
-set binfile_lib ${objdir}/${subdir}/${test}.so
+set binfile_lib ${binprefix}.so
 set srcfile "${test}-main.c"
 set srcfile_lib "${test}-lib.c"
 
@@ -83,7 +83,7 @@ gdb_test_multiple $test $test {
     }
 }
 
-set interp_system [section_get ${objdir}/${subdir}/$binfile_test .interp]
+set interp_system [section_get [standard_output_file $binfile_test] .interp]
 set interp_system_debug [system_debug_get $interp_system]
 verbose -log "$interp_system has debug $interp_system_debug"
 
@@ -390,10 +390,11 @@ proc test_ld {file ifmain trynosym displacement} {
     if $ifmain {
        gdb_test_no_output "set args segv"
     } else {
-       global objdir binfile_test
+       global binfile_test
 
        # ld.so needs some executable to run to reach _dl_debug_state.
-       gdb_test_no_output "set args ${objdir}/${subdir}/$binfile_test" "set args OBJDIR/${subdir}/$binfile_test"
+       gdb_test_no_output "set args [standard_output_file $binfile_test]" \
+           "set args OBJDIR/${subdir}/$binfile_test"
     }
 
     reach $solib_bp "run" $displacement
index 13db34708edcd581502f1a714fca73112761b318..7a4ef83682ecb686af82ad15413d06dafa590091 100644 (file)
 #
 if { [skip_cplus_tests] } { continue }
 
-set testfile "break-on-linker-gcd-function"
-set srcfile ${testfile}.cc
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .cc
 
 if [get_compiler_info "c++"] {
     return -1
 }
 
 set additional_flags {-ffunction-sections -Wl,--gc-sections}
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \
-          [list debug c++ additional_flags=$additional_flags]] != "" } {
-    untested $srcfile
+if {[prepare_for_testing $testfile.exp $testfile $srcfile \
+        [list debug c++ additional_flags=$additional_flags]]} {
+    untested $testfile.exp
     return -1
 }
 
-clean_restart $testfile
-
 # Single hex digit
 set xd {[0-9a-f]}
 
index dc96274c5becc5a486c57e23045c02627ae37779..009c6dffdf24c334eb8cbc317bb1e3e010e73e64 100644 (file)
 # 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 breakpoint-shadow
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-    untested "Couldn't compile test program"
+standard_testfile
+
+if {[prepare_for_testing $testfile.exp $testfile $srcfile debug]} {
+    untested $testfile.exp
     return -1
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
 # We need to start the inferior to place the breakpoints in the memory at all.
 if ![runto_main] {
     untested start
This page took 0.05868 seconds and 4 git commands to generate.