From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22027 invoked by alias); 4 Aug 2005 14:18:03 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 21999 invoked by uid 22791); 4 Aug 2005 14:17:53 -0000 Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Thu, 04 Aug 2005 14:17:53 +0000 Received: from drow by nevyn.them.org with local (Exim 4.52) id 1E0gXf-00031C-Kc for gdb-patches@sources.redhat.com; Thu, 04 Aug 2005 10:17:51 -0400 Date: Thu, 04 Aug 2005 14:18:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com Subject: Re: Fully anchor mi_gdb_test expected results. Message-ID: <20050804141750.GA11536@nevyn.them.org> Mail-Followup-To: gdb-patches@sources.redhat.com References: <20050804025045.GC32108@white> <20050804041121.GB29482@nevyn.them.org> <20050804140937.GB4054@white> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050804140937.GB4054@white> User-Agent: Mutt/1.5.8i X-SW-Source: 2005-08/txt/msg00066.txt.bz2 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