Exploit 'prepare_for_testing' etc. for 'Dwarf::assemble'-generated files
authorAndreas Arnez <arnez@linux.vnet.ibm.com>
Fri, 7 Mar 2014 11:45:49 +0000 (11:45 +0000)
committerAndreas Krebbel <krebbel@linux.vnet.ibm.com>
Wed, 12 Mar 2014 15:22:18 +0000 (16:22 +0100)
Now that prepare_for_testing etc. can cope with absolute path names,
this can be exploited for test cases with generated source files.
This is just to simplify the code and shouldn't cause any functional
change.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.dwarf2/arr-stride.exp
gdb/testsuite/gdb.dwarf2/arr-subrange.exp
gdb/testsuite/gdb.dwarf2/dwz.exp
gdb/testsuite/gdb.dwarf2/implptrconst.exp
gdb/testsuite/gdb.dwarf2/implptrpiece.exp
gdb/testsuite/gdb.dwarf2/method-ptr.exp
gdb/testsuite/gdb.dwarf2/missing-sig-type.exp
gdb/testsuite/gdb.dwarf2/nostaticblock.exp
gdb/testsuite/gdb.dwarf2/subrange.exp

index 47b586bf0c63f46f9c4cfe4f1b573759a3bb834c..70b75124909e5354274202716d1d8a1fac7e4868 100644 (file)
@@ -1,3 +1,15 @@
+2014-03-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
+
+       * gdb.dwarf2/arr-stride.exp: Exploit 'prepare_for_testing'.
+       * gdb.dwarf2/arr-subrange.exp: Likewise.
+       * gdb.dwarf2/dwz.exp: Likewise.
+       * gdb.dwarf2/method-ptr.exp: Likewise.
+       * gdb.dwarf2/missing-sig-type.exp: Likewise.
+       * gdb.dwarf2/subrange.exp: Likewise.
+       * gdb.dwarf2/implptrconst.exp: Exploit 'build_executable'.
+       * gdb.dwarf2/implptrpiece.exp: Likewise.
+       * gdb.dwarf2/nostaticblock.exp: Likewise.
+
 2014-03-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
 
        * lib/gdb.exp (build_executable_from_specs): Don't prepend source
index f2a1f39d82bbdee4c18334a69f1ba71586db75de..c9186227a44e0a90b804fd24f00182a02e8b7b4e 100644 (file)
@@ -83,22 +83,11 @@ Dwarf::assemble $asm_file {
     }
 }
 
-if  {[gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile}1.o \
-         object {nodebug}] != ""} {
+if { [prepare_for_testing ${testfile}.exp ${testfile} \
+         [list $srcfile $asm_file] {nodebug}] } {
     return -1
 }
 
-if  {[gdb_compile $asm_file ${binfile}2.o object {nodebug}] != ""} {
-    return -1
-}
-
-if  {[gdb_compile [list ${binfile}1.o ${binfile}2.o] \
-         "${binfile}" executable {}] != ""} {
-    return -1
-}
-
-clean_restart ${testfile}
-
 gdb_test_no_output "set language ada"
 
 gdb_test "ptype pck.table" \
index 9847c13c3834bf00b96f95175f50bf1866f48aff..d01b789cd189b56aca19f1d34a38007e1557d562 100644 (file)
@@ -77,22 +77,11 @@ Dwarf::assemble $asm_file {
     }
 }
 
-if  {[gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile}1.o \
-         object {nodebug}] != ""} {
+if { [prepare_for_testing ${testfile}.exp ${testfile} \
+         [list $srcfile $asm_file] {nodebug}] } {
     return -1
 }
 
-if  {[gdb_compile $asm_file ${binfile}2.o object {nodebug}] != ""} {
-    return -1
-}
-
-if  {[gdb_compile [list ${binfile}1.o ${binfile}2.o] \
-         "${binfile}" executable {}] != ""} {
-    return -1
-}
-
-clean_restart ${testfile}
-
 gdb_test_no_output "set language ada"
 
 gdb_test "ptype pck.table" \
index 87b68153608598ae289468e906157fab498763ee..7f996b3440932128ea4bf3a2e9123fe707476375 100644 (file)
@@ -82,22 +82,11 @@ Dwarf::assemble $asm_file {
     }
 }
 
-if  { [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile}1.o \
-          object {nodebug}] != "" } {
+if { [prepare_for_testing ${testfile}.exp ${testfile} \
+         [list $srcfile $asm_file] {nodebug}] } {
     return -1
 }
 
-if  { [gdb_compile $asm_file ${binfile}2.o object {nodebug}] != "" } {
-    return -1
-}
-
-if  { [gdb_compile [list ${binfile}1.o ${binfile}2.o] \
-          "${binfile}" executable {}] != "" } {
-    return -1
-}
-
-clean_restart ${testfile}
-
 if ![runto_main] {
     return -1
 }
index 924d4c9ea9698489324d941a2f1e0ef16346d5c2..46c26082f103b3f9c3f8922eaf15ee46ca190fd1 100644 (file)
@@ -85,17 +85,8 @@ Dwarf::assemble $asm_file {
     }
 }
 
-if  {[gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile}1.o \
-         object {nodebug}] != ""} {
-    return -1
-}
-
-if  {[gdb_compile $asm_file ${binfile}2.o object {nodebug}] != ""} {
-    return -1
-}
-
-if  {[gdb_compile [list ${binfile}1.o ${binfile}2.o] \
-         "${binfile}" executable {}] != ""} {
+if { [build_executable ${testfile}.exp ${testfile} \
+         [list $srcfile $asm_file] {nodebug}] } {
     return -1
 }
 
index 06d231f1421d999d14b3ec5e6f3fc29bf8ad3403..60a3d9f72c65b19ccd983e8d6ad4fa57fab3da3d 100644 (file)
@@ -103,17 +103,8 @@ Dwarf::assemble $asm_file {
     }
 }
 
-if  {[gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile}1.o \
-         object {nodebug}] != ""} {
-    return -1
-}
-
-if  {[gdb_compile $asm_file ${binfile}2.o object {nodebug}] != ""} {
-    return -1
-}
-
-if  {[gdb_compile [list ${binfile}1.o ${binfile}2.o] \
-         "${binfile}" executable {}] != ""} {
+if { [build_executable ${testfile}.exp ${testfile} \
+         [list $srcfile $asm_file] {nodebug}] } {
     return -1
 }
 
index 53a3f737abd8c7fd47f642b5793c897b76ce1dac..7ab8cbd17aa0efff5a53c1b392c7056484f1da33 100644 (file)
@@ -77,21 +77,10 @@ Dwarf::assemble $asm_file {
     }
 }
 
-if  {[gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile}1.o \
-         object {nodebug}] != ""} {
+if { [prepare_for_testing ${testfile}.exp ${testfile} \
+         [list $srcfile $asm_file] {nodebug}] } {
     return -1
 }
 
-if  {[gdb_compile $asm_file ${binfile}2.o object {nodebug}] != ""} {
-    return -1
-}
-
-if  {[gdb_compile [list ${binfile}1.o ${binfile}2.o] \
-         "${binfile}" executable {c++}] != ""} {
-    return -1
-}
-
-clean_restart ${testfile}
-
 gdb_test "ptype the_typedef" \
     "type = int \\(S::\\*\\)\\(S \\* const, float\\)"
index 8ccfa43ccb1017af7ff0c602a9003e36b2d8c5c1..9012604a7d8ef68bb865e097982357b1638ed5cf 100644 (file)
@@ -49,20 +49,9 @@ Dwarf::assemble $asm_file {
     }
 }
 
-if  {[gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile}1.o \
-         object {nodebug}] != ""} {
+if { [prepare_for_testing ${testfile}.exp ${testfile} \
+         [list $srcfile $asm_file] {nodebug}] } {
     return -1
 }
 
-if  {[gdb_compile $asm_file ${binfile}2.o object {nodebug}] != ""} {
-    return -1
-}
-
-if  {[gdb_compile [list ${binfile}1.o ${binfile}2.o] \
-         "${binfile}" executable {c++}] != ""} {
-    return -1
-}
-
-clean_restart ${testfile}
-
 gdb_test "ptype foo" "type = <unknown type .*>"
index 9685cc13690c351ad3c2991ed1ad106fa05adf3e..bd4345e941636aaed89620c44c27a23e34c20bdf 100644 (file)
@@ -35,22 +35,11 @@ Dwarf::assemble $asm_file {
     }
 }
 
-if  {[gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile}1.o \
-         object {nodebug}] != ""} {
+if { [build_executable ${testfile}.exp ${testfile} \
+         [list $srcfile $asm_file] {nodebug}] } {
     return -1
 }
 
-if  {[gdb_compile $asm_file ${binfile}2.o object {nodebug}] != ""} {
-    return -1
-}
-
-if  {[gdb_compile [list ${binfile}1.o ${binfile}2.o] \
-         "${binfile}" executable {c++}] != ""} {
-    return -1
-}
-
-clean_restart ${testfile}
-
 set saved_gdbflags $GDBFLAGS
 set GDBFLAGS "$GDBFLAGS --readnow"
 clean_restart $testfile
index 956a7e9e6cc5ed0aab29907d0c08bf604cabe60a..21f1c3ae1daf4e4895b61d3e07430d3a0025d220 100644 (file)
@@ -60,22 +60,11 @@ Dwarf::assemble $asm_file {
     }
 }
 
-if  {[gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile}1.o \
-         object {nodebug}] != ""} {
+if { [prepare_for_testing ${testfile}.exp ${testfile} \
+         [list $srcfile $asm_file] {nodebug}] } {
     return -1
 }
 
-if  {[gdb_compile $asm_file ${binfile}2.o object {nodebug}] != ""} {
-    return -1
-}
-
-if  {[gdb_compile [list ${binfile}1.o ${binfile}2.o] \
-         "${binfile}" executable {c++}] != ""} {
-    return -1
-}
-
-clean_restart ${testfile}
-
 gdb_test_no_output "set language pascal"
 
 gdb_test "ptype TByteArray" \