public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Help with gdb testsuite (lib/gdb.exp)
@ 2005-09-21 18:35 Olatunji Ruwase
  2005-09-21 18:53 ` Daniel Jacobowitz
  0 siblings, 1 reply; 4+ messages in thread
From: Olatunji Ruwase @ 2005-09-21 18:35 UTC (permalink / raw)
  To: gdb

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;
	}




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Help with gdb testsuite (lib/gdb.exp)
  2005-09-21 18:35 Help with gdb testsuite (lib/gdb.exp) Olatunji Ruwase
@ 2005-09-21 18:53 ` Daniel Jacobowitz
  2005-09-21 21:43   ` Olatunji Ruwase
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Jacobowitz @ 2005-09-21 18:53 UTC (permalink / raw)
  To: Olatunji Ruwase; +Cc: gdb

On Wed, Sep 21, 2005 at 11:34:50AM -0700, Olatunji Ruwase wrote:
> 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.

Is something wrong with your TCL installation maybe?  Try this in
tclsh:

set a { a
b
c
d}

regsub -all {\n} ${a} { } b

set a

set b

It should show you $b without newlines.

> dejagnu 1.4.4
> expect  5.43
> gdb     6.4
> tcl     8.4.9

What platform is this?

-- 
Daniel Jacobowitz
CodeSourcery, LLC

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Help with gdb testsuite (lib/gdb.exp)
  2005-09-21 18:53 ` Daniel Jacobowitz
@ 2005-09-21 21:43   ` Olatunji Ruwase
  2005-09-21 21:48     ` Daniel Jacobowitz
  0 siblings, 1 reply; 4+ messages in thread
From: Olatunji Ruwase @ 2005-09-21 21:43 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb

Thanks for your response. I found out that release versions I quoted in
my initial email were wrong, sorry about that :(.
runtest was picking up an older version of expect and tcl.

% runtest -V
WARNING: Couldn't find the global config file.
Expect version is	5.25.0
Tcl version is		8.0
Framework version is	1.4.4

The simple test you prescribed worked on tcl version 8.4 but not on 8.0,
i.e newlines remain in $b.
Making runtest use the newer releases solved the problem.
Thanks

tunji

Running on a sparc machine

% tclsh
% info tclversion
8.0
% set a { a
b
c
d}
 a
b
c
d
% regsub -all {\n} ${a} { } b
0
% set a
 a
b
c
d
% set b
 a
b
c
d
%


Daniel Jacobowitz wrote On 09/21/05 11:41,:
> On Wed, Sep 21, 2005 at 11:34:50AM -0700, Olatunji Ruwase wrote:
> 
>>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.
> 
> 
> Is something wrong with your TCL installation maybe?  Try this in
> tclsh:
> 
> set a { a
> b
> c
> d}
> 
> regsub -all {\n} ${a} { } b
> 
> set a
> 
> set b
> 
> It should show you $b without newlines.
> 
> 
>>dejagnu 1.4.4
>>expect  5.43
>>gdb     6.4
>>tcl     8.4.9
> 
> 
> What platform is this?
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Help with gdb testsuite (lib/gdb.exp)
  2005-09-21 21:43   ` Olatunji Ruwase
@ 2005-09-21 21:48     ` Daniel Jacobowitz
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Jacobowitz @ 2005-09-21 21:48 UTC (permalink / raw)
  To: Olatunji Ruwase; +Cc: gdb

On Wed, Sep 21, 2005 at 02:42:54PM -0700, Olatunji Ruwase wrote:
> Thanks for your response. I found out that release versions I quoted in
> my initial email were wrong, sorry about that :(.
> runtest was picking up an older version of expect and tcl.
> 
> % runtest -V
> WARNING: Couldn't find the global config file.
> Expect version is	5.25.0
> Tcl version is		8.0
> Framework version is	1.4.4
> 
> The simple test you prescribed worked on tcl version 8.4 but not on 8.0,
> i.e newlines remain in $b.
> Making runtest use the newer releases solved the problem.

There you go; thanks for confirming.  That TCL version is six years
old, so I don't feel really obliged to support it.


-- 
Daniel Jacobowitz
CodeSourcery, LLC

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-09-21 21:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-21 18:35 Help with gdb testsuite (lib/gdb.exp) Olatunji Ruwase
2005-09-21 18:53 ` Daniel Jacobowitz
2005-09-21 21:43   ` Olatunji Ruwase
2005-09-21 21:48     ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).