From: Joel Brobecker <brobecker@gnat.com>
To: gdb-patches@sources.redhat.com
Subject: Re: [RFA/testsuite] Workaround timeout in default.exp
Date: Fri, 21 May 2004 01:14:00 -0000 [thread overview]
Message-ID: <20040521011443.GG10684@gnat.com> (raw)
In-Reply-To: <20040520022747.GA451@nevyn.them.org>
> If you're trying to debug expect matching, I recommend "exp_internal 1"
> before the block (and maybe "exp_internal 0" after). That will let you
> see exactly what's going on, and why my crackpot theory is wrong :)
Nice command, that really helped understand better what was going on.
Roughly, it seems that what is hurting us is that expect is eating up
the output from GDB reeeaaaal slooooowwww. Not expect's fault, I imagine,
but by counting characters in the first few iterations, it looks like
expect gets the output 12-15 characters at a time. It takes a total
of 113 reads to fetch the entire command output, which contains ~9000
characters, which makes around 80 chars per read.
And from watching it run and spit the expect debug data, it seems as if
expect is getting slower and slower at each iteration. It looks like an
algorithm that's not linear, but something exponential instead.
As an experiment, I tried increasing the timeout value to 600secs,
and the test did complete successfully... After 18mins!
It seemed to be slowing down on the evaluation of one specific regexp:
".*\(gdb\) $"? no
So I uncommented it in gdb_test_multiple as follow, just to see what
effect it would have:
# -re ".*$gdb_prompt $" {
# if ![string match "" $message] then {
# fail "$message"
# }
# set result 1
# }
You are going to be surprised. That specific test takes less than 40secs
to run. The whole default.exp test takes a total of 1mn45secs.
And what's curious, even after have is that I still see expect try the
same regexp. Before commenting out the code above, the sequence of
regexp evaluations looked like:
"Undefined[a-z]* command:.*\(gdb\) $"? no
"Ambiguous command.*\(gdb\) $"? no
"Program exited with code [0-9]+.*\(gdb\) $"? no
"EXIT code [0-9\r\n]+Program exited normally.*\(gdb\) $"? no
"The program is not being run.*\(gdb\) $"? no
".*\(gdb\) $"? no
"<return>"? no
"\(y or n\) "? no
After, it was slightly transformed into:
"Undefined[a-z]* command:.*\(gdb\) $"? no
"Ambiguous command.*\(gdb\) $"? no
"Program exited with code [0-9]+.*\(gdb\) $"? no
"EXIT code [0-9\r\n]+Program exited normally.*\(gdb\) $"? no
"The program is not being run.*\(gdb\) $"? no
"#"? no
".*\(gdb\) $"? no
"<return>"? no
"\(y or n\) "? no
At this point, no comprendo anymore... :-/
(where does the "#" come from, and why is the gdb_prompt check
still there?)
--
Joel
next prev parent reply other threads:[~2004-05-21 1:14 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-18 21:01 Joel Brobecker
2004-05-18 21:42 ` Daniel Jacobowitz
2004-05-20 1:48 ` Joel Brobecker
2004-05-20 2:27 ` Daniel Jacobowitz
2004-05-21 1:14 ` Joel Brobecker [this message]
2004-05-21 1:31 ` Daniel Jacobowitz
2004-05-21 1:43 ` Joel Brobecker
2004-05-21 6:58 ` Jim Blandy
2004-05-21 16:10 ` Joel Brobecker
[not found] ` <20040521160554.GK10684@gnat.com>
2004-05-21 16:36 ` Daniel Jacobowitz
2004-05-21 17:28 ` Joel Brobecker
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=20040521011443.GG10684@gnat.com \
--to=brobecker@gnat.com \
--cc=gdb-patches@sources.redhat.com \
/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