Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Bob Rossi <bob@brasko.net>
To: GDB <gdb@sources.redhat.com>
Subject: Re: How do I get regexp from expect at gdb_expect?
Date: Mon, 31 Jan 2005 22:00:00 -0000	[thread overview]
Message-ID: <20050131220050.GB8411@white> (raw)
In-Reply-To: <20050131212122.GA10092@nevyn.them.org>

> > The next command, '200-break-list' is in both the 'expect_out(buffer)'
> > and in the 'expect_out(0,string)'. This leads me to believe that there
> > is something wrong with the regular expression matching. It can match
> > things that it shouldn't, which could mask problems.
> > 
> > I don't really understand what you are saying about 'GDB is echoing
> > commands'. I do understand that when you are at the terminal running
> > GDB, GDB allows the terminal to 'echo' the char's typed. However, if you
> > fork/exec GDB, and send it a command, it will not 'echo' the data back
> > to your process. Isn't this the way Expect works?
> 
> Expect works on a terminal.  It's not instrumenting GDB to find out
> what GDB is writing; it's accepting whatever input comes to its side of
> the terminal.  Which includes things echoed by the terminal.  In
> readline mode GDB turns off echo and provides the echo manually; in MI
> mode, it does not touch the terminal, which echoes by default.
> 
> It's just your patterns that are producing a difference.

OOOOOO, Thanks! I didn't realize Expect use's the terminal in this way,
I think re-writing the mi_gdb_test regex from this,
   -re "\[\r\n\]*($pattern)\[\r\n\]+$mi_gdb_prompt\[ \]*$" {
to this,
   -re "\[\r\n\]*$command(\[\r\n\]*(($pattern)\[\r\n\]+$mi_gdb_prompt\[ \]*$))" {

solve's the problem!

It also tighten's up the MI output command matching, I honestly don't
know how the -break-delete was getting eaten in the regular expression,
unless $pattern happened to have a .*. Oops, in that case, I guess we
aren't really validation much, anything could have come out of GDB, and
it probably would have passed.

I'll consider adding this patch to the testsuite once I find the rest of
the testcase's that make the MI output command syntax checker fail.

Thanks,
Bob Rossi


  reply	other threads:[~2005-01-31 22:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-29  2:57 Bob Rossi
2005-01-29  3:09 ` Paul Hilfinger
2005-01-29  3:11   ` Bob Rossi
2005-01-29  3:16     ` Bob Rossi
2005-01-31 15:07   ` Bob Rossi
2005-01-31 16:28     ` Daniel Jacobowitz
2005-01-31 16:59       ` Bob Rossi
2005-01-31 21:10       ` Bob Rossi
2005-01-31 21:21         ` Daniel Jacobowitz
2005-01-31 22:00           ` Bob Rossi [this message]
2005-01-31 22:04             ` Daniel Jacobowitz
2005-01-31 22:12               ` Bob Rossi
2005-02-01  3:52                 ` Daniel Jacobowitz
2005-02-01 14:20                   ` Bob Rossi
2005-02-01 14:23                     ` Daniel Jacobowitz
2005-02-01 14:39                       ` Bob Rossi
2005-02-01 15:20                         ` Daniel Jacobowitz
2005-02-01 15:38                           ` Bob Rossi
2005-02-01 15:58                         ` Dave Korn
2005-02-01 16:10                           ` 'Bob Rossi'

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=20050131220050.GB8411@white \
    --to=bob@brasko.net \
    --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