From patchwork Thu Oct 9 19:10:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kratochvil X-Patchwork-Id: 3180 Received: (qmail 12945 invoked by alias); 9 Oct 2014 19:10:44 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 12936 invoked by uid 89); 9 Oct 2014 19:10:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.0 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 09 Oct 2014 19:10:42 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s99JAdpl029108 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 9 Oct 2014 15:10:39 -0400 Received: from host2.jankratochvil.net (ovpn-116-49.ams2.redhat.com [10.36.116.49]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s99JAZAK002730 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Thu, 9 Oct 2014 15:10:38 -0400 Date: Thu, 9 Oct 2014 21:10:35 +0200 From: Jan Kratochvil To: Yao Qi Cc: gdb-patches@sourceware.org, Miroslav Franc Subject: [patchv2 1/2] save breakpoints does not save disabled breakpoints correctly Message-ID: <20141009191035.GB26010@host2.jankratochvil.net> References: <20141003203228.GB30562@host2.jankratochvil.net> <87mw95s5xz.fsf@codesourcery.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87mw95s5xz.fsf@codesourcery.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes On Thu, 09 Oct 2014 15:55:52 +0200, Yao Qi wrote: > This line is too long... IWBN I would prefer no IWBN and rather this is or is not required for check-in approval. I am really aware of very many IWBN things to change in GDB. > to convert gdb_test to gdb_test_sequence, > so that the patterns are written for each line, and will be more clear. Done. But IMO it is a functionality regression as: * gdb_test_sequence permits arbitary number of lines of text between those lines being matched. Former regex string did not allow it. This may make a difference if GDB regresses by printing some unexpected line after the breakpoint info line (like a "silent" line). * \[\r\n\]+ can be used to anchor the beginning of the pattern, in the sense of Perl regex ^ /m match. At least I have found such cases in existing *.exp files so I used that. Using ^ really does not work. But I am not aware how to do Perl regex $ /m match. Using $ really does not work. But this means that for example the trailing ( \\((host|target) evals\\))? on the line "\[\r\n\]+\[ \t\]+stop only if i == 1( \\((host|target) evals\\))?" originally made sense there but now it can be removed as it has no longer any functionality there - it will match now any trailing line garbage. Jan gdb/testsuite/ 2014-10-09 Jan Kratochvil * gdb.base/save-bp.exp (info break): Use gdb_test_sequence. diff --git a/gdb/testsuite/gdb.base/save-bp.exp b/gdb/testsuite/gdb.base/save-bp.exp index ba98633..61f647c 100644 --- a/gdb/testsuite/gdb.base/save-bp.exp +++ b/gdb/testsuite/gdb.base/save-bp.exp @@ -72,5 +72,16 @@ gdb_test "source $bps" "" "source bps" # Now, verify that all breakpoints have been created correctly... set bp_row_start "\[0-9\]+ +breakpoint +keep +y +0x\[0-9a-f\]+ +in" set dprintf_row_start "\[0-9\]+ +dprintf +keep +y +0x\[0-9a-f\]+ +in" -gdb_test "info break" \ - " *Num +Type +Disp +Enb +Address +What\r\n$bp_row_start break_me at .*$srcfile:\[0-9\]+\r\n$bp_row_start main at .*$srcfile:$loc_bp2\r\n$bp_row_start main at .*$srcfile:$loc_bp3 +thread 1\r\n\[ \t]+stop only in thread 1\r\n$bp_row_start main at .*$srcfile:$loc_bp4\r\n\[ \t\]+stop only if i == 1( \\((host|target) evals\\))?\r\n$bp_row_start main at .*$srcfile:$loc_bp5\r\n\[ \t\]+silent\r\n$dprintf_row_start main at .*$srcfile:$loc_bp5\r\n\[ \t\]+printf.*" +gdb_test_sequence "info break" "info break" [list \ + "\[\r\n\]+Num +Type +Disp +Enb +Address +What" \ + "\[\r\n\]+$bp_row_start break_me at \[^\r\n\]*$srcfile:\[0-9\]+" \ + "\[\r\n\]+$bp_row_start main at \[^\r\n\]*$srcfile:$loc_bp2" \ + "\[\r\n\]+$bp_row_start main at \[^\r\n\]*$srcfile:$loc_bp3 +thread 1" \ + "\[\r\n\]+\[ \t]+stop only in thread 1" \ + "\[\r\n\]+$bp_row_start main at \[^\r\n\]*$srcfile:$loc_bp4" \ + "\[\r\n\]+\[ \t\]+stop only if i == 1( \\((host|target) evals\\))?" \ + "\[\r\n\]+$bp_row_start main at \[^\r\n\]*$srcfile:$loc_bp5" \ + "\[\r\n\]+\[ \t\]+silent" \ + "\[\r\n\]+$dprintf_row_start main at \[^\r\n\]*$srcfile:$loc_bp5" \ + "\[\r\n\]+\[ \t\]+printf" \ +]