From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7493 invoked by alias); 18 Oct 2013 16:15:42 -0000 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 Received: (qmail 7481 invoked by uid 89); 18 Oct 2013 16:15:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wi0-f181.google.com Received: from mail-wi0-f181.google.com (HELO mail-wi0-f181.google.com) (209.85.212.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 18 Oct 2013 16:15:40 +0000 Received: by mail-wi0-f181.google.com with SMTP id l12so1270293wiv.14 for ; Fri, 18 Oct 2013 09:15:37 -0700 (PDT) X-Received: by 10.180.105.194 with SMTP id go2mr3588352wib.39.1382112937435; Fri, 18 Oct 2013 09:15:37 -0700 (PDT) Received: from [192.168.0.105] (bl16-9-144.dsl.telepac.pt. [188.81.9.144]) by mx.google.com with ESMTPSA id gp9sm28392422wib.8.2013.10.18.09.15.35 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 18 Oct 2013 09:15:36 -0700 (PDT) Message-ID: <52615EA6.3070001@gmail.com> Date: Fri, 18 Oct 2013 16:15:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Andrew Burgess CC: "gdb-patches@sourceware.org" , lgustavo@codesourcery.com Subject: Re: [PATCH] Permanent breakpoints degrade to normal breakpoints on enable References: <52614A15.7070301@broadcom.com> In-Reply-To: <52614A15.7070301@broadcom.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2013-10/txt/msg00573.txt.bz2 On 10/18/2013 03:47 PM, Andrew Burgess wrote: > This patch: > https://sourceware.org/ml/gdb-patches/2012-01/msg00964.html > > introduced what I believe is a stray line that causes permanent > breakpoints to become normal breakpoints if the user ever tries > to "enable" the permanent breakpoint. Indeed. > I've removed the extra line and written a test to cover this case. > > OK to apply? > > Andrew > > gdb/ChangeLog > > 2013-10-18 Andrew Burgess > > * breakpoint.c (enable_breakpoint_disp): Remove setting of > enabled_state for permanent breakpoints. > > gdb/testsuite/ChangeLog > > 2013-10-18 Andrew Burgess > > * gdb.arch/i386-permbkpt.exp: Extend the existing tests, and add > more tests. > > diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c > index 911f7b5..53ece71 100644 > --- a/gdb/breakpoint.c > +++ b/gdb/breakpoint.c > @@ -14666,8 +14666,6 @@ enable_breakpoint_disp (struct breakpoint *bpt, enum bpdisp disposition, > if (bpt->enable_state != bp_permanent) > bpt->enable_state = bp_enabled; > > - bpt->enable_state = bp_enabled; > - > /* Mark breakpoint locations modified. */ > mark_breakpoint_modified (bpt); > > diff --git a/gdb/testsuite/gdb.arch/i386-permbkpt.exp b/gdb/testsuite/gdb.arch/i386-permbkpt.exp > index 88bfff3..52c2ee1 100644 > --- a/gdb/testsuite/gdb.arch/i386-permbkpt.exp > +++ b/gdb/testsuite/gdb.arch/i386-permbkpt.exp > @@ -18,6 +18,9 @@ > > # Test inserting breakpoints over permanent breakpoints on i386 and amd64. > > +global hex > +global decimal > + I don't think you actually need to declare these. > if { ![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"] } then { > verbose "Skipping i386 test for multi break at permanent breakpoint location." > return > @@ -35,5 +38,28 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list > > clean_restart ${binfile} > > -gdb_test "break main" "" "First permanent break" > -gdb_test "break main" "" "Second permanent break" > +gdb_test "break main" \ > + "Breakpoint $decimal at $hex: .*" \ > + "First permanent break" > +gdb_test_no_output "set \$bp1 = \$bpnum" > + > +# Place a second breakpoint at the same place as the first, check > +# that the first is called a "permanent" breakpoint. > +gdb_test "break main" \ > + "Note: breakpoint $decimal \\(permanent\\) also set at pc $hex\.\[\n\r\]+Breakpoint $decimal at $hex: .*" \ > + "Second permanent break" > +gdb_test_no_output "set \$bp2 = \$bpnum" > + > +# Now, delete the last breakpoint placed. > +gdb_test_no_output "delete \$bp2" > + > +# Now 'enable' the first breakpoint, this should have no impact as the > +# breakpoint is already enabled, however, we've had bugs in this code > +# before now. s/now//. > +gdb_test_no_output "enable \$bp1" > + > +# Check that placing (another) second breakpoint at the same location as > +# the first still reports the first as a permanent breakpoint. > +gdb_test "break main" \ > + "Note: breakpoint $decimal \\(permanent\\) also set at pc $hex\.\[\n\r\]+Breakpoint $decimal at $hex: .*" \ > + "Third permanent break" > Otherwise OK. Thanks! -- Pedro Alves