Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Olatunji Ruwase <Olatunji.Ruwase@Sun.COM>
To: gdb@sourceware.org
Subject: Help with gdb testsuite (lib/gdb.exp)
Date: Wed, 21 Sep 2005 18:35:00 -0000	[thread overview]
Message-ID: <4331A7CA.6050807@Sun.COM> (raw)

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





             reply	other threads:[~2005-09-21 18:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-21 18:35 Olatunji Ruwase [this message]
2005-09-21 18:53 ` Daniel Jacobowitz
2005-09-21 21:43   ` Olatunji Ruwase
2005-09-21 21:48     ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4331A7CA.6050807@Sun.COM \
    --to=olatunji.ruwase@sun.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox