This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Help with gdb testsuite (lib/gdb.exp)
- From: Olatunji Ruwase <Olatunji dot Ruwase at Sun dot COM>
- To: gdb at sourceware dot org
- Date: Wed, 21 Sep 2005 11:34:50 -0700
- Subject: Help with gdb testsuite (lib/gdb.exp)
- Reply-to: Olatunji dot Ruwase at Sun dot COM
Hi,
I hope this is the right medium for my problem, if not I apologise and
would appreciate if this could be forwarded to the appropriate list.
I recently started playing with the gdb testsuite and ran into a problem
I traced as far as gdb_test_multiple in lib/gdb.exp. Below is the
command line and error message in gdb.log.
% runtest -tool gdb GDB=../gdb -di gdb.asm
**********************************
(gdb) ERROR: tcl error sourcing
gdb-6.3-src/gdb/testsuite/gdb.asm/asm-source.exp.
ERROR: can't read "patter": no such variable
while executing
"list -re "\[\r\ \]*($patter )\[\r\ \]+$gdb_prompt $" {
if ![stri g match "" $message] the {
pass "$message"
}
}"
("uplevel" body line 1)
invoked from within
"uplevel list $subst_code"
(procedure "gdb_test_multiple" line 35)
invoked from within
"gdb_test_multiple $command $message {
-re "\[\r\n\]*($pattern)\[\r\n\]+$gdb_prompt $" {
if ![string match "" $message] then {
pass "$message"
..."
(procedure "gdb_test" line 22)
invoked from within
"gdb_test "f" "asmsrc1\[.\]s:29.*several_nops" "f at main""
(file "gdb-6.3-src/gdb/testsuite/gdb.asm/asm-source.exp" line 237)
invoked from within
"source gdb-6.3-src/gdb/testsuite/gdb.asm/asm-source.exp"
("uplevel" body line 1)
invoked from within
"uplevel #0 source gdb-6.3-src/gdb/testsuite/gdb.asm/asm-source.exp"
invoked from within
"catch "uplevel #0 source $test_file_name""
**********************************************
So I tried debugging using the Tcl debugger option -D1, and it seems the
"regsub -all {\n} ..." command in gdb_test_multiple is at fault, (debug
session is given below). It removes all 'n' in the pattern although its
supposed to remove only newline '\n'. I tried fixing this using
"regsub -all {\\n}..." command, and I ran into another testsuite failure
further down the road. Perhaps this a bug or not, I m not sure, but it
could be due to my dejagnu, tcl and expect versions. My understanding is
that some regular expression patterns e.g '\n' dont have a consensus
matching semantics across different tools. I m willing to provide more
information if needed.
Thanks
tunji
dejagnu 1.4.4
expect 5.43
gdb 6.4
tcl 8.4.9
breakpoint 0: -re "gdb_test_multiple"
13: gdb_test_multiple $command $message {
-re "\[\r\n\]*($pattern)\[\r\n\]+...
dbg13.4> b -r regsub
1
dbg13.5> c
breakpoint 1: -re "regsub"
14: regsub -all {\n} ${user_code} { } subst_code
dbg14.6> p $user_code
-re "\[\r\n\]*($pattern)\[\r\n\]+$gdb_prompt $" {
if ![string match "" $message] then {
pass "$message"
}
}
-re "(${question_string})$" {
send_gdb "$response_string\n";
exp_continue;
}
dbg14.7> n
14: uplevel list $subst_code
dbg14.8> p $subst_code
-re "\[\r\ \]*($patter )\[\r\ \]+$gdb_prompt $" {
if ![stri g match "" $message] the {
pass "$message"
}
}
-re "(${questio _stri g})$" {
se d_gdb "$respo se_stri g\ ";
exp_co ti ue;
}