From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31732 invoked by alias); 23 Jun 2011 09:21:41 -0000 Received: (qmail 31722 invoked by uid 22791); 23 Jun 2011 09:21:40 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 23 Jun 2011 09:21:26 +0000 Received: (qmail 20438 invoked from network); 23 Jun 2011 09:21:25 -0000 Received: from unknown (HELO ?192.168.0.101?) (yao@127.0.0.2) by mail.codesourcery.com with ESMTPA; 23 Jun 2011 09:21:25 -0000 Message-ID: <4E030591.6040709@codesourcery.com> Date: Thu, 23 Jun 2011 09:21:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110424 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: Pedro Alves CC: gdb-patches@sourceware.org Subject: Re: [patch] XFAIL gdb.cp/mb-inline.exp conditionaly References: <4DF8BEEF.5010308@codesourcery.com> <201106221638.30062.pedro@codesourcery.com> In-Reply-To: <201106221638.30062.pedro@codesourcery.com> Content-Type: multipart/mixed; boundary="------------060704050702050501090507" X-IsSubscribed: yes 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: 2011-06/txt/msg00335.txt.bz2 This is a multi-part message in MIME format. --------------060704050702050501090507 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-length: 1472 On 06/22/2011 11:38 PM, Pedro Alves wrote: > Why not do "info breakpoints", and parse the output, checking if > the breakpoint is really disabled? If it is not, no point issuing > the continue. Oh, yes. New patch is revised in this way. > The breakpoint was set by line number, and we're reloading > the session the same both times. Why does breakpoint 1.2 become > enabled (and I'm guessing that breakpoint 1.1 becomes disabled)? > No, in my case, both 1.1 and 1.2 becomes enabled. info break^M Num Type Disp Enb Address What^M 1 breakpoint keep y ^M breakpoint already hit 3 times^M 1.1 y 0xe78c90a8 in foo(int) at gdb/testsuite/gdb.cp/mb-inline.h:26^M 1.2 y 0xe78c91a8 in foo(int) at gdb/testsuite/gdb.cp/mb-inline.h:26^M During breakpoint updates (when inferior is re-created), GDB will iterate list of breakpoint locations, to look for breakpoint locations for a certain address in new inferior, and assign found breakpoint locations to that breakpoint. The state of breakpoint location (enabled/disabled) is kept, and this test will pass. If gdb is unable to find any breakpoint location for a given address, gdb will create new breakpoint locations, and remove old breakpoint location. Then, the state of breakpoint location of previous inferior is lost, and new created breakpoint location is enabled in default. OK for mainline? -- Yao (齐尧) --------------060704050702050501090507 Content-Type: text/x-patch; name="mb-inline-v2.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="mb-inline-v2.patch" Content-length: 1053 gdb/testsuite/ * gdb.cp/mb-inline.exp: Parse the output of `info break' to check breakpoint 1.2 is disabled. XFAIL for uclinux. diff --git a/gdb/testsuite/gdb.cp/mb-inline.exp b/gdb/testsuite/gdb.cp/mb-inline.exp index 86cb5ba..81f7460 100644 --- a/gdb/testsuite/gdb.cp/mb-inline.exp +++ b/gdb/testsuite/gdb.cp/mb-inline.exp @@ -101,7 +101,19 @@ gdb_expect { } } -gdb_continue_to_end "disabled breakpoint 1.2" +gdb_test_multiple "info break" "disabled breakpoint 1.2" { + -re "1\.2.* n .* at .*$hdrfile:$bp_location.*$gdb_prompt $" { + pass "disabled breakpoint 1.2" + } + -re "1\.2.* y .* at .*$hdrfile:$bp_location.*$gdb_prompt $" { + # When inferior is restarted, breakpoint locations will be updated. + # On uclinux, it is not guaranteed that new inferior is located the + # same address as previous one, so status/state of breakpoint location + # will loose. + setup_xfail "*-*-uclinux*" + fail "disabled breakpoint 1.2" + } +} # Make sure we can set a breakpoint on a source statement that spans # multiple lines. --------------060704050702050501090507--