This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH/RFA] cleanup 'srcfile' var usage


Thank you for doing this Elena.

Fernando

Elena Zannoni wrote:> This is the first wave of cleanups.
I'll commit tomorrow.

Elena

2003-01-16 Elena Zannoni <ezannoni@redhat.com>

* gdb.arch/altivec-abi.exp: Set variable 'srcfile' differently, to
allow for different test tree configurations. Update some
tescases accordingly.
* gdb.arch/altivec-regs.exp: Ditto.
* gdb.asm/asm-source.exp: Ditto.
* gdb.base/step-test.exp: Ditto.
* gdb.base/step-line.exp: Ditto.
* gdb.base/setshow.exp: Ditto.
* gdb.base/relocate.exp: Ditto.
* gdb.base/overlays.exp: Ditto.
* gdb.base/mips_pro.exp: Ditto.
* gdb.base/long_long.exp: Ditto. * gdb.base/display.exp: Ditto.
* gdb.base/until.exp: Ditto.
* gdb.base/advance.exp: Ditto.
* gdb.c++/virtfunc.exp: Get rid of variable 'src'.


Index: altivec-abi.exp
===================================================================
RCS file: /cvs/uberbaum/gdb/testsuite/gdb.arch/altivec-abi.exp,v
retrieving revision 1.2
diff -u -p -r1.2 altivec-abi.exp
--- altivec-abi.exp 23 Aug 2002 01:52:22 -0000 1.2
+++ altivec-abi.exp 16 Jan 2003 21:15:00 -0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -39,10 +39,9 @@ if ![istarget "powerpc-*altivec"] then {
set testfile "altivec-abi"
set binfile ${objdir}/${subdir}/${testfile}
+set srcfile ${testfile}.c
-set src1 ${srcdir}/${subdir}/${testfile}.c
-
-if { [gdb_compile ${src1} ${binfile} executable {debug additional_flags=-w}] != "" } {
+if { [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile} executable {debug additional_flags=-w}] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." }
Index: altivec-regs.exp
===================================================================
RCS file: /cvs/uberbaum/gdb/testsuite/gdb.arch/altivec-regs.exp,v
retrieving revision 1.1
diff -u -p -r1.1 altivec-regs.exp
--- altivec-regs.exp 14 May 2002 22:02:52 -0000 1.1
+++ altivec-regs.exp 16 Jan 2003 21:15:00 -0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
# # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -39,9 +39,9 @@ if ![istarget "powerpc-*altivec"] then {
set testfile "altivec-regs"
set binfile ${objdir}/${subdir}/${testfile}
-set src1 ${srcdir}/${subdir}/${testfile}.c
+set srcfile ${testfile}.c
-if { [gdb_compile ${src1} ${binfile} executable {debug additional_flags=-w}] != "" } {
+if { [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile} executable {debug additional_flags=-w}] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." }

Index: asm-source.exp
===================================================================
RCS file: /cvs/uberbaum/gdb/testsuite/gdb.asm/asm-source.exp,v
retrieving revision 1.27
diff -u -p -r1.27 asm-source.exp
--- asm-source.exp 8 Nov 2002 03:21:33 -0000 1.27
+++ asm-source.exp 16 Jan 2003 21:49:47 -0000
@@ -1,4 +1,4 @@
-# Copyright 1998, 2000, 2002 Free Software Foundation, Inc.
+# Copyright 1998, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
# # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -99,8 +99,8 @@ if [board_info $dest exists multilib_fla
set testfile "asm-source"
set binfile ${objdir}/${subdir}/${testfile}
-set src1 ${srcdir}/${subdir}/asmsrc1.s
-set src2 ${srcdir}/${subdir}/asmsrc2.s
+set srcfile1 asmsrc1.s
+set srcfile2 asmsrc2.s
remote_exec build "rm -f ${subdir}/arch.inc"
remote_download host ${srcdir}/${subdir}/${asm-arch}.inc ${subdir}/arch.inc
@@ -110,10 +110,10 @@ if { "${asm-flags}" == "" } {
set asm-flags "-gstabs -I${srcdir}/${subdir} -I${objdir}/${subdir}"
}
-if {[target_assemble ${src1} asmsrc1.o "${asm-flags}"] != ""} then {
+if {[target_assemble ${srcdir}/${subdir}/${srcfile1} asmsrc1.o "${asm-flags}"] != ""} then {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
-if {[target_assemble ${src2} asmsrc2.o "${asm-flags}"] != ""} then {
+if {[target_assemble ${srcdir}/${subdir}/${srcfile2} asmsrc2.o "${asm-flags}"] != ""} then {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
Index: advance.exp
===================================================================
RCS file: /cvs/uberbaum/gdb/testsuite/gdb.base/advance.exp,v
retrieving revision 1.1
diff -u -p -r1.1 advance.exp
--- advance.exp 15 Jan 2003 14:25:11 -0000 1.1
+++ advance.exp 16 Jan 2003 21:26:18 -0000
@@ -24,11 +24,11 @@ if $tracelevel then {
}
set testfile advance
-set srcfile ${srcdir}/${subdir}/${testfile}.c
+set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
remote_exec build "rm -f ${binfile}"
-if { [gdb_compile "${srcfile}" "${binfile}" executable {debug}] != "" } {
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
Index: display.exp
===================================================================
RCS file: /cvs/uberbaum/gdb/testsuite/gdb.base/display.exp,v
retrieving revision 1.5
diff -u -p -r1.5 display.exp
--- display.exp 17 Sep 2001 20:41:22 -0000 1.5
+++ display.exp 16 Jan 2003 21:26:18 -0000
@@ -1,4 +1,4 @@
-# Copyright 1997, 1998, 1999, 2000
+# Copyright 1997, 1998, 1999, 2000, 2001, 2003
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
@@ -26,12 +26,12 @@ if $tracelevel then {
}
set testfile display
-set srcfile ${srcdir}/${subdir}/${testfile}.c
+set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
-if { [gdb_compile "${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
if [target_info exists gdb_stub] {

Index: long_long.exp
===================================================================
RCS file: /cvs/uberbaum/gdb/testsuite/gdb.base/long_long.exp,v
retrieving revision 1.12
diff -u -p -r1.12 long_long.exp
--- long_long.exp 6 Jun 2002 19:08:18 -0000 1.12
+++ long_long.exp 16 Jan 2003 21:26:19 -0000
@@ -1,4 +1,5 @@
-# Copyright 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -30,7 +31,7 @@ if [target_info exists no_long_long] {
}
set testfile long_long
-set srcfile ${srcdir}/${subdir}/${testfile}.c
+set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
# What compiler are we using?
@@ -45,7 +46,7 @@ if {$hp_cc_compiler} {
set flag ""
}
-if { [gdb_compile "${srcfile}" "${binfile}" executable [concat debug "additional_flags=$flag -w"]] != "" } {
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [concat debug "additional_flags=$flag -w"]] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
Index: mips_pro.exp
===================================================================
RCS file: /cvs/uberbaum/gdb/testsuite/gdb.base/mips_pro.exp,v
retrieving revision 1.3
diff -u -p -r1.3 mips_pro.exp
--- mips_pro.exp 6 Mar 2001 08:21:50 -0000 1.3
+++ mips_pro.exp 16 Jan 2003 21:26:19 -0000
@@ -1,4 +1,4 @@
-# Copyright 1997, 1999 Free Software Foundation, Inc.
+# Copyright 1997, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@ set prms_id 0
set bug_id 0
set testfile mips_pro
-set srcfile ${srcdir}/$subdir/${testfile}.c
+set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
# Create and source the file that provides information about the compiler
@@ -38,11 +38,11 @@ if [get_compiler_info ${binfile}] {
# This test must be compiled with -O2 if using gcc.
if {$gcc_compiled} then {
- if { [gdb_compile "${srcfile}" "${binfile}" executable {debug additional_flags=-O2}] != "" } {
+ if { [gdb_compile "${srcdir}/$subdir/${srcfile}" "${binfile}" executable {debug additional_flags=-O2}] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
} else {
- if { [gdb_compile "${srcfile}" "${binfile}" executable {debug}] != "" } {
+ if { [gdb_compile "${srcdir}/$subdir/${srcfile}" "${binfile}" executable {debug}] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
}
Index: overlays.exp
===================================================================
RCS file: /cvs/uberbaum/gdb/testsuite/gdb.base/overlays.exp,v
retrieving revision 1.4
diff -u -p -r1.4 overlays.exp
--- overlays.exp 6 Jun 2002 20:26:10 -0000 1.4
+++ overlays.exp 16 Jan 2003 21:26:19 -0000
@@ -1,4 +1,4 @@
-# Copyright 1997, 1998, 2002 Free Software Foundation, Inc.
+# Copyright 1997, 1998, 2001, 2002, 2003 Free Software Foundation, Inc.
# # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -41,29 +41,25 @@ if [istarget "d10v-*-*"] then {
set testfile "overlays"
set binfile ${objdir}/${subdir}/${testfile}
-set srcfile ${srcdir}/${subdir}/${testfile}.c
-set foo ${srcdir}/${subdir}/foo.c
-set bar ${srcdir}/${subdir}/bar.c
-set baz ${srcdir}/${subdir}/baz.c
-set grbx ${srcdir}/${subdir}/grbx.c
+set srcfile ${testfile}.c
-if {[gdb_compile "${srcfile}" "${testfile}.o" object {debug}] != ""} then {
+if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${testfile}.o" object {debug}] != ""} then {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
if {[gdb_compile "${srcdir}/${subdir}/ovlymgr.c" ovlymgr.o object {debug}] != ""} then {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
-if {[gdb_compile "${foo}" foo.o object {debug} ] != ""} then {
+if {[gdb_compile "${srcdir}/${subdir}/foo.c" foo.o object {debug} ] != ""} then {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
-if {[gdb_compile "${bar}" bar.o object {debug}] != ""} then {
+if {[gdb_compile "${srcdir}/${subdir}/bar.c" bar.o object {debug}] != ""} then {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
-if {[gdb_compile "${baz}" baz.o object {debug}] != ""} then {
+if {[gdb_compile "${srcdir}/${subdir}/baz.c" baz.o object {debug}] != ""} then {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
-if {[gdb_compile "${grbx}" grbx.o object {debug}] != ""} then {
+if {[gdb_compile "${srcdir}/${subdir}/grbx.c" grbx.o object {debug}] != ""} then {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
if {[gdb_compile "${testfile}.o ovlymgr.o foo.o bar.o baz.o grbx.o" ${binfile} executable "ldscript=-Wl,-T$linker_script"] != "" } {

Index: relocate.exp
===================================================================
RCS file: /cvs/uberbaum/gdb/testsuite/gdb.base/relocate.exp,v
retrieving revision 1.1
diff -u -p -r1.1 relocate.exp
--- relocate.exp 5 Apr 2002 02:45:48 -0000 1.1
+++ relocate.exp 16 Jan 2003 21:26:20 -0000
@@ -1,4 +1,4 @@
-# Copyright 2002 Free Software Foundation, Inc.
+# Copyright 2002, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -25,11 +25,11 @@ if $tracelevel then {
}
set testfile relocate
-set srcfile ${srcdir}/${subdir}/${testfile}.c
+set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}.o
remote_exec build "rm -f ${binfile}"
-if { [gdb_compile "${srcfile}" "${binfile}" object {debug}] != "" } {
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {debug}] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
Index: setshow.exp
===================================================================
RCS file: /cvs/uberbaum/gdb/testsuite/gdb.base/setshow.exp,v
retrieving revision 1.2
diff -u -p -r1.2 setshow.exp
--- setshow.exp 6 Mar 2001 08:21:51 -0000 1.2
+++ setshow.exp 16 Jan 2003 21:26:20 -0000
@@ -1,4 +1,5 @@
-# Copyright 1992, 1994, 1996, 1997, 1998 Free Software Foundation, Inc.
+# Copyright 1992, 1994, 1996, 1997, 1998, 2001, 2003
+# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -27,9 +28,9 @@ set prms_id 0
set bug_id 0
set testfile "setshow"
-set srcfile ${srcdir}/${subdir}/${testfile}.c
+set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
-if { [gdb_compile ${srcfile} ${binfile} executable {debug}] != "" } {
+if { [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile} executable {debug}] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}


Index: step-line.exp
===================================================================
RCS file: /cvs/uberbaum/gdb/testsuite/gdb.base/step-line.exp,v
retrieving revision 1.3
diff -u -p -r1.3 step-line.exp
--- step-line.exp 22 Nov 2002 19:07:28 -0000 1.3
+++ step-line.exp 16 Jan 2003 21:28:35 -0000
@@ -1,4 +1,4 @@
-# Copyright 2001 Free Software Foundation, Inc.
+# Copyright 2001, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -28,11 +28,11 @@ if $tracelevel then {
}
set testfile step-line
-set srcfile ${srcdir}/${subdir}/${testfile}.c
+set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
remote_exec build "rm -f ${binfile}"
-if { [gdb_compile "${srcfile}" "${binfile}" executable {debug}] != "" } {
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}

Index: step-test.exp
===================================================================
RCS file: /cvs/uberbaum/gdb/testsuite/gdb.base/step-test.exp,v
retrieving revision 1.6
diff -u -p -r1.6 step-test.exp
--- step-test.exp 4 Dec 2002 03:07:45 -0000 1.6
+++ step-test.exp 16 Jan 2003 21:30:06 -0000
@@ -1,4 +1,5 @@
-# Copyright 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
+# Copyright 1997, 1998, 1999, 2000, 2002, 2001, 2003
+# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -28,11 +29,11 @@ if $tracelevel then {
}
set testfile step-test
-set srcfile ${srcdir}/${subdir}/${testfile}.c
+set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
remote_exec build "rm -f ${binfile}"
-if { [gdb_compile "${srcfile}" "${binfile}" executable {debug}] != "" } {
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
Index: until.exp
===================================================================
RCS file: /cvs/uberbaum/gdb/testsuite/gdb.base/until.exp,v
retrieving revision 1.1
diff -u -p -r1.1 until.exp
--- until.exp 15 Jan 2003 14:25:10 -0000 1.1
+++ until.exp 16 Jan 2003 21:30:31 -0000
@@ -24,11 +24,11 @@ if $tracelevel then {
}
set testfile break
-set srcfile ${srcdir}/${subdir}/${testfile}.c
+set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
remote_exec build "rm -f ${binfile}"
-if { [gdb_compile "${srcfile}" "${binfile}" executable {debug}] != "" } {
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
@@ -63,7 +63,7 @@ delete_breakpoints
# frame.
#
gdb_test "until 99" \
- "factorial.*value=720.*at ${srcfile}:99.*return \\(value\\)." \
+ "factorial.*value=720.*at.*${srcfile}:99.*return \\(value\\)." \
"until factorial, recursive function"
# Run to a function called by main
@@ -76,6 +76,6 @@ delete_breakpoints
# stop at main, the caller, where we put the 'guard' breakpoint.
#
gdb_test "until marker3" \
- "$hex in main.*argc.*argv.*envp.*at ${srcfile}:82.*marker2 \\(43\\)." \
+ "$hex in main.*argc.*argv.*envp.*at.*${srcfile}:82.*marker2 \\(43\\)." \
"until func, not called by current frame"
Index: virtfunc.exp
===================================================================
RCS file: /cvs/uberbaum/gdb/testsuite/gdb.c++/virtfunc.exp,v
retrieving revision 1.11
diff -u -p -r1.11 virtfunc.exp
--- virtfunc.exp 14 Jan 2003 18:42:38 -0000 1.11
+++ virtfunc.exp 16 Jan 2003 21:31:09 -0000
@@ -39,8 +39,7 @@ if [get_compiler_info ${binfile} "c++"] source ${binfile}.ci
-set src "${srcdir}/${subdir}/${srcfile}"
-if { [gdb_compile "${src}" "${binfile}" executable {c++ debug}] != "" } {
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {c++ debug}] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}



--
Fernando Nasser
Red Hat - Toronto                       E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]