From: Daniel Jacobowitz <drow@mvista.com>
To: gdb@sources.redhat.com
Subject: Re: Expect fails to recognize regexp
Date: Fri, 13 Sep 2002 11:15:00 -0000 [thread overview]
Message-ID: <20020913181558.GA27282@nevyn.them.org> (raw)
In-Reply-To: <20020913200643.I1574@cygbert.vinschen.de>
On Fri, Sep 13, 2002 at 08:06:43PM +0200, Corinna Vinschen wrote:
> Hi,
>
> I'm trying to fix an error in the testsuite lib but I'm stuck at one
> point. For some mysterious reason, I can't get a regexp right.
>
> Ok, the original preoblem I'm trying to solve is, that in lib/gdb.exp,
> proc rerun_to_main() the procedure doesn't take into account, that
> some targets never actually exit, but instead are programatically
> trapped in some _exit function.
>
> This means that rerun_to_main() must be able to manage the situation
> that gdb not just reruns, but first asks
>
> The program being debugged has been started already.
> Start it from the beginning? (y or n)
>
> What I did was adding the following patch to gdb.exp:
>
> Index: lib/gdb.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v
> retrieving revision 1.26
> diff -u -p -r1.26 gdb.exp
> --- lib/gdb.exp 13 Sep 2002 17:20:11 -0000 1.26
> +++ lib/gdb.exp 13 Sep 2002 17:59:35 -0000
> @@ -1685,6 +1685,10 @@ proc rerun_to_main {} {
> } else {
> send_gdb "run\n"
> gdb_expect {
> + -re "The program .* has been started already.*y or n. $" {
> + send_gdb "y\n"
> + exp_continue
> + }
> -re "Starting program.*$gdb_prompt $"\
> {pass "rerun to main" ; return 0}
> -re "$gdb_prompt $"\
>
> but it doesn't work! I tried various... uhm... variations of the
> expression, include simple stuff as
>
> -re "The program.*"
>
> or moving the -re back and forth in the gdb_expect expression but to
> no avail. The result in gdb.log was always the same:
>
> (gdb) PASS: gdb.base/ena-dis-br.exp: continue until exit at no stop
> run^M
> The program being debugged has been started already.^M
> Start it from the beginning? (y or n) FAIL: gdb.base/ena-dis-br.exp:
> (timeout) rerun to main
>
> As you can see, there's no 'y' in the log so expect didn't recognize
> the expression at all.
>
> Does anybody have an idea what's going on here?
What do you get if you put "exp_internal 1" before this expression?
[This is why I loathe DejaGNU sometimes. TCL/Expect are very...
picky.]
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
next prev parent reply other threads:[~2002-09-13 18:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-13 11:06 Corinna Vinschen
2002-09-13 11:10 ` David Carlton
2002-09-13 11:15 ` Daniel Jacobowitz [this message]
2002-09-13 11:24 ` Elena Zannoni
2002-09-13 14:23 ` Corinna Vinschen
2002-09-13 15:01 ` Daniel Jacobowitz
2002-09-14 2:28 ` Corinna Vinschen
2002-09-13 17:53 ` Felix Lee
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=20020913181558.GA27282@nevyn.them.org \
--to=drow@mvista.com \
--cc=gdb@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