This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Fully anchor mi_gdb_test expected results.
On Thu, Aug 04, 2005 at 10:09:37AM -0400, Bob Rossi wrote:
> Correct, this has nothing to do with readline. There are several
> problems with allowing the terminal to echo while testing the GDB/MI
> output. Sorry in advance for the long Email.
Sorry, but you seem to have missed my point...
> which simply allows any data at the beggining of the match. So I could
> easily modify an MI command to output "HAHAHA, YOU CAN'T TEST ME", as
> the first thing it outputs, and it would go unnoticed in the
> testsuite. Probably the reason this could not have been done before is
> because the MI input command was being echo'd back, and it would be
> complicated to match that data.
I am suggesting anchoring the pattern with a copy of what you expect to
be echoed. We already have code to escape a string into a regex. We
know what we sent to GDB.
If you think that's too much trouble, could you alternatively try "stty
-echo" in expect, rather than send_gdb "shell stty -echo"?
> - Make sure every test has the GDB expected pattern be the absolute
> beginning of the MI output command. Then I could assume in the
> general purpose match that the pattern was the beggining. It
> would look something like this,
> -re "^.*($pattern\[\r\n\]+$mi_gdb_prompt\[ \]*)$" {
> I don't like this approach because it makes the testcase do
> specific things in order to make sure that the syntax checking
> was done properly.
I've got no idea what you mean by this, but anchoring .* at the front
of a pattern doesn't accomplish anything!
--
Daniel Jacobowitz
CodeSourcery, LLC