From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23458 invoked by alias); 23 Apr 2010 17:29:49 -0000 Received: (qmail 23440 invoked by uid 22791); 23 Apr 2010 17:29:47 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 23 Apr 2010 17:29:36 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 146B52BACD6; Fri, 23 Apr 2010 13:29:34 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id mHy4enCaNUn1; Fri, 23 Apr 2010 13:29:34 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id F18392BACCD; Fri, 23 Apr 2010 13:29:33 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 81A54F5895; Fri, 23 Apr 2010 10:29:33 -0700 (PDT) Date: Fri, 23 Apr 2010 17:29:00 -0000 From: Joel Brobecker To: Pierre Muller Cc: gdb-patches@sourceware.org Subject: Re: [RFA] Testcase for bug report 11531 Message-ID: <20100423172933.GO19194@adacore.com> References: <000301cae303$d6d068b0$84713a10$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <000301cae303$d6d068b0$84713a10$@muller@ics-cnrs.unistra.fr> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-04/txt/msg00805.txt.bz2 > +# Do not use run_to main > +# as this sets a breakpoint at main. > +# If the breakpoint is at the same instruction as the > +# watchpoint value assignment > +# you can fall into the problem of the stepping over the breakpoint > +# location that can also trigger a watchpoint miss > +# This is not the problem reported here. > + > +gdb_test "start" ".*Temporary breakpoint.*" Unfortunately, this does not work when testing with the remote protocol. Do use "runto", but use "*main" instead of "main", or something like that. That way, you should always stop before the instruction that causes the watchpoint to trigger. > +gdb_test "next" \ > + "Old value = 0.*New value = 5.*" \ > + "watchpoint variable triggers at next" > + > +gdb_test "continue" \ > + "Old value = .*New value = 78.*" \ > + "watchpoint variable triggers at continue" This is a bit on the paranoid side, but can we use end-of-line expressions rather than ".*" to match the line break? For instance, I often use: set eol "\[\r\n\]+" gdb_test "next" \ "Old value = 0${eol}New value = 5${eol}" \ "watchpoint variable triggers at next" It's unlikely that you'll have any other number than zero if the leading digit is zero - but conceivably, we could print the new value as 55 and still pass the test... I did suggest at one time to provide a routine that takes a list of regexp strings, and builds a regexp string joined with the typical new-line regexp. That way, I could write the test as follow: test_gdb_complete "pck" \ [multi_line "(p pck\\.ad\[sb\])?" \ "(p pck\\.ad\[sb\])?" \ "p pck.external_identical_one" \ "p pck.inner.inside_variable" \ "p pck.local_identical_one" \ "p pck.local_identical_two" \ "p pck.my_global_variable" \ "p pck.proc" ] Daniel made another suggestion, which I needed time to investigate and yet never did :-(. -- Joel