From: Tom Tromey Date: Thu, 12 Jul 2012 15:15:07 +0000 (+0000) Subject: * gdb.dwarf2/dup-psym.exp: Use prepare_for_testing_full. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=76027ef599f664d2c45574304d304abc962145c2;p=binutils-gdb.git * gdb.dwarf2/dup-psym.exp: Use prepare_for_testing_full. * gdb.dwarf2/dw2-anonymous-func.exp: Use prepare_for_testing_full. * gdb.dwarf2/dw2-basic.exp: Use prepare_for_testing_full. * gdb.dwarf2/dw2-compressed.exp: Use prepare_for_testing_full. * gdb.dwarf2/dw2-const.exp: Use prepare_for_testing_full. * gdb.dwarf2/dw2-cu-size.exp: Use prepare_for_testing_full. * gdb.dwarf2/dw2-intercu.exp: Use prepare_for_testing_full. * gdb.dwarf2/dw2-intermix.exp: Use prepare_for_testing_full. * gdb.dwarf2/dw2-linkage-name-trust.exp: Use prepare_for_testing_full. * gdb.dwarf2/dw2-producer.exp: Use prepare_for_testing_full. * gdb.dwarf2/dw2-ref-missing-frame.exp: Use prepare_for_testing_full. * gdb.dwarf2/dw2-restore.exp: Use prepare_for_testing_full. * gdb.dwarf2/dw2-strp.exp: Use prepare_for_testing_full. * gdb.dwarf2/mac-fileno.exp: Use prepare_for_testing_full. --- diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index c763b86cffa..ed944313fac 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,23 @@ +2012-07-12 Tom Tromey + + * gdb.dwarf2/dup-psym.exp: Use prepare_for_testing_full. + * gdb.dwarf2/dw2-anonymous-func.exp: Use + prepare_for_testing_full. + * gdb.dwarf2/dw2-basic.exp: Use prepare_for_testing_full. + * gdb.dwarf2/dw2-compressed.exp: Use prepare_for_testing_full. + * gdb.dwarf2/dw2-const.exp: Use prepare_for_testing_full. + * gdb.dwarf2/dw2-cu-size.exp: Use prepare_for_testing_full. + * gdb.dwarf2/dw2-intercu.exp: Use prepare_for_testing_full. + * gdb.dwarf2/dw2-intermix.exp: Use prepare_for_testing_full. + * gdb.dwarf2/dw2-linkage-name-trust.exp: Use + prepare_for_testing_full. + * gdb.dwarf2/dw2-producer.exp: Use prepare_for_testing_full. + * gdb.dwarf2/dw2-ref-missing-frame.exp: Use + prepare_for_testing_full. + * gdb.dwarf2/dw2-restore.exp: Use prepare_for_testing_full. + * gdb.dwarf2/dw2-strp.exp: Use prepare_for_testing_full. + * gdb.dwarf2/mac-fileno.exp: Use prepare_for_testing_full. + 2012-07-12 Tom Tromey * lib/gdb.exp (build_executable_from_specs): New proc, from diff --git a/gdb/testsuite/gdb.dwarf2/dup-psym.exp b/gdb/testsuite/gdb.dwarf2/dup-psym.exp index d4fa160dfb9..9ecd5e903ce 100644 --- a/gdb/testsuite/gdb.dwarf2/dup-psym.exp +++ b/gdb/testsuite/gdb.dwarf2/dup-psym.exp @@ -23,23 +23,11 @@ if {![dwarf2_support]} { standard_testfile .S -if { [gdb_compile "${srcdir}/${subdir}/main.c" "main.o" object {debug}] != "" } { +if {[prepare_for_testing_full $testfile.exp \ + [list $testfile {debug} main.c debug $srcfile nodebug]]} { return -1 } -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${testfile}.o" object {nodebug}] != "" } { - return -1 -} - -if { [gdb_compile "${testfile}.o main.o" "${binfile}" executable {debug}] != "" } { - return -1 -} - -gdb_exit -gdb_start -# Note that we do not change the sources search path, -gdb_load ${binfile} - set test "info sources should contain only one reference to file1.txt" gdb_test_multiple "info sources" "$test" { -re "file1\\.txt.*file1\\.txt.*$gdb_prompt $" { diff --git a/gdb/testsuite/gdb.dwarf2/dw2-anonymous-func.exp b/gdb/testsuite/gdb.dwarf2/dw2-anonymous-func.exp index ada66b061fb..82fbb2a1462 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-anonymous-func.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-anonymous-func.exp @@ -24,23 +24,11 @@ if {![dwarf2_support]} { standard_testfile .S set dwarf_srcfile "file1.txt" -if { [gdb_compile "${srcdir}/${subdir}/main.c" "main.o" object {debug}] != "" } { +if {[prepare_for_testing_full $testfile.exp \ + [list $testfile debug main.c debug $srcfile nodebug]]} { return -1 } -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${testfile}.o" object {nodebug}] != "" } { - return -1 -} - -if { [gdb_compile "${testfile}.o main.o" "${binfile}" executable {debug}] != "" } { - return -1 -} - -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} - # Force the debugger to create the file1.txt symtab, to make sure that # the debugger does not crash doing so. gdb_test "list file1.txt:1" "File 1 Line 1.*File 1 Line 8" "list file1.txt" diff --git a/gdb/testsuite/gdb.dwarf2/dw2-basic.exp b/gdb/testsuite/gdb.dwarf2/dw2-basic.exp index 90b112b7a92..fa11ebee787 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-basic.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-basic.exp @@ -24,23 +24,11 @@ if {![dwarf2_support]} { standard_testfile .S set dwarf_srcfile "file1.txt" -if { [gdb_compile "${srcdir}/${subdir}/main.c" "main.o" object {debug}] != "" } { +if {[prepare_for_testing_full $testfile.exp \ + [list $testfile debug main.c debug $srcfile nodebug]]} { return -1 } -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${testfile}.o" object {nodebug}] != "" } { - return -1 -} - -if { [gdb_compile "${testfile}.o main.o" "${binfile}" executable {debug}] != "" } { - return -1 -} - -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} - set remote_dwarf_srcfile [remote_download host ${srcdir}/${subdir}/${dwarf_srcfile}] gdb_test_no_output "set listsize 1" diff --git a/gdb/testsuite/gdb.dwarf2/dw2-compressed.exp b/gdb/testsuite/gdb.dwarf2/dw2-compressed.exp index 7cc276c0e7c..cfb4f335697 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-compressed.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-compressed.exp @@ -24,23 +24,13 @@ if {![dwarf2_support]} { standard_testfile .S set dwarf_srcfile "file1.txt" -if { [gdb_compile "${srcdir}/${subdir}/main.c" "main-ndebug.o" object -g0] != "" } { +if {[prepare_for_testing_full $testfile.exp \ + [list $testfile \ + {debug additional_flags=-static additional_flags=-nostdlib} \ + main.c -g0 $srcfile nodebug]]} { return -1 } -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${testfile}.o" object {nodebug}] != "" } { - return -1 -} - -if { [gdb_compile "${testfile}.o main-ndebug.o -static -nostdlib" "${binfile}" executable {debug}] != "" } { - return -1 -} - -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} - set remote_dwarf_srcfile [remote_download host ${srcdir}/${subdir}/${dwarf_srcfile}] gdb_test_no_output "set listsize 1" diff --git a/gdb/testsuite/gdb.dwarf2/dw2-const.exp b/gdb/testsuite/gdb.dwarf2/dw2-const.exp index 087fca97de0..94820576e5a 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-const.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-const.exp @@ -21,20 +21,11 @@ if {![dwarf2_support]} { standard_testfile .S -if { [gdb_compile "${srcdir}/${subdir}/main.c" "main.o" object {debug}] != "" } { +if {[prepare_for_testing_full $testfile.exp \ + [list $testfile debug main.c debug $srcfile nodebug]]} { return -1 } -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${testfile}.o" object {nodebug}] != "" } { - return -1 -} - -if { [gdb_compile "${testfile}.o main.o" "${binfile}" executable {debug}] != "" } { - return -1 -} - -clean_restart ${testfile} - gdb_test "print twelve" "= 12" gdb_test "print/x val8" " = 0xffffffff00000000" diff --git a/gdb/testsuite/gdb.dwarf2/dw2-cu-size.exp b/gdb/testsuite/gdb.dwarf2/dw2-cu-size.exp index 7ac0df7b384..10dd3ecca30 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-cu-size.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-cu-size.exp @@ -26,21 +26,9 @@ if {![dwarf2_support]} { standard_testfile .S -if { [gdb_compile "${srcdir}/${subdir}/main.c" "main.o" object {debug}] != "" } { +if {[prepare_for_testing_full $testfile.exp \ + [list $testfile debug main.c debug $srcfile nodebug]]} { return -1 } -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${testfile}.o" object {nodebug}] != "" } { - return -1 -} - -if { [gdb_compile "${testfile}.o main.o" "${binfile}" executable {debug}] != "" } { - return -1 -} - -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} - gdb_test "ptype noloc" "type = const int" diff --git a/gdb/testsuite/gdb.dwarf2/dw2-intercu.exp b/gdb/testsuite/gdb.dwarf2/dw2-intercu.exp index 2eaac65d9eb..dd836c5829b 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-intercu.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-intercu.exp @@ -24,23 +24,11 @@ if {![dwarf2_support]} { standard_testfile .S set dwarf_srcfile "file1.txt" -if { [gdb_compile "${srcdir}/${subdir}/main.c" "main.o" object {debug}] != "" } { +if {[prepare_for_testing_full $testfile.exp \ + [list $testfile debug main.c debug $srcfile nodebug]]} { return -1 } -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${testfile}.o" object {nodebug}] != "" } { - return -1 -} - -if { [gdb_compile "${testfile}.o main.o" "${binfile}" executable {debug}] != "" } { - return -1 -} - -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} - set remote_dwarf_srcfile [remote_download host ${srcdir}/${subdir}/${dwarf_srcfile}] # This needs to be done first so that the CU for int2 gets expanded first. diff --git a/gdb/testsuite/gdb.dwarf2/dw2-intermix.exp b/gdb/testsuite/gdb.dwarf2/dw2-intermix.exp index 0f765452e32..2ea96bcf2aa 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-intermix.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-intermix.exp @@ -24,23 +24,11 @@ if {![dwarf2_support]} { standard_testfile .S set dwarf_srcfile "file1.txt" -if { [gdb_compile "${srcdir}/${subdir}/main.c" "main.o" object {debug}] != "" } { +if {[prepare_for_testing_full $testfile.exp \ + [list $testfile debug main.c debug $srcfile nodebug]]} { return -1 } -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${testfile}.o" object {nodebug}] != "" } { - return -1 -} - -if { [gdb_compile "${testfile}.o main.o" "${binfile}" executable {debug}] != "" } { - return -1 -} - -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} - set remote_dwarf_srcfile [remote_download host ${srcdir}/${subdir}/${dwarf_srcfile}] gdb_test_no_output "set listsize 1" diff --git a/gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.exp b/gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.exp index 9eae088fea8..785744919db 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.exp @@ -25,16 +25,15 @@ if {![dwarf2_support]} { return 0 } -standard_testfile +standard_testfile .S set executable ${testfile} -if { [gdb_compile ${srcdir}/${subdir}/${testfile}-main.cc "${objdir}/${subdir}/${testfile}-main.o" object {c++ debug}] != "" - || [gdb_compile "${srcdir}/${subdir}/${testfile}.S" "${objdir}/${subdir}/${testfile}.o" object {}] != "" - || [gdb_compile "${objdir}/${subdir}/${testfile}-main.o ${objdir}/${subdir}/${testfile}.o" "${binfile}" executable {c++}] != "" } { + +if {[prepare_for_testing_full $testfile.exp \ + [list $testfile c++ $testfile-main.cc {c++ debug} \ + $srcfile {}]]} { return -1 } -clean_restart $executable - if ![runto_main] then { return -1 } diff --git a/gdb/testsuite/gdb.dwarf2/dw2-producer.exp b/gdb/testsuite/gdb.dwarf2/dw2-producer.exp index 0961081d964..29a62c88027 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-producer.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-producer.exp @@ -22,23 +22,11 @@ if {![dwarf2_support]} { standard_testfile .S set dwarf_srcfile "file1.txt" -if { [gdb_compile "${srcdir}/${subdir}/main.c" "main.o" object {debug}] != "" } { +if {[prepare_for_testing_full $testfile.exp \ + [list $testfile debug main.c debug $srcfile nodebug]]} { return -1 } -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${testfile}.o" object {nodebug}] != "" } { - return -1 -} - -if { [gdb_compile "${testfile}.o main.o" "${binfile}" executable {debug}] != "" } { - return -1 -} - -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} - set remote_dwarf_srcfile [remote_download host ${srcdir}/${subdir}/${dwarf_srcfile}] gdb_test_no_output "set listsize 1" diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp b/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp index 75c1eb4ed88..74fb6989544 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp @@ -20,22 +20,16 @@ if {![dwarf2_support]} { } standard_testfile .S -set objsfile [standard_output_file ${testfile}.o] set srcfuncfile ${testfile}-func.c -set objfuncfile [standard_output_file ${testfile}-func.o] set srcmainfile ${testfile}-main.c -set objmainfile [standard_output_file ${testfile}-main.o] set executable ${testfile} -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" $objsfile object {}] != "" - || [gdb_compile "${srcdir}/${subdir}/${srcfuncfile}" $objfuncfile object {}] != "" - || [gdb_compile "${srcdir}/${subdir}/${srcmainfile}" $objmainfile object {debug}] != "" - || [gdb_compile "$objsfile $objfuncfile $objmainfile" $binfile executable {}] != "" } { +if {[prepare_for_testing_full $testfile.exp \ + [list $testfile {} $srcfile {} $srcfuncfile {} \ + $srcmainfile debug]]} { return -1 } -clean_restart $executable - # First try referencing DW_AT_frame_base which is not defined. if [runto func_nofb] { gdb_test "p func_nofb_var" {Could not find the frame base for "func_nofb".} "func_nofb print" diff --git a/gdb/testsuite/gdb.dwarf2/dw2-restore.exp b/gdb/testsuite/gdb.dwarf2/dw2-restore.exp index 99d8191b6da..081655a4527 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-restore.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-restore.exp @@ -21,16 +21,11 @@ if {![istarget x86_64-*] || ![is_lp64_target]} { } standard_testfile .S -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \ - [list {additional_flags=-nostdlib}]] != "" } { +if {[prepare_for_testing $testfile.exp $testfile [list $srcfile] \ + [list {additional_flags=-nostdlib}]]} { return -1 } -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} - if ![runto foo] { return 0 } diff --git a/gdb/testsuite/gdb.dwarf2/dw2-strp.exp b/gdb/testsuite/gdb.dwarf2/dw2-strp.exp index b98833e61a6..d2820ae9fe9 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-strp.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-strp.exp @@ -24,23 +24,11 @@ if {![dwarf2_support]} { standard_testfile .S -if { [gdb_compile "${srcdir}/${subdir}/main.c" "main.o" object {debug}] != "" } { +if {[prepare_for_testing_full $testfile.exp \ + [list $testfile debug main.c debug $srcfile nodebug]]} { return -1 } -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${testfile}.o" object {nodebug}] != "" } { - return -1 -} - -if { [gdb_compile "${testfile}.o main.o" "${binfile}" executable {debug}] != "" } { - return -1 -} - -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} - gdb_test "p a_string" " = \"hello world!\\\\n\"" gdb_test "ptype a_string" "type = const char \\\[14\\\]" diff --git a/gdb/testsuite/gdb.dwarf2/mac-fileno.exp b/gdb/testsuite/gdb.dwarf2/mac-fileno.exp index b329081784b..6e8bd9ec361 100644 --- a/gdb/testsuite/gdb.dwarf2/mac-fileno.exp +++ b/gdb/testsuite/gdb.dwarf2/mac-fileno.exp @@ -25,23 +25,11 @@ if {![dwarf2_support]} { standard_testfile .S set dwarf_srcfile "file1.txt" -if { [gdb_compile "${srcdir}/${subdir}/main.c" "main.o" object {debug}] != "" } { +if {[prepare_for_testing_full $testfile.exp \ + [list $testfile debug main.c debug $srcfile nodebug]]} { return -1 } -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${testfile}.o" object {nodebug}] != "" } { - return -1 -} - -if { [gdb_compile "${testfile}.o main.o" "${binfile}" executable {debug}] != "" } { - return -1 -} - -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} - set remote_dwarf_srcfile [remote_download host ${srcdir}/${subdir}/${dwarf_srcfile}] gdb_test_no_output "set listsize 1"