From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6140 invoked by alias); 10 Apr 2003 23:39:46 -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 6093 invoked from network); 10 Apr 2003 23:39:45 -0000 Received: from unknown (HELO jackfruit.Stanford.EDU) (171.64.38.136) by sources.redhat.com with SMTP; 10 Apr 2003 23:39:45 -0000 Received: (from carlton@localhost) by jackfruit.Stanford.EDU (8.11.6/8.11.6) id h3ANdck21516; Thu, 10 Apr 2003 16:39:38 -0700 X-Authentication-Warning: jackfruit.Stanford.EDU: carlton set sender to carlton@math.stanford.edu using -f To: Jim Blandy Cc: gdb-patches@sources.redhat.com Subject: Re: RFA: match source code, not line numbers References: From: David Carlton Date: Thu, 10 Apr 2003 23:39:00 -0000 In-Reply-To: Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-04/txt/msg00221.txt.bz2 On 10 Apr 2003 18:06:32 -0500, Jim Blandy said: > This makes these tests more robust when the .cc files are edited. Yeah, I noticed that issue when I was looking over the second version of the patches; it didn't seem worth commenting at the time, but I'm glad you're fixing them. Hmm. Normally we've been grabbing line numbers via marker comments and gdb_get_line_number in these sorts of situations. (See gdb.c++/m-data.exp, for example; of course, in that example, we actually need a line number.) It's a little more complicated here, because it looks like you're seeing two different target line numbers. But marker comments have the advantage over your approach that they leave a residue in the .cc file as well as in the .exp file, lessening the chance that somebody will inadvertently edit the .cc file in a fashion that silently breaks the test. How about you add a comment like "// done-with-marker1" at the end of both lines in question (in each test), and then put 'done-with-marker1' in your regexp instead of the matches for the bodies of the two lines? That would satisfy my concerns, avoid the need for gdb_get_line_number, and make the regexp a little simpler. David Carlton carlton@math.stanford.edu