This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
FYI: clean up gdb.opt
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Mon, 25 Jun 2012 14:24:41 -0600
- Subject: FYI: clean up gdb.opt
I'm checking this in.
This cleans up gdb.opt to use standard_testfile and also
prepare_for_testing.
Regtested on x86-64 Fedora 16.
Tom
2012-06-25 Tom Tromey <tromey@redhat.com>
* gdb.opt/clobbered-registers-O2.exp: Use standard_testfile,
prepare_for_testing.
* gdb.opt/inline-break.exp: Use standard_testfile,
prepare_for_testing.
* gdb.opt/inline-bt.exp: Use standard_testfile,
prepare_for_testing.
* gdb.opt/inline-cmds.exp: Use standard_testfile,
prepare_for_testing.
* gdb.opt/inline-locals.exp: Use standard_testfile,
prepare_for_testing.
Index: gdb.opt/clobbered-registers-O2.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.opt/clobbered-registers-O2.exp,v
retrieving revision 1.10
diff -u -r1.10 clobbered-registers-O2.exp
--- gdb.opt/clobbered-registers-O2.exp 21 Jun 2012 20:46:24 -0000 1.10
+++ gdb.opt/clobbered-registers-O2.exp 25 Jun 2012 20:23:47 -0000
@@ -18,9 +18,7 @@
# Test displaying call clobbered registers in optimized binaries.
# GDB should not show incorrect values.
-set testfile clobbered-registers-O2
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
# What compiler are we using?
#
@@ -28,19 +26,11 @@
return -1
}
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [concat debug optimize=-O2 nowarnings]] != "" } {
- untested clobbered-registers-O2.exp
- return -1
+if {[prepare_for_testing $testfile.exp $testfile $srcfile \
+ {debug optimize=-O2 nowarnings}]} {
+ return -1
}
-# use this to debug:
-#log_user 1
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
if { ![runto start_sequence] } then {
fail "run to start_sequence"
return
Index: gdb.opt/inline-break.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.opt/inline-break.exp,v
retrieving revision 1.1
diff -u -r1.1 inline-break.exp
--- gdb.opt/inline-break.exp 16 Mar 2012 16:47:34 -0000 1.1
+++ gdb.opt/inline-break.exp 25 Jun 2012 20:23:47 -0000
@@ -17,10 +17,9 @@
# mirrors this testcase, and should be updated if this testcase is
# changed.
-set basename "inline-break"
-set testfile $basename
+standard_testfile
-if { [prepare_for_testing $testfile.exp $testfile $testfile.c \
+if { [prepare_for_testing $testfile.exp $testfile $srcfile \
{debug optimize=-O2 additional_flags=-Winline}] } {
return -1
}
@@ -30,7 +29,7 @@
# The result should be a single-location breakpoint.
#
gdb_test "break func1" \
- "Breakpoint.*at.* file .*$basename\\.c, line.*"
+ "Breakpoint.*at.* file .*$srcfile, line.*"
#
# func2 is a non-static inlined function that is called once.
@@ -46,7 +45,7 @@
# a single-location breakpoint.
#
gdb_test "break func3b" \
- "Breakpoint.*at.* file .*$basename\\.c, line.*"
+ "Breakpoint.*at.* file .*$srcfile, line.*"
#
# func4b is a static inlined function that is called once from
Index: gdb.opt/inline-bt.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.opt/inline-bt.exp,v
retrieving revision 1.6
diff -u -r1.6 inline-bt.exp
--- gdb.opt/inline-bt.exp 21 Jun 2012 20:46:24 -0000 1.6
+++ gdb.opt/inline-bt.exp 25 Jun 2012 20:23:47 -0000
@@ -13,25 +13,14 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-set testfile "inline-bt"
-set srcfile ${testfile}.c
-set srcfile2 "inline-markers.c"
-set fullsrcfile "${srcdir}/${subdir}/${srcfile}"
-set fullsrcfile2 "${srcdir}/${subdir}/${srcfile2}"
-set sources [list ${fullsrcfile} ${fullsrcfile2}]
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c inline-markers.c
-if { [gdb_compile ${sources} ${binfile} \
- executable {debug optimize=-O2 additional_flags=-Winline}] != "" } {
- untested inline-bt.exp
+if {[prepare_for_testing $testfile.exp $testfile \
+ [list $srcfile $srcfile2] \
+ {debug optimize=-O2 additional_flags=-Winline}]} {
return -1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
runto_main
get_compiler_info
Index: gdb.opt/inline-cmds.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.opt/inline-cmds.exp,v
retrieving revision 1.7
diff -u -r1.7 inline-cmds.exp
--- gdb.opt/inline-cmds.exp 21 Jun 2012 20:46:24 -0000 1.7
+++ gdb.opt/inline-cmds.exp 25 Jun 2012 20:23:47 -0000
@@ -13,25 +13,13 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-set testfile "inline-cmds"
-set srcfile "${testfile}.c"
-set srcfile2 "inline-markers.c"
-set fullsrcfile "${srcdir}/${subdir}/${srcfile}"
-set fullsrcfile2 "${srcdir}/${subdir}/${srcfile2}"
-set sources [list ${fullsrcfile} ${fullsrcfile2}]
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c inline-markers.c
-if { [gdb_compile $sources ${binfile} \
- executable {debug optimize=-O2}] != "" } {
- untested inline-cmds.exp
+if {[prepare_for_testing $testfile.exp $testfile \
+ [list $srcfile $srcfile2] {debug optimize=-O2}]} {
return -1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
gdb_test_no_output "set listsize 1"
runto_main
Index: gdb.opt/inline-locals.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.opt/inline-locals.exp,v
retrieving revision 1.7
diff -u -r1.7 inline-locals.exp
--- gdb.opt/inline-locals.exp 21 Jun 2012 20:46:24 -0000 1.7
+++ gdb.opt/inline-locals.exp 25 Jun 2012 20:23:47 -0000
@@ -13,25 +13,13 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-set testfile "inline-locals"
-set srcfile ${testfile}.c
-set srcfile2 "inline-markers.c"
-set fullsrcfile "${srcdir}/${subdir}/${srcfile}"
-set fullsrcfile2 "${srcdir}/${subdir}/${srcfile2}"
-set sources [list ${fullsrcfile} ${fullsrcfile2}]
-set binfile ${objdir}/${subdir}/${testfile}
-
-if { [gdb_compile ${sources} ${binfile} \
- executable {debug optimize=-O2}] != "" } {
- untested inline-locals.exp
+standard_testfile .c inline-markers.c
+
+if {[prepare_for_testing $testfile.exp $testfile \
+ [list $srcfile $srcfile2] {debug optimize=-O2}]} {
return -1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
runto_main
get_compiler_info