From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Kevin Pouget <kevin.pouget@gmail.com>
Cc: Tom Tromey <tromey@redhat.com>, gdb-patches@sourceware.org
Subject: Re: Dejagnu testing issue
Date: Fri, 21 Oct 2011 08:42:00 -0000 [thread overview]
Message-ID: <20111021083242.GA8363@host1.jankratochvil.net> (raw)
In-Reply-To: <CAPftXUJ5xrFnYRVK+-FkRw_Gv48BscqOBw2mpo8rA5OJdTJtVw@mail.gmail.com>
On Fri, 21 Oct 2011 10:14:42 +0200, Kevin Pouget wrote:
> for the record, here is the way to get the pid based on "expect_out":
>
> gdb_test_multiple "info inferior" "list inferiors" {
> -re ".* \* 1.*process (\[0-9\]*).*$gdb_prompt $" {
> set pid $expect_out(1,string)
> pass "list inferiors"
> }
> }
While it works to make it working as was intended it could be for example:
gdb_test_multiple "info inferior" "list inferiors" {
-re "\r\n\\* 1 *process (\[0-9\]*) .*\r\n$gdb_prompt $" {
set pid $expect_out(1,string)
pass "list inferiors"
}
}
Initial .* is redundant, start of the expect string is not anchored.
\* is equal to * as the first level of backslashes is parsed by TCL
interpreter, not by the regex compiler.
If one fixes \* -> \\* to really match an asterisk it no longer matches.
The asterisk is preceded by a newline, not by a space as in your regex string.
Regards,
Jan
next prev parent reply other threads:[~2011-10-21 8:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-20 14:56 Kevin Pouget
2011-10-20 15:02 ` Jan Kratochvil
2011-10-20 15:04 ` Tom Tromey
2011-10-21 8:33 ` Kevin Pouget
2011-10-21 8:42 ` Jan Kratochvil [this message]
2011-10-24 9:15 ` Kevin Pouget
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=20111021083242.GA8363@host1.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=kevin.pouget@gmail.com \
--cc=tromey@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