From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4508 invoked by alias); 11 Oct 2011 15:22:28 -0000 Received: (qmail 4499 invoked by uid 22791); 11 Oct 2011 15:22:26 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 11 Oct 2011 15:22:09 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=EU1-MAIL.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1RDe9e-0005Fj-HX from pedro_alves@mentor.com ; Tue, 11 Oct 2011 08:22:06 -0700 Received: from scottsdale.localnet ([172.16.63.104]) by EU1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 11 Oct 2011 16:21:54 +0100 From: Pedro Alves To: Tom Tromey Subject: Re: some questions about ranged breakpoints Date: Tue, 11 Oct 2011 15:22:00 -0000 User-Agent: KMail/1.13.6 (Linux/2.6.38-11-generic; KDE/4.7.1; x86_64; ; ) Cc: gdb@sourceware.org References: <201110111110.49848.pedro@codesourcery.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201110111621.53167.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2011-10/txt/msg00058.txt.bz2 On Tuesday 11 October 2011 15:50:21, Tom Tromey wrote: > >>>>> "Pedro" == Pedro Alves writes: > > Tom> What should actually happen here? > > Pedro> I think we should remove the assertion, and have each location map to a > Pedro> hardware accelerated ranged breakpoint, instead of assuming there can > Pedro> be only one. This isn't much different from creating a regular > Pedro> (non-range) hardware breakpoint that ends up mapping to more than > Pedro> one location. > > Ok, that makes sense, but unfortunately I think it yields other weird > behavior. The problem is that you must somehow pair start and end > locations; you might even see more of one than the other. Gross, you're right. > I thought that pairing could perhaps be done by sorting the addresses > and, for each address in the first list, choose the nearest greater > address from the second list. However, my worry with any heuristic like > this is that a re-set could cause the breakpoint to change in an > unforseen way, yielding wrong results for the user. > > Also the parsing is a pain when you have multiple matches. > Consider the difference between a relative linespec (break-range > file.c:73, +5) and an absolute one (break-range file.c:73, file.c:78). > We don't know before parsing whether a linespec is relative. > So, I think we have to reparse the second linespec in the context of > each result from the first linespec, then eliminate dups... gross, but I > guess doable. Hmm, that's sounding too complicated and hard to both explain and understand, and probably ends up not being useful... I'm liking your "deactivate if resetting introduces ambiguity" idea more. I think we'll still need to handle multiple locations though, though I'm not familiar with your code enough to be know how to express it in a way that makes the ambiguity a different kind of ambiguity (or if it's expressable even) from the inline cases. E.g., if you're debugging two inferiors, "file.c:73, +5", may mean different addresses for each inferior, just because they loaded the code at different addresses. But for each inferior, or each objfile, "file.c:73, +5" was not ambiguous, so I'd expect to end with two range locations, one for each inferior or objfile. -- Pedro Alves