This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[Cygwin problem]:with banned variables
- From: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- To: <brobecke at sourceware dot org>, <gdb-patches at sourceware dot org>
- Date: Sat, 19 Jun 2010 10:41:56 +0200
- Subject: [Cygwin problem]:with banned variables
- References: <20100517171128.29087.qmail@sourceware.org>
Following this patch,
I can't run the testsuite for Cygwin anymore :(
See this:
$ make check RUNTESTFLAGS="gdb.base/a*.exp"
Nothing to be done for all...
rootme=`pwd`; export rootme; srcdir=../../../src/gdb/testsuite ; export
srcdir ;
EXPECT=`if [ -f ${rootme}/../../expect/expect ] ; then echo
${rootme}/../../exp
ect/expect ; else echo expect ; fi` ; export EXPECT ; EXEEXT=.exe ; export
EXEEX
T ;
LD_LIBRARY_PATH=$rootme/../../expect:$rootme/../../libstdc++:$rootme/../../t
k/unix:$rootme/../../tcl/unix:$rootme/../../bfd:$rootme/../../opcodes:$LD_LI
BRAR
Y_PATH; export LD_LIBRARY_PATH; if [ -f ${rootme}/../../expect/expect ] ;
then T
CL_LIBRARY=${srcdir}/../../tcl/library ; export TCL_LIBRARY ; fi ; ` if [ -f
${s
rcdir}/../../dejagnu/runtest ]; then echo ${srcdir}/../../dejagnu/runtest;
else
if [ "i686-pc-cygwin" = "i686-pc-cygwin" ]; then echo runtest; else
t='s,y,y,';
echo runtest | sed -e $t; fi; fi` gdb.base/a*.exp
WARNING: Couldn't find the global config file.
Test Run By Pierre on Sat Jun 19 06:46:45 2010
Native configuration is i686-pc-cygwin
=== gdb tests ===
Schedule of variations:
unix
Running target unix
Using /usr/share/dejagnu/baseboards/unix.exp as board description file for
targe
t.
Using /usr/share/dejagnu/config/unix.exp as generic interface file for
target.
Using ../../../src/gdb/testsuite/config/unix.exp as tool-and-target-specific
int
erface file.
Running ../../../src/gdb/testsuite/gdb.base/a2-run.exp ...
FAIL: gdb.base/a2-run.exp: run "a2-run" with shell (the program exited)
Running ../../../src/gdb/testsuite/gdb.base/advance.exp ...
can't set "prms_id": prms_id
while executing
"set prms_id 0"
(procedure "runtest" line 10)
invoked from within
"runtest $test_name"
("foreach" body line 24)
invoked from within
"foreach test_name $testlist {
if { ${ignoretests} != "" } {
It appears that pmrs_id and bug_id are reset to 0 inside
/usr/share/dejagnu/runtest.exp
in proc runtest
I know that Cygwin uses an outdated expect,
but I don't understand why this error only shows up
for Cygwin.
The lastest
If I modify lib/gdb.exp
Index: lib/gdb.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v
retrieving revision 1.150
diff -r1.150 gdb.exp
100a101,106
> # The variable transform_gdb_expect_code can be set to the name of
> # a procedure that will transform the code parameter of gdb_expect call
> # in order to cope for some target dependant problems
> # it can also be reset to an empty string to disable that operation
> global transform_gdb_expect_code
>
2180a2187,2194
> global transform_gdb_expect_code;
> if [info exists transform_gdb_expect_code] {
> if { "[info procs $transform_gdb_expect_code]" != "" } {
> set expcode [$transform_gdb_expect_code $expcode];
> } elseif { "$transform_gdb_expect_code" != "" } {
> perror "Procedure $transform_gdb_expect_code unknown"
> }
> }
2522a2537,2541
> proc trace_write { varname args } {
> upvar #0 $varname var
> puts "Error: trying to write $varname to \"$var\""
> }
>
2535c2554
< trace variable "$banned_var" w error
---
> trace variable "$banned_var" w "trace_write $banned_var"
Then I also see, on x86_64 linux machine:
muller@gcc16:~/gdb/build-norm/gdb/testsuite$ make check
RUNTESTFLAGS="gdb.base/
a*.exp"
Nothing to be done for all...
rootme=`pwd`; export rootme; srcdir=../../../src/gdb/testsuite ; export
srcdir ;
EXPECT=`if [ -f ${rootme}/../../expect/expect ] ; then echo
${rootme}/../../exp
ect/expect ; else echo expect ; fi` ; export EXPECT ; EXEEXT= ; export
EXEEXT ;
LD_LIBRARY_PATH=$rootme/../../expect:$rootme/../../libstdc++:$rootme/../../t
k/un
ix:$rootme/../../tcl/unix:$rootme/../../bfd:$rootme/../../opcodes:$LD_LIBRAR
Y_PA
TH; export LD_LIBRARY_PATH; if [ -f ${rootme}/../../expect/expect ] ; then
TCL_L
IBRARY=${srcdir}/../../tcl/library ; export TCL_LIBRARY ; fi ; ` if [ -f
${srcdi
r}/../../dejagnu/runtest ]; then echo ${srcdir}/../../dejagnu/runtest; else
if [
"x86_64-unknown-linux-gnu" = "x86_64-unknown-linux-gnu" ]; then echo
runtest; e
lse t='s,y,y,'; echo runtest | sed -e $t; fi; fi` gdb.base/a*.exp
Test Run By muller on Sat Jun 19 09:48:09 2010
Native configuration is x86_64-unknown-linux-gnu
=== gdb tests ===
Schedule of variations:
unix
Running target unix
Using /usr/share/dejagnu/baseboards/unix.exp as board description file for
targe
t.
Using /usr/share/dejagnu/config/unix.exp as generic interface file for
target.
Using ../../../src/gdb/testsuite/config/unix.exp as tool-and-target-specific
int
erface file.
Running ../../../src/gdb/testsuite/gdb.base/auxv.exp ...
WARNING: can't generate a core file - core tests suppressed - check ulimit
-c
FAIL: gdb.base/auxv.exp: generate native core dump
Running ../../../src/gdb/testsuite/gdb.base/args.exp ...
Error: trying to write prms_id to "0"
Error: trying to write bug_id to "0"
Running ../../../src/gdb/testsuite/gdb.base/assign.exp ...
Error: trying to write prms_id to "0"
Error: trying to write prms_id to "0"
Error: trying to write bug_id to "0"
Error: trying to write bug_id to "0"
Running ../../../src/gdb/testsuite/gdb.base/all-bin.exp ...
So it seems that the difference is in the "error" internal command...
Pierre
> -----Message d'origine-----
> De?: gdb-cvs-owner@sourceware.org [mailto:gdb-cvs-owner@sourceware.org]
> De la part de brobecke@sourceware.org
> Envoyé?: Monday, May 17, 2010 7:11 PM
> À?: gdb-cvs@sourceware.org
> Objet?: src/gdb/testsuite ChangeLog lib/gdb.exp
>
> CVSROOT: /cvs/src
> Module name: src
> Changes by: brobecke@sourceware.org 2010-05-17 17:11:28
>
> Modified files:
> gdb/testsuite : ChangeLog
> gdb/testsuite/lib: gdb.exp
>
> Log message:
> testsuite: Prevent writes to prms_id and bug_id.
>
> gdb/testsuite/ChangeLog:
>
> * lib/gdb.exp (banned_variables): New variable/constant.
> (gdb_init): Add write trace on variables listed in
> banned_variables.
> (gdb_finish): Remove write traces on variables listed in
> banned_variables.
>
> Patches:
> http://sourceware.org/cgi-
> bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.2267&r
> 2=1.2268
> http://sourceware.org/cgi-
> bin/cvsweb.cgi/src/gdb/testsuite/lib/gdb.exp.diff?cvsroot=src&r1=1.146&
> r2=1.147