From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1271 invoked by alias); 28 Dec 2010 11:26:00 -0000 Received: (qmail 1246 invoked by uid 22791); 28 Dec 2010 11:25:59 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,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; Tue, 28 Dec 2010 11:25:54 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 309A22BABB7 for ; Tue, 28 Dec 2010 06:25:53 -0500 (EST) 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 Gqe76XCXZxFd for ; Tue, 28 Dec 2010 06:25:53 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id A83A02BAB67 for ; Tue, 28 Dec 2010 06:25:52 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 9CB4A145870; Tue, 28 Dec 2010 15:25:46 +0400 (RET) Date: Tue, 28 Dec 2010 11:50:00 -0000 From: Joel Brobecker To: gdb-patches@sourceware.org Subject: Re: [RFA] unexpected multiple location for breakpoint Message-ID: <20101228112546.GB2436@adacore.com> References: <1290474625-1582-1-git-send-email-brobecker@adacore.com> <20101126172942.GK2634@adacore.com> <20101127183532.GA10136@caradoc.them.org> <20101210122337.GC2596@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101210122337.GC2596@adacore.com> 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-12/txt/msg00505.txt.bz2 > So, if I understand you well, you suggest that we rework a bit the > "contained-in" elimination loop to avoid lowest-address assumptions. > If 2 different PCs are inside the same block, then keep the lowest > address. If PC1 is in BLOCK1 and PC2 in BLOCK2, and BLOCK2 is contained > in BLOCK1, then PC2 should be discarded, even if PC2 > PC1. (and > if the blocks are distinct, then keep both PCs). Answering myself, I have another situation, which is a bit unrelated, but could still be interesting in this discussion: The source itself is a while loop 52. while CONDITION loop 53. Do_Something (...); [some other code] 71. delay Random_Time; 72. end loop; We are trying to break on line 53. This source was compiled at -O1, and part of line 53 got hoisted outside of the actual loop. The rest of line 53 is scattered around the rest of the code in the actual loop. Something like this: // line 53 [...] // line 56, 62 [...] //line 53: cmp ... .LL40: [...] // line 53: [...] (snip) // end of loop cmp ... jmpne .LL40 As a user, we're expecting the debugger to stop on line 53 at every iteration. But because we only break on the first instance of line 53, and because that first instance is outside the actual loop, we end up stopping only once. (there are some lexical blocks in the assembly code I'm looking at, but nothing significant to line 53, I believe). According to you, bug or feature? >From a user's perspective, I think it is hard to accept this as normal or expected, since a few "next" operations instead of a "continue" shows that the debugger gets back to line 53 several times during the loop execution. If this is a bug, then the only solution I can think of is inserting a breakpoint at *every* instances of line 53, regardless of lexical-block relationships. Thoughts? -- Joel