From c83ee9021b77f1c88121ab6abd3224fbcaa530ca Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 27 Jun 2012 17:00:09 +0000 Subject: [PATCH] * gdb.dwarf2/pr10770.exp: Use standard_testfile. * gdb.dwarf2/dw2-var-zero-addr.exp: Use standard_testfile. * gdb.dwarf2/dw2-param-error.exp: Use standard_testfile. * gdb.dwarf2/dw2-op-call.exp: Use standard_testfile. * gdb.dwarf2/dw2-inline-param.exp: Use standard_testfile, prepare_for_testing. * gdb.dwarf2/dw2-inline-break.exp: Use standard_testfile. * gdb.dwarf2/dw2-ifort-parameter.exp: Use standard_testfile. * gdb.dwarf2/dw2-cp-infcall-ref-static.exp: Use standard_testfile. * gdb.dwarf2/dw2-case-insensitive.exp: Use standard_testfile. * gdb.dwarf2/dw4-sig-types.exp: Use standard_testfile. * gdb.dwarf2/dw2-objfile-overlap.exp: Use standard_testfile. * gdb.dwarf2/callframecfa.exp: Use standard_testfile, prepare_for_testing. * gdb.dwarf2/dup-psym.exp: Use standard_testfile. * gdb.dwarf2/dw2-ada-ffffffff.exp: Use standard_testfile. * gdb.dwarf2/dw2-anonymous-func.exp: Use standard_testfile. * gdb.dwarf2/dw2-bad-parameter-type.exp: Use standard_testfile. * gdb.dwarf2/dw2-basic.exp: Use standard_testfile. * gdb.dwarf2/dw2-compressed.exp: Use standard_testfile. * gdb.dwarf2/dw2-const.exp: Use standard_testfile. * gdb.dwarf2/dw2-cu-size.exp: Use standard_testfile. * gdb.dwarf2/dw2-double-set-die-type.exp: Use standard_testfile. * gdb.dwarf2/dw2-empty-namespace.exp: Use standard_testfile. * gdb.dwarf2/dw2-empty-pc-range.exp: Use standard_testfile. * gdb.dwarf2/dw2-filename.exp: Use standard_testfile. * gdb.dwarf2/dw2-icc-opaque.exp: Use standard_testfile. * gdb.dwarf2/dw2-inheritance.exp: Use standard_testfile. * gdb.dwarf2/dw2-intercu.exp: Use standard_testfile. * gdb.dwarf2/dw2-intermix.exp: Use standard_testfile. * gdb.dwarf2/dw2-linkage-name-trust.exp: Use standard_testfile. * gdb.dwarf2/dw2-modula2-self-type.exp: Use standard_testfile. * gdb.dwarf2/dw2-namespaceless-anonymous.exp: Use standard_testfile. * gdb.dwarf2/dw2-op-stack-value.exp: Use standard_testfile. * gdb.dwarf2/dw2-producer.exp: Use standard_testfile. * gdb.dwarf2/dw2-ranges.exp: Use standard_testfile, standard_output_file. * gdb.dwarf2/dw2-ref-missing-frame.exp: Use standard_testfile, standard_output_file. * gdb.dwarf2/dw2-restore.exp: Use standard_testfile. * gdb.dwarf2/dw2-simple-locdesc.exp: Use standard_testfile. * gdb.dwarf2/dw2-skip-prologue.exp: Use standard_testfile. * gdb.dwarf2/dw2-stack-boundary.exp: Use standard_testfile. * gdb.dwarf2/dw2-strp.exp: Use standard_testfile. * gdb.dwarf2/dw4-sig-type-unused.exp: Use standard_testfile. * gdb.dwarf2/implptr-64bit.exp: Use standard_testfile. * gdb.dwarf2/implptr-optimized-out.exp: Use standard_testfile. * gdb.dwarf2/implptr.exp: Use standard_testfile. * gdb.dwarf2/mac-fileno.exp: Use standard_testfile. * gdb.dwarf2/member-ptr-forwardref.exp: Use standard_testfile. * gdb.dwarf2/pieces.exp: Use standard_testfile. * gdb.dwarf2/pr11465.exp: Use standard_testfile. * gdb.dwarf2/pr13961.exp: Use standard_testfile. * gdb.dwarf2/valop.exp: Use standard_testfile, prepare_for_testing. --- gdb/testsuite/ChangeLog | 59 +++++++++++++++++++ gdb/testsuite/gdb.dwarf2/callframecfa.exp | 13 +--- gdb/testsuite/gdb.dwarf2/dup-psym.exp | 4 +- gdb/testsuite/gdb.dwarf2/dw2-ada-ffffffff.exp | 6 +- .../gdb.dwarf2/dw2-anonymous-func.exp | 4 +- .../gdb.dwarf2/dw2-bad-parameter-type.exp | 6 +- gdb/testsuite/gdb.dwarf2/dw2-basic.exp | 4 +- .../gdb.dwarf2/dw2-case-insensitive.exp | 5 +- gdb/testsuite/gdb.dwarf2/dw2-compressed.exp | 4 +- gdb/testsuite/gdb.dwarf2/dw2-const.exp | 6 +- .../gdb.dwarf2/dw2-cp-infcall-ref-static.exp | 6 +- gdb/testsuite/gdb.dwarf2/dw2-cu-size.exp | 4 +- .../gdb.dwarf2/dw2-double-set-die-type.exp | 9 +-- .../gdb.dwarf2/dw2-empty-namespace.exp | 9 ++- .../gdb.dwarf2/dw2-empty-pc-range.exp | 6 +- gdb/testsuite/gdb.dwarf2/dw2-filename.exp | 6 +- gdb/testsuite/gdb.dwarf2/dw2-icc-opaque.exp | 6 +- .../gdb.dwarf2/dw2-ifort-parameter.exp | 5 +- gdb/testsuite/gdb.dwarf2/dw2-inheritance.exp | 9 ++- gdb/testsuite/gdb.dwarf2/dw2-inline-break.exp | 5 +- gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp | 9 ++- gdb/testsuite/gdb.dwarf2/dw2-intercu.exp | 4 +- gdb/testsuite/gdb.dwarf2/dw2-intermix.exp | 4 +- .../gdb.dwarf2/dw2-linkage-name-trust.exp | 3 +- .../gdb.dwarf2/dw2-modula2-self-type.exp | 7 +-- .../dw2-namespaceless-anonymous.exp | 9 ++- .../gdb.dwarf2/dw2-objfile-overlap.exp | 7 ++- gdb/testsuite/gdb.dwarf2/dw2-op-call.exp | 6 +- .../gdb.dwarf2/dw2-op-stack-value.exp | 9 ++- gdb/testsuite/gdb.dwarf2/dw2-param-error.exp | 6 +- gdb/testsuite/gdb.dwarf2/dw2-producer.exp | 4 +- gdb/testsuite/gdb.dwarf2/dw2-ranges.exp | 18 +++--- .../gdb.dwarf2/dw2-ref-missing-frame.exp | 12 ++-- gdb/testsuite/gdb.dwarf2/dw2-restore.exp | 4 +- .../gdb.dwarf2/dw2-simple-locdesc.exp | 7 +-- .../gdb.dwarf2/dw2-skip-prologue.exp | 3 +- .../gdb.dwarf2/dw2-stack-boundary.exp | 5 +- gdb/testsuite/gdb.dwarf2/dw2-strp.exp | 4 +- .../gdb.dwarf2/dw2-var-zero-addr.exp | 6 +- .../gdb.dwarf2/dw4-sig-type-unused.exp | 6 +- gdb/testsuite/gdb.dwarf2/dw4-sig-types.exp | 9 ++- gdb/testsuite/gdb.dwarf2/implptr-64bit.exp | 3 +- .../gdb.dwarf2/implptr-optimized-out.exp | 4 +- gdb/testsuite/gdb.dwarf2/implptr.exp | 6 +- gdb/testsuite/gdb.dwarf2/mac-fileno.exp | 4 +- .../gdb.dwarf2/member-ptr-forwardref.exp | 6 +- gdb/testsuite/gdb.dwarf2/pieces.exp | 6 +- gdb/testsuite/gdb.dwarf2/pr10770.exp | 3 +- gdb/testsuite/gdb.dwarf2/pr11465.exp | 7 +-- gdb/testsuite/gdb.dwarf2/pr13961.exp | 6 +- gdb/testsuite/gdb.dwarf2/valop.exp | 13 +--- 51 files changed, 178 insertions(+), 198 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index e412100df8d..283bd033c42 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,62 @@ +2012-06-27 Tom Tromey + + * gdb.dwarf2/pr10770.exp: Use standard_testfile. + * gdb.dwarf2/dw2-var-zero-addr.exp: Use standard_testfile. + * gdb.dwarf2/dw2-param-error.exp: Use standard_testfile. + * gdb.dwarf2/dw2-op-call.exp: Use standard_testfile. + * gdb.dwarf2/dw2-inline-param.exp: Use standard_testfile, + prepare_for_testing. + * gdb.dwarf2/dw2-inline-break.exp: Use standard_testfile. + * gdb.dwarf2/dw2-ifort-parameter.exp: Use standard_testfile. + * gdb.dwarf2/dw2-cp-infcall-ref-static.exp: Use + standard_testfile. + * gdb.dwarf2/dw2-case-insensitive.exp: Use standard_testfile. + * gdb.dwarf2/dw4-sig-types.exp: Use standard_testfile. + * gdb.dwarf2/dw2-objfile-overlap.exp: Use standard_testfile. + * gdb.dwarf2/callframecfa.exp: Use standard_testfile, + prepare_for_testing. + * gdb.dwarf2/dup-psym.exp: Use standard_testfile. + * gdb.dwarf2/dw2-ada-ffffffff.exp: Use standard_testfile. + * gdb.dwarf2/dw2-anonymous-func.exp: Use standard_testfile. + * gdb.dwarf2/dw2-bad-parameter-type.exp: Use standard_testfile. + * gdb.dwarf2/dw2-basic.exp: Use standard_testfile. + * gdb.dwarf2/dw2-compressed.exp: Use standard_testfile. + * gdb.dwarf2/dw2-const.exp: Use standard_testfile. + * gdb.dwarf2/dw2-cu-size.exp: Use standard_testfile. + * gdb.dwarf2/dw2-double-set-die-type.exp: Use standard_testfile. + * gdb.dwarf2/dw2-empty-namespace.exp: Use standard_testfile. + * gdb.dwarf2/dw2-empty-pc-range.exp: Use standard_testfile. + * gdb.dwarf2/dw2-filename.exp: Use standard_testfile. + * gdb.dwarf2/dw2-icc-opaque.exp: Use standard_testfile. + * gdb.dwarf2/dw2-inheritance.exp: Use standard_testfile. + * gdb.dwarf2/dw2-intercu.exp: Use standard_testfile. + * gdb.dwarf2/dw2-intermix.exp: Use standard_testfile. + * gdb.dwarf2/dw2-linkage-name-trust.exp: Use standard_testfile. + * gdb.dwarf2/dw2-modula2-self-type.exp: Use standard_testfile. + * gdb.dwarf2/dw2-namespaceless-anonymous.exp: Use standard_testfile. + * gdb.dwarf2/dw2-op-stack-value.exp: Use standard_testfile. + * gdb.dwarf2/dw2-producer.exp: Use standard_testfile. + * gdb.dwarf2/dw2-ranges.exp: Use standard_testfile, + standard_output_file. + * gdb.dwarf2/dw2-ref-missing-frame.exp: Use standard_testfile, + standard_output_file. + * gdb.dwarf2/dw2-restore.exp: Use standard_testfile. + * gdb.dwarf2/dw2-simple-locdesc.exp: Use standard_testfile. + * gdb.dwarf2/dw2-skip-prologue.exp: Use standard_testfile. + * gdb.dwarf2/dw2-stack-boundary.exp: Use standard_testfile. + * gdb.dwarf2/dw2-strp.exp: Use standard_testfile. + * gdb.dwarf2/dw4-sig-type-unused.exp: Use standard_testfile. + * gdb.dwarf2/implptr-64bit.exp: Use standard_testfile. + * gdb.dwarf2/implptr-optimized-out.exp: Use standard_testfile. + * gdb.dwarf2/implptr.exp: Use standard_testfile. + * gdb.dwarf2/mac-fileno.exp: Use standard_testfile. + * gdb.dwarf2/member-ptr-forwardref.exp: Use standard_testfile. + * gdb.dwarf2/pieces.exp: Use standard_testfile. + * gdb.dwarf2/pr11465.exp: Use standard_testfile. + * gdb.dwarf2/pr13961.exp: Use standard_testfile. + * gdb.dwarf2/valop.exp: Use standard_testfile, + prepare_for_testing. + 2012-06-27 Tom Tromey * gdb.python/python.exp: Fix regexps in pagination tests. diff --git a/gdb/testsuite/gdb.dwarf2/callframecfa.exp b/gdb/testsuite/gdb.dwarf2/callframecfa.exp index f527b1489e5..4d989f1540d 100644 --- a/gdb/testsuite/gdb.dwarf2/callframecfa.exp +++ b/gdb/testsuite/gdb.dwarf2/callframecfa.exp @@ -25,20 +25,13 @@ if {![is_x86_like_target]} { return 0 } -set testfile "callframecfa" -set srcfile ${testfile}.S -set binfile ${objdir}/${subdir}/${testfile}.x +standard_testfile .S -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \ - [list {additional_flags=-nostdlib}]] != "" } { +if {[prepare_for_testing $testname.exp $testname $srcfile \ + [list {additional_flags=-nostdlib}]]} { return -1 } -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} - if ![runto_main] { return -1 } diff --git a/gdb/testsuite/gdb.dwarf2/dup-psym.exp b/gdb/testsuite/gdb.dwarf2/dup-psym.exp index ec295355776..d4fa160dfb9 100644 --- a/gdb/testsuite/gdb.dwarf2/dup-psym.exp +++ b/gdb/testsuite/gdb.dwarf2/dup-psym.exp @@ -21,9 +21,7 @@ if {![dwarf2_support]} { return 0 } -set testfile "dup-psym" -set srcfile ${testfile}.S -set binfile ${objdir}/${subdir}/${testfile}.x +standard_testfile .S if { [gdb_compile "${srcdir}/${subdir}/main.c" "main.o" object {debug}] != "" } { return -1 diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ada-ffffffff.exp b/gdb/testsuite/gdb.dwarf2/dw2-ada-ffffffff.exp index 5a3cceed778..4e87217b53e 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-ada-ffffffff.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-ada-ffffffff.exp @@ -19,10 +19,8 @@ if {![dwarf2_support]} { return 0 } -set testfile "dw2-ada-ffffffff" -set srcfile ${testfile}.S -set executable ${testfile}.x -set binfile ${objdir}/${subdir}/${executable} +standard_testfile .S +set executable ${testfile} if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {}] != "" } { return -1 diff --git a/gdb/testsuite/gdb.dwarf2/dw2-anonymous-func.exp b/gdb/testsuite/gdb.dwarf2/dw2-anonymous-func.exp index 54303999721..ada66b061fb 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-anonymous-func.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-anonymous-func.exp @@ -21,10 +21,8 @@ if {![dwarf2_support]} { return 0 } -set testfile "dw2-anonymous-func" +standard_testfile .S set dwarf_srcfile "file1.txt" -set srcfile ${testfile}.S -set binfile ${objdir}/${subdir}/${testfile}.x if { [gdb_compile "${srcdir}/${subdir}/main.c" "main.o" object {debug}] != "" } { return -1 diff --git a/gdb/testsuite/gdb.dwarf2/dw2-bad-parameter-type.exp b/gdb/testsuite/gdb.dwarf2/dw2-bad-parameter-type.exp index 91d86ce73eb..6f8a764cfb9 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-bad-parameter-type.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-bad-parameter-type.exp @@ -19,10 +19,8 @@ if {![dwarf2_support]} { return 0 } -set testfile "dw2-bad-parameter-type" -set srcfile ${testfile}.S -set executable ${testfile}.x -set binfile ${objdir}/${subdir}/${executable} +standard_testfile .S +set executable ${testfile} # First try referencing DW_AT_frame_base which is not defined. if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {}] != "" } { diff --git a/gdb/testsuite/gdb.dwarf2/dw2-basic.exp b/gdb/testsuite/gdb.dwarf2/dw2-basic.exp index 9100eb7920e..90b112b7a92 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-basic.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-basic.exp @@ -21,10 +21,8 @@ if {![dwarf2_support]} { return 0 } -set testfile "dw2-basic" +standard_testfile .S set dwarf_srcfile "file1.txt" -set srcfile ${testfile}.S -set binfile ${objdir}/${subdir}/${testfile}.x if { [gdb_compile "${srcdir}/${subdir}/main.c" "main.o" object {debug}] != "" } { return -1 diff --git a/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive.exp b/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive.exp index 8f58830a5af..3559e7cf1c5 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive.exp @@ -19,9 +19,10 @@ if {![dwarf2_support]} { return 0 } -set testfile "dw2-case-insensitive" +standard_testfile .c dw2-case-insensitive-debug.S -if { [prepare_for_testing ${testfile}.exp ${testfile} [list ${testfile}.c ${testfile}-debug.S] {nodebug}] } { +if { [prepare_for_testing ${testfile}.exp ${testfile} \ + [list $srcfile $srcfile2] {nodebug}] } { return -1 } diff --git a/gdb/testsuite/gdb.dwarf2/dw2-compressed.exp b/gdb/testsuite/gdb.dwarf2/dw2-compressed.exp index aec50a90edb..7cc276c0e7c 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-compressed.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-compressed.exp @@ -21,10 +21,8 @@ if {![dwarf2_support]} { return 0 } -set testfile "dw2-compressed" +standard_testfile .S set dwarf_srcfile "file1.txt" -set srcfile ${testfile}.S -set binfile ${objdir}/${subdir}/${testfile}.x if { [gdb_compile "${srcdir}/${subdir}/main.c" "main-ndebug.o" object -g0] != "" } { return -1 diff --git a/gdb/testsuite/gdb.dwarf2/dw2-const.exp b/gdb/testsuite/gdb.dwarf2/dw2-const.exp index 6e2dc42929b..087fca97de0 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-const.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-const.exp @@ -19,9 +19,7 @@ if {![dwarf2_support]} { return 0 } -set testfile "dw2-const" -set srcfile ${testfile}.S -set binfile ${objdir}/${subdir}/${testfile}.x +standard_testfile .S if { [gdb_compile "${srcdir}/${subdir}/main.c" "main.o" object {debug}] != "" } { return -1 @@ -35,7 +33,7 @@ if { [gdb_compile "${testfile}.o main.o" "${binfile}" executable {debug}] != "" return -1 } -clean_restart ${testfile}.x +clean_restart ${testfile} gdb_test "print twelve" "= 12" diff --git a/gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.exp b/gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.exp index 8f6aebe5072..34e1da46b4c 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.exp @@ -25,8 +25,10 @@ if {![dwarf2_support]} { return 0 } -set testfile "dw2-cp-infcall-ref-static" -if { [prepare_for_testing ${testfile}.exp ${testfile} [list ${testfile}-main.c ${testfile}.S] {}] } { +standard_testfile .S dw2-cp-infcall-ref-static-main.c + +if { [prepare_for_testing ${testfile}.exp ${testfile} \ + [list $srcfile2 $srcfile] {}] } { return -1 } diff --git a/gdb/testsuite/gdb.dwarf2/dw2-cu-size.exp b/gdb/testsuite/gdb.dwarf2/dw2-cu-size.exp index 3c669a4d1fc..7ac0df7b384 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-cu-size.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-cu-size.exp @@ -24,9 +24,7 @@ if {![dwarf2_support]} { return 0 } -set testfile "dw2-cu-size" -set srcfile ${testfile}.S -set binfile ${objdir}/${subdir}/${testfile}.x +standard_testfile .S if { [gdb_compile "${srcdir}/${subdir}/main.c" "main.o" object {debug}] != "" } { return -1 diff --git a/gdb/testsuite/gdb.dwarf2/dw2-double-set-die-type.exp b/gdb/testsuite/gdb.dwarf2/dw2-double-set-die-type.exp index 5fa4075aa1e..b85d8ed7626 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-double-set-die-type.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-double-set-die-type.exp @@ -22,15 +22,12 @@ if {![dwarf2_support]} { return 0 } -set testfile "dw2-double-set-die-type" -set srcfile "$testfile.S" -set executable "$testfile.x" +standard_testfile .S -if { [gdb_compile [file join $srcdir $subdir $srcfile] \ - [file join $objdir $subdir $executable] \ +if { [gdb_compile [file join $srcdir $subdir $srcfile] $binfile \ object {nodebug}] != "" } { return -1 } -clean_restart $executable +clean_restart $testfile gdb_test "ptype a" "type = class .*" diff --git a/gdb/testsuite/gdb.dwarf2/dw2-empty-namespace.exp b/gdb/testsuite/gdb.dwarf2/dw2-empty-namespace.exp index 1fb5541f950..02f2fcf25ec 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-empty-namespace.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-empty-namespace.exp @@ -21,15 +21,14 @@ if {![dwarf2_support]} { return 0 } -set testfile "dw2-empty-namespace" -set srcfile ${testfile}.S -set executable ${testfile}.x +standard_testfile .S -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objdir}/${subdir}/${executable}" object {nodebug}] != "" } { +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" $binfile \ + object {nodebug}] != "" } { return -1 } -clean_restart $executable +clean_restart $testfile # `p var' below can work without identified DWARF DIE just based on its ELF symbol. # Catch it here as `type = '. diff --git a/gdb/testsuite/gdb.dwarf2/dw2-empty-pc-range.exp b/gdb/testsuite/gdb.dwarf2/dw2-empty-pc-range.exp index d87dc9c8828..ee49890ee7d 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-empty-pc-range.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-empty-pc-range.exp @@ -19,10 +19,8 @@ if {![dwarf2_support]} { return 0 } -set testfile "dw2-empty-pc-range" -set srcfile ${testfile}.S -set executable ${testfile}.x -set binfile ${objdir}/${subdir}/${executable} +standard_testfile .S +set executable ${testfile} if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {}] != "" } { return -1 diff --git a/gdb/testsuite/gdb.dwarf2/dw2-filename.exp b/gdb/testsuite/gdb.dwarf2/dw2-filename.exp index 992a06cd158..5cc25343902 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-filename.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-filename.exp @@ -21,15 +21,13 @@ if {![dwarf2_support]} { return 0 } -set testfile "dw2-filename" -set srcfile ${testfile}.S -set binfile ${objdir}/${subdir}/${testfile}.x +standard_testfile .S if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {nodebug}] != "" } { return -1 } -clean_restart ${testfile}.x +clean_restart ${testfile} # Verify that -file-list-exec-source-files returns a list where # the "file" is "file1.txt" (file base name), and "fullname" is diff --git a/gdb/testsuite/gdb.dwarf2/dw2-icc-opaque.exp b/gdb/testsuite/gdb.dwarf2/dw2-icc-opaque.exp index 1c7bea5f22d..db78006b509 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-icc-opaque.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-icc-opaque.exp @@ -23,10 +23,8 @@ if {![dwarf2_support]} { return 0 } -set testfile "dw2-icc-opaque" -set srcfile ${testfile}.S -set executable ${testfile}.x -set binfile ${objdir}/${subdir}/${executable} +standard_testfile .S +set executable ${testfile} if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {}] != "" } { return -1 diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter.exp b/gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter.exp index c022c5dbfa5..d0c1dff23d6 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter.exp @@ -22,9 +22,10 @@ if {![dwarf2_support]} { return 0 } -set testfile "dw2-ifort-parameter" +standard_testfile .c dw2-ifort-parameter-debug.S -if { [prepare_for_testing ${testfile}.exp ${testfile} [list ${testfile}.c ${testfile}-debug.S] {nodebug}] } { +if { [prepare_for_testing ${testfile}.exp ${testfile} \ + [list $srcfile $srcfile2] {nodebug}] } { return -1 } diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inheritance.exp b/gdb/testsuite/gdb.dwarf2/dw2-inheritance.exp index 39138116156..aefe3f51743 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-inheritance.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-inheritance.exp @@ -22,14 +22,13 @@ if {![dwarf2_support]} { return 0 } -set testfile "dw2-inheritance" -set srcfile ${testfile}.S -set executable ${testfile}.x +standard_testfile .S -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objdir}/${subdir}/${executable}" object {nodebug}] != "" } { +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" $binfile \ + object {nodebug}] != "" } { return -1 } -clean_restart $executable +clean_restart $testfile gdb_test "ptype inherited" "type = class inherited .*" diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-break.exp b/gdb/testsuite/gdb.dwarf2/dw2-inline-break.exp index 2ef7145765d..4839d90430c 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-inline-break.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-break.exp @@ -29,9 +29,10 @@ if {![istarget "x86_64-*-*"] || ![is_lp64_target]} { } set basename "inline-break" -set testfile "dw2-$basename" -if { [prepare_for_testing $testfile.exp $testfile $testfile.S {nodebug}] } { +standard_testfile .S + +if { [prepare_for_testing $testfile.exp $testfile $srcfile {nodebug}] } { return -1 } diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp b/gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp index 73a5c79116d..30cfdc2692f 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp @@ -19,14 +19,13 @@ if {![dwarf2_support]} { return 0 } -set testfile dw2-inline-param -set binfile ${objdir}/${subdir}/${testfile} -if { [build_executable ${testfile}.exp "${testfile}" [list ${testfile}-main.c ${testfile}.S] {nodebug}] } { +standard_testfile .S dw2-inline-param-main.c + +if { [prepare_for_testing ${testfile}.exp "${testfile}" \ + [list $srcfile2 $srcfile] {nodebug}] } { return -1 } -clean_restart ${testfile} - set break_at "" set test "info addr break_at" gdb_test_multiple $test $test { diff --git a/gdb/testsuite/gdb.dwarf2/dw2-intercu.exp b/gdb/testsuite/gdb.dwarf2/dw2-intercu.exp index b3d04dac579..2eaac65d9eb 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-intercu.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-intercu.exp @@ -21,10 +21,8 @@ if {![dwarf2_support]} { return 0 } -set testfile "dw2-intercu" +standard_testfile .S set dwarf_srcfile "file1.txt" -set srcfile ${testfile}.S -set binfile ${objdir}/${subdir}/${testfile}.x if { [gdb_compile "${srcdir}/${subdir}/main.c" "main.o" object {debug}] != "" } { return -1 diff --git a/gdb/testsuite/gdb.dwarf2/dw2-intermix.exp b/gdb/testsuite/gdb.dwarf2/dw2-intermix.exp index 451b5f2d1e8..0f765452e32 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-intermix.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-intermix.exp @@ -21,10 +21,8 @@ if {![dwarf2_support]} { return 0 } -set testfile "dw2-intermix" +standard_testfile .S set dwarf_srcfile "file1.txt" -set srcfile ${testfile}.S -set binfile ${objdir}/${subdir}/${testfile}.x if { [gdb_compile "${srcdir}/${subdir}/main.c" "main.o" object {debug}] != "" } { return -1 diff --git a/gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.exp b/gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.exp index 42a5f451cdb..9eae088fea8 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.exp @@ -25,9 +25,8 @@ if {![dwarf2_support]} { return 0 } -set testfile "dw2-linkage-name-trust" +standard_testfile set executable ${testfile} -set binfile ${objdir}/${subdir}/${executable} 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++}] != "" } { diff --git a/gdb/testsuite/gdb.dwarf2/dw2-modula2-self-type.exp b/gdb/testsuite/gdb.dwarf2/dw2-modula2-self-type.exp index 970c17b2a7a..7a332547609 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-modula2-self-type.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-modula2-self-type.exp @@ -19,17 +19,14 @@ if {![dwarf2_support]} { return 0 } -set testfile "dw2-modula2-self-type" -set srcfile ${testfile}.S -set executable ${testfile}.x -set binfile ${objdir}/${subdir}/${executable} +standard_testfile .S # First try referencing DW_AT_frame_base which is not defined. if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {}] != "" } { return -1 } -clean_restart $executable +clean_restart $testfile # C language would just naively print: # type = void (*)(void (*)(void (*)(void (*)(void (*)(... diff --git a/gdb/testsuite/gdb.dwarf2/dw2-namespaceless-anonymous.exp b/gdb/testsuite/gdb.dwarf2/dw2-namespaceless-anonymous.exp index 32346ffdab7..5192861c073 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-namespaceless-anonymous.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-namespaceless-anonymous.exp @@ -19,15 +19,14 @@ if {![dwarf2_support]} { return 0 } -set testfile "dw2-namespaceless-anonymous" -set srcfile ${testfile}.S -set executable ${testfile}.x +standard_testfile .S -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objdir}/${subdir}/${executable}" object {nodebug}] != "" } { +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" $binfile \ + object {nodebug}] != "" } { return -1 } -clean_restart $executable +clean_restart $testfile gdb_test "ptype '(anonymous namespace)::v'" "type = myint" gdb_test "p '(anonymous namespace)::v'" " = 1" diff --git a/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap.exp b/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap.exp index 738fd5f7acb..cc2f75b9366 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap.exp @@ -19,12 +19,13 @@ if {![dwarf2_support]} { return 0 } -set testfile "dw2-objfile-overlap" +standard_testfile + set srcfile_outer ${testfile}-outer.S set srcfile_inner ${testfile}-inner.S set executable_outer ${testfile}-outer.x -set binfile_outer ${objdir}/${subdir}/${executable_outer} -set binfile_inner ${objdir}/${subdir}/${testfile}-inner.x +set binfile_outer ${binfile}-outer.x +set binfile_inner ${binfile}-inner.x if { [gdb_compile "${srcdir}/${subdir}/${srcfile_outer}" "${binfile_outer}" \ object {}] != "" diff --git a/gdb/testsuite/gdb.dwarf2/dw2-op-call.exp b/gdb/testsuite/gdb.dwarf2/dw2-op-call.exp index cd6e4f8af6b..dcd9b20f012 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-op-call.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-op-call.exp @@ -21,8 +21,10 @@ if {![dwarf2_support]} { return 0 } -set testfile "dw2-op-call" -if { [prepare_for_testing ${testfile}.exp ${testfile} [list ${testfile}.S main.c] {nodebug}] } { +standard_testfile .S main.c + +if { [prepare_for_testing ${testfile}.exp ${testfile} \ + [list $srcfile $srcfile2] {nodebug}] } { return -1 } diff --git a/gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.exp b/gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.exp index f731d7ba8e0..125b2af98d4 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.exp @@ -19,15 +19,14 @@ if {![dwarf2_support]} { return 0 } -set testfile "dw2-op-stack-value" -set srcfile ${testfile}.S -set executable ${testfile}.x +standard_testfile .S -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objdir}/${subdir}/${executable}" object {nodebug}] != "" } { +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" $binfile \ + object {nodebug}] != "" } { return -1 } -clean_restart $executable +clean_restart $testfile gdb_test "p/x stack2" " = 0x1" gdb_test "p/x stack8" " = 0x1" diff --git a/gdb/testsuite/gdb.dwarf2/dw2-param-error.exp b/gdb/testsuite/gdb.dwarf2/dw2-param-error.exp index 0799d1ecce3..71faee32037 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-param-error.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-param-error.exp @@ -19,8 +19,10 @@ if {![dwarf2_support]} { return 0 } -set testfile dw2-param-error -if { [prepare_for_testing ${testfile}.exp "${testfile}" "${testfile}-main.c ${testfile}.S" {nodebug}] } { +standard_testfile .S dw2-param-error-main.c + +if { [prepare_for_testing ${testfile}.exp "${testfile}" \ + [list $srcfile2 $srcfile] {nodebug}] } { return -1 } diff --git a/gdb/testsuite/gdb.dwarf2/dw2-producer.exp b/gdb/testsuite/gdb.dwarf2/dw2-producer.exp index 261b5b0457f..0961081d964 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-producer.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-producer.exp @@ -19,10 +19,8 @@ if {![dwarf2_support]} { return 0 } -set testfile "dw2-producer" +standard_testfile .S set dwarf_srcfile "file1.txt" -set srcfile ${testfile}.S -set binfile ${objdir}/${subdir}/${testfile}.x if { [gdb_compile "${srcdir}/${subdir}/main.c" "main.o" object {debug}] != "" } { return -1 diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ranges.exp b/gdb/testsuite/gdb.dwarf2/dw2-ranges.exp index 83abd2a4511..dea212d475d 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-ranges.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-ranges.exp @@ -32,17 +32,13 @@ if !$gcc_compiled { return 0 } -set testfile "dw2-ranges" -set srcfile ${testfile}.c -set srcfile2 ${testfile}2.c -set srcfile3 ${testfile}3.c -set asmfile ${objdir}/${subdir}/${testfile}.s -set asmfile2 ${objdir}/${subdir}/${testfile}2.s -set asmfile3 ${objdir}/${subdir}/${testfile}3.s -set objfile ${objdir}/${subdir}/${testfile}.o -set objfile2 ${objdir}/${subdir}/${testfile}2.o -set objfile3 ${objdir}/${subdir}/${testfile}3.o -set binfile ${objdir}/${subdir}/${testfile} +standard_testfile dw2-ranges.c dw2-ranges2.c dw2-ranges3.c +set asmfile [standard_output_file ${testfile}.s] +set asmfile2 [standard_output_file ${testfile}2.s] +set asmfile3 [standard_output_file ${testfile}3.s] +set objfile [standard_output_file ${testfile}.o] +set objfile2 [standard_output_file ${testfile}2.o] +set objfile3 [standard_output_file ${testfile}3.o] # Generate .s without debug info but provide debug info by the assembler. # This way we get DW_TAG_compile_unit DIE and only that DIE. diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp b/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp index 01960a674e3..75c1eb4ed88 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp @@ -19,17 +19,15 @@ if {![dwarf2_support]} { return 0 } -set testfile "dw2-ref-missing-frame" -set srcsfile ${testfile}.S -set objsfile ${objdir}/${subdir}/${testfile}.o +standard_testfile .S +set objsfile [standard_output_file ${testfile}.o] set srcfuncfile ${testfile}-func.c -set objfuncfile ${objdir}/${subdir}/${testfile}-func.o +set objfuncfile [standard_output_file ${testfile}-func.o] set srcmainfile ${testfile}-main.c -set objmainfile ${objdir}/${subdir}/${testfile}-main.o +set objmainfile [standard_output_file ${testfile}-main.o] set executable ${testfile} -set binfile ${objdir}/${subdir}/${executable} -if { [gdb_compile "${srcdir}/${subdir}/${srcsfile}" $objsfile object {}] != "" +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 {}] != "" } { diff --git a/gdb/testsuite/gdb.dwarf2/dw2-restore.exp b/gdb/testsuite/gdb.dwarf2/dw2-restore.exp index a04ab55109e..99d8191b6da 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-restore.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-restore.exp @@ -19,9 +19,7 @@ if {![istarget x86_64-*] || ![is_lp64_target]} { return 0 } -set testfile "dw2-restore" -set srcfile ${testfile}.S -set binfile ${objdir}/${subdir}/${testfile}.x +standard_testfile .S if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \ [list {additional_flags=-nostdlib}]] != "" } { diff --git a/gdb/testsuite/gdb.dwarf2/dw2-simple-locdesc.exp b/gdb/testsuite/gdb.dwarf2/dw2-simple-locdesc.exp index 72a075c86e4..77d42ecff0d 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-simple-locdesc.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-simple-locdesc.exp @@ -19,16 +19,13 @@ if {![dwarf2_support]} { return 0 } -set testfile "dw2-simple-locdesc" -set srcfile ${testfile}.S -set executable ${testfile}.x -set binfile ${objdir}/${subdir}/${executable} +standard_testfile .S if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {}] != "" } { return -1 } -clean_restart $executable +clean_restart $testfile # Re: [patch 2/2] Fix decode_locdesc for gcc-4.7.x optimized DWARF # http://sourceware.org/ml/gdb-patches/2011-07/msg00766.html diff --git a/gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.exp b/gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.exp index 31d0c6304d3..1367cb12706 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.exp @@ -36,9 +36,8 @@ if {![dwarf2_support]} { return 0 } -set testfile "dw2-skip-prologue" +standard_testfile set executable ${testfile} -set binfile ${objdir}/${subdir}/${executable} if {[build_executable ${testfile}.exp ${executable} "${testfile}.c ${testfile}.S" {additional_flags=-DINLINED}] == -1} { return -1 diff --git a/gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.exp b/gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.exp index 1468e95a36e..03dd576819c 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.exp @@ -19,10 +19,7 @@ if {![dwarf2_support]} { return 0 } -set testfile "dw2-stack-boundary" -set srcfile ${testfile}.S -set executable ${testfile}.x -set binfile ${objdir}/${subdir}/${executable} +standard_testfile .S if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {}] != "" } { return -1 diff --git a/gdb/testsuite/gdb.dwarf2/dw2-strp.exp b/gdb/testsuite/gdb.dwarf2/dw2-strp.exp index 41482972c43..b98833e61a6 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-strp.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-strp.exp @@ -22,9 +22,7 @@ if {![dwarf2_support]} { return 0 } -set testfile "dw2-strp" -set srcfile ${testfile}.S -set binfile ${objdir}/${subdir}/${testfile}.x +standard_testfile .S if { [gdb_compile "${srcdir}/${subdir}/main.c" "main.o" object {debug}] != "" } { return -1 diff --git a/gdb/testsuite/gdb.dwarf2/dw2-var-zero-addr.exp b/gdb/testsuite/gdb.dwarf2/dw2-var-zero-addr.exp index 9df6a7e6df9..e149fe1dfb4 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-var-zero-addr.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-var-zero-addr.exp @@ -19,8 +19,10 @@ if {![dwarf2_support]} { return 0 } -set testfile dw2-var-zero-addr -if [prepare_for_testing ${testfile}.exp ${testfile} [list ${testfile}.S main.c] {nodebug}] { +standard_testfile .S main.c + +if [prepare_for_testing ${testfile}.exp ${testfile} \ + [list $srcfile $srcfile2] {nodebug}] { return -1 } diff --git a/gdb/testsuite/gdb.dwarf2/dw4-sig-type-unused.exp b/gdb/testsuite/gdb.dwarf2/dw4-sig-type-unused.exp index 5cc195be10d..2baae8b62d1 100644 --- a/gdb/testsuite/gdb.dwarf2/dw4-sig-type-unused.exp +++ b/gdb/testsuite/gdb.dwarf2/dw4-sig-type-unused.exp @@ -19,10 +19,8 @@ if {![dwarf2_support]} { return 0 } -set testfile "dw4-sig-type-unused" -set srcfile ${testfile}.S -set executable ${testfile}.x -set binfile ${objdir}/${subdir}/${executable} +standard_testfile .S +set executable ${testfile} if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {}] != "" } { return -1 diff --git a/gdb/testsuite/gdb.dwarf2/dw4-sig-types.exp b/gdb/testsuite/gdb.dwarf2/dw4-sig-types.exp index 878627a6b00..d63597d9107 100644 --- a/gdb/testsuite/gdb.dwarf2/dw4-sig-types.exp +++ b/gdb/testsuite/gdb.dwarf2/dw4-sig-types.exp @@ -15,16 +15,15 @@ # Test dwarf4 signatured types. -set test "dw4-sig-types" -set executable ${test}.x +standard_testfile .cc dw4-sig-types-b.cc # This test is intended for targets which support DWARF-4. # Since we pass an explicit -gdwarf-4 to the compiler, we let # that be the test of whether the target supports it. -if { [prepare_for_testing "${test}.exp" "${executable}" \ - {dw4-sig-types.cc dw4-sig-types-b.cc} \ - {debug c++ additional_flags=-gdwarf-4}] } { +if { [prepare_for_testing "${test}.exp" "${testfile}" \ + [list $srcfile $srcfile2] \ + {debug c++ additional_flags=-gdwarf-4}] } { return -1 } diff --git a/gdb/testsuite/gdb.dwarf2/implptr-64bit.exp b/gdb/testsuite/gdb.dwarf2/implptr-64bit.exp index cd863899824..78f1594d1e6 100644 --- a/gdb/testsuite/gdb.dwarf2/implptr-64bit.exp +++ b/gdb/testsuite/gdb.dwarf2/implptr-64bit.exp @@ -19,8 +19,7 @@ if {![dwarf2_support]} { return 0 } -set testfile "implptr-64bit" -set srcfile ${testfile}.S +standard_testfile .S set mainfile main.c proc test { dwarf_version offset_size addr_size ref_addr_size } { diff --git a/gdb/testsuite/gdb.dwarf2/implptr-optimized-out.exp b/gdb/testsuite/gdb.dwarf2/implptr-optimized-out.exp index ac0f95ffc26..a810f7c0124 100644 --- a/gdb/testsuite/gdb.dwarf2/implptr-optimized-out.exp +++ b/gdb/testsuite/gdb.dwarf2/implptr-optimized-out.exp @@ -19,11 +19,9 @@ if {![dwarf2_support]} { return 0 } -set testfile "implptr-optimized-out" -set srcfile ${testfile}.S +standard_testfile .S set mainfile main.c set executable ${testfile} -set binfile ${objdir}/${subdir}/${executable} if [prepare_for_testing ${testfile}.exp $executable "${srcfile} ${mainfile}" {}] { return -1 diff --git a/gdb/testsuite/gdb.dwarf2/implptr.exp b/gdb/testsuite/gdb.dwarf2/implptr.exp index 55181e44c37..a510516e4ea 100644 --- a/gdb/testsuite/gdb.dwarf2/implptr.exp +++ b/gdb/testsuite/gdb.dwarf2/implptr.exp @@ -21,10 +21,8 @@ if {![dwarf2_support]} { return 0 } -set testfile "implptr" -set srcfile ${testfile}.S +standard_testfile .S set csrcfile ${testfile}.c -set binfile ${objdir}/${subdir}/${testfile}.x set opts {} if [info exists COMPILE] { @@ -36,7 +34,7 @@ if [info exists COMPILE] { return 0 } -if {[prepare_for_testing ${testfile}.exp ${testfile}.x $srcfile $opts]} { +if {[prepare_for_testing ${testfile}.exp ${testfile} $srcfile $opts]} { return -1 } diff --git a/gdb/testsuite/gdb.dwarf2/mac-fileno.exp b/gdb/testsuite/gdb.dwarf2/mac-fileno.exp index 5fc5975fbfb..b329081784b 100644 --- a/gdb/testsuite/gdb.dwarf2/mac-fileno.exp +++ b/gdb/testsuite/gdb.dwarf2/mac-fileno.exp @@ -22,10 +22,8 @@ if {![dwarf2_support]} { return 0 } -set testfile "mac-fileno" +standard_testfile .S set dwarf_srcfile "file1.txt" -set srcfile ${testfile}.S -set binfile ${objdir}/${subdir}/${testfile}.x if { [gdb_compile "${srcdir}/${subdir}/main.c" "main.o" object {debug}] != "" } { return -1 diff --git a/gdb/testsuite/gdb.dwarf2/member-ptr-forwardref.exp b/gdb/testsuite/gdb.dwarf2/member-ptr-forwardref.exp index 3af2082d4f7..5b8b5edfc61 100644 --- a/gdb/testsuite/gdb.dwarf2/member-ptr-forwardref.exp +++ b/gdb/testsuite/gdb.dwarf2/member-ptr-forwardref.exp @@ -21,11 +21,9 @@ if {![dwarf2_support]} { if { [skip_cplus_tests] } { continue } -set testfile member-ptr-forwardref -set executable ${testfile} -set binfile ${objdir}/${subdir}/${executable}.x +standard_testfile .S -if { [gdb_compile "${srcdir}/${subdir}/${testfile}.S" ${binfile} object {debug}] != "" } { +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" ${binfile} object {debug}] != "" } { untested ${testfile}.exp return -1 } diff --git a/gdb/testsuite/gdb.dwarf2/pieces.exp b/gdb/testsuite/gdb.dwarf2/pieces.exp index 58331c14bbf..eb3b5dccb2c 100644 --- a/gdb/testsuite/gdb.dwarf2/pieces.exp +++ b/gdb/testsuite/gdb.dwarf2/pieces.exp @@ -24,12 +24,10 @@ if {![is_x86_like_target]} { return 0 } -set testfile "pieces" -set srcfile ${testfile}.S +standard_testfile .S set csrcfile ${testfile}.c -set binfile ${objdir}/${subdir}/${testfile}.x -if {[prepare_for_testing ${testfile}.exp ${testfile}.x $srcfile]} { +if {[prepare_for_testing ${testfile}.exp ${testfile} $srcfile]} { return -1 } diff --git a/gdb/testsuite/gdb.dwarf2/pr10770.exp b/gdb/testsuite/gdb.dwarf2/pr10770.exp index a381227b770..4c60b163f80 100644 --- a/gdb/testsuite/gdb.dwarf2/pr10770.exp +++ b/gdb/testsuite/gdb.dwarf2/pr10770.exp @@ -15,8 +15,7 @@ # Test DW_OP_call_frame_cfa. -set testfile "pr10770" -set srcfile ${testfile}.c +standard_testfile if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}]} { return 0 diff --git a/gdb/testsuite/gdb.dwarf2/pr11465.exp b/gdb/testsuite/gdb.dwarf2/pr11465.exp index d6513f59188..22c50076398 100644 --- a/gdb/testsuite/gdb.dwarf2/pr11465.exp +++ b/gdb/testsuite/gdb.dwarf2/pr11465.exp @@ -19,10 +19,7 @@ if {![dwarf2_support]} { return 0 } -set testfile "pr11465" -set srcfile "$testfile.S" -set executable "$testfile.x" -set binfile [file join $objdir $subdir $executable] +standard_testfile .S if [is_ilp32_target] { set ptrbits 32 @@ -35,7 +32,7 @@ if { [gdb_compile [file join $srcdir $subdir $srcfile] \ return -1 } -clean_restart $executable +clean_restart $testfile # Test delayed physname computations gdb_test "p N::c.C" { = {void \(N::C \* const, void \(\*\)\(N::C\)\)}.*} diff --git a/gdb/testsuite/gdb.dwarf2/pr13961.exp b/gdb/testsuite/gdb.dwarf2/pr13961.exp index c70f2b26e38..1dc6f0a0a76 100644 --- a/gdb/testsuite/gdb.dwarf2/pr13961.exp +++ b/gdb/testsuite/gdb.dwarf2/pr13961.exp @@ -22,11 +22,9 @@ if {![dwarf2_support]} { return 0 } -set testfile "pr13961" -set srcfile ${testfile}.S -set binfile ${testfile}.x +standard_testfile .S -if { [prepare_for_testing ${testfile}.exp ${binfile} ${srcfile}] == -1 } { +if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] == -1 } { return -1 } diff --git a/gdb/testsuite/gdb.dwarf2/valop.exp b/gdb/testsuite/gdb.dwarf2/valop.exp index 5ce7b64503e..9cd99f0cdc4 100644 --- a/gdb/testsuite/gdb.dwarf2/valop.exp +++ b/gdb/testsuite/gdb.dwarf2/valop.exp @@ -25,20 +25,13 @@ if {![is_x86_like_target]} { return 0 } -set testfile "valop" -set srcfile ${testfile}.S -set binfile ${objdir}/${subdir}/${testfile}.x +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_main] { return -1 } -- 2.30.2