aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-07-12 15:15:07 +0000
committerTom Tromey <tromey@redhat.com>2012-07-12 15:15:07 +0000
commit76027ef599f664d2c45574304d304abc962145c2 (patch)
treed5af4479ebec0ee9e6f3fe27b59433b5c3f191d1 /gdb
parent85b4440aee65df8d448a532fe925999228004afc (diff)
downloadgdb-76027ef599f664d2c45574304d304abc962145c2.zip
gdb-76027ef599f664d2c45574304d304abc962145c2.tar.gz
gdb-76027ef599f664d2c45574304d304abc962145c2.tar.bz2
* 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.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/ChangeLog20
-rw-r--r--gdb/testsuite/gdb.dwarf2/dup-psym.exp16
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-anonymous-func.exp16
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-basic.exp16
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-compressed.exp18
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-const.exp13
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-cu-size.exp16
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-intercu.exp16
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-intermix.exp16
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.exp11
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-producer.exp16
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp12
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-restore.exp9
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-strp.exp16
-rw-r--r--gdb/testsuite/gdb.dwarf2/mac-fileno.exp16
15 files changed, 54 insertions, 173 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index c763b86..ed94431 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,25 @@
2012-07-12 Tom Tromey <tromey@redhat.com>
+ * 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 <tromey@redhat.com>
+
* lib/gdb.exp (build_executable_from_specs): New proc, from
build_executable.
(build_executable): Use it.
diff --git a/gdb/testsuite/gdb.dwarf2/dup-psym.exp b/gdb/testsuite/gdb.dwarf2/dup-psym.exp
index d4fa160..9ecd5e9 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 ada66b0..82fbb2a 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 90b112b..fa11ebe 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 7cc276c..cfb4f33 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 087fca9..9482057 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 7ac0df7..10dd3ec 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 2eaac65..dd836c5 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 0f76545..2ea96bc 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 9eae088..7857449 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 0961081..29a62c8 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 75c1eb4..74fb698 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 99d8191..081655a 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 b98833e..d2820ae 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 b329081..6e8bd9e 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"