From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Abhijit Halder <abhijit.k.halder@gmail.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH][TEST-CASE][DOC] Implementation of pipe to pass GDB's command output to a shell command.
Date: Sun, 04 Sep 2011 15:05:00 -0000 [thread overview]
Message-ID: <20110904145231.GA18986@host1.jankratochvil.net> (raw)
In-Reply-To: <CAOhZP9yAvaFm6b_v6TUdzt61_8MdN7z0DvQ8vPmuPBHhWAWRow@mail.gmail.com>
On Sat, 03 Sep 2011 11:21:19 +0200, Abhijit Halder wrote:
> >> + Â Â regsub -all {\$[0-9]+} $fdata {} pattern
> >> + Â Â if ![string match $pattern " = 120 'x'\n"] then {
> >
> > Instead of regsub + string match just:
> > Â Â if ![string match "* = 120 'x'\n" $fdata] then {
> >
> The intention was to eliminate only numeric patterns here.
> Instead if I used "if ![string match "* = 120 'x'\n" $fdata] then {"
> following pattern will also match:
> $junk = 120 'x'
> that I did not want.
It is currently a common practice to match this kind of pattern just from
` = ' upwards such as:
gdb_test "p callme ()" " = 42"
etc. everywhere in the testsuite.
But if you want to match the initial $number part such as in
gdb_test "print test1.test" "\\$\[0-9\]* = true" "simple object, const bool"
then it is more simple by:
if ![regexp {^\$[0-9]+ = 120 'x'\n$} $fdata] then {
Thanks,
Jan
next prev parent reply other threads:[~2011-09-04 14:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-31 15:09 Abhijit Halder
2011-09-02 21:04 ` Jan Kratochvil
2011-09-03 9:32 ` Abhijit Halder
2011-09-04 15:05 ` Jan Kratochvil [this message]
2011-09-04 17:05 ` Abhijit Halder
2011-09-05 11:56 ` Abhijit Halder
2011-09-05 15:57 ` Abhijit Halder
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=20110904145231.GA18986@host1.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=abhijit.k.halder@gmail.com \
--cc=gdb-patches@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