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.
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 $" {
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"
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"
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"
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"
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"
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.
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"
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
}
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"
}
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"
}
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
}
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\\\]"
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"