From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6986 invoked by alias); 17 Feb 2006 20:20:53 -0000 Received: (qmail 6977 invoked by uid 22791); 17 Feb 2006 20:20:53 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Fri, 17 Feb 2006 20:20:52 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1FAC5v-0008BF-TI; Fri, 17 Feb 2006 15:20:48 -0500 Date: Fri, 17 Feb 2006 20:24:00 -0000 From: Daniel Jacobowitz To: Paul Koning Cc: eliz@gnu.org, ghost@cs.msu.su, gdb@sources.redhat.com Subject: Re: MI: reporting of multiple breakpoints Message-ID: <20060217202047.GC30881@nevyn.them.org> Mail-Followup-To: Paul Koning , eliz@gnu.org, ghost@cs.msu.su, gdb@sources.redhat.com References: <20060217153211.GA21402@nevyn.them.org> <20060217194426.GA28988@nevyn.them.org> <17398.11182.747232.774924@gargle.gargle.HOWL> <20060217200712.GB30145@nevyn.them.org> <17398.12047.624911.347942@gargle.gargle.HOWL> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17398.12047.624911.347942@gargle.gargle.HOWL> User-Agent: Mutt/1.5.8i X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-02/txt/msg00216.txt.bz2 On Fri, Feb 17, 2006 at 03:16:15PM -0500, Paul Koning wrote: > That's not the same case. I was going to say that both stops should > be reported even if they are at the SAME address, then decided against > that, as you did. > > But in the case we're talking about, you could have this source code: > > 421 foo=1; > 422 bar=2; > > I set a breakpoint on line 422, and a watchpoint on "foo". Clearly > those are very different -- line 422 doesn't touch foo, and the line > that touches foo isn't line 422. GDB should not confuse those two > things. If the hardware or GDB advances the PC across the watched > instruction, that's very well but that doesn't mean GDB should believe > the stop point is the instruction after. The stop point is the store > into foo, which isn't line 422. So? The user does "set $var = $pc" after hitting the breakpoint at bar. Then later they do jump *$var. They have every right (IMO) to expect that they are, once again, after the breakpoint at line 422, and that it won't be hit again - and even though you could make a good argument for the opposite case, this is how GDB has behaved for a long while. I think you'll encounter just as manage strange cases if you reverse it. Another way to think about it, if this helps. Right now you will not hit a GDB-requested event after "step" or "continue" without executing at least one instruction. You might be interrupted (by a trap instruction, an async signal, et cetera). But GDB will do its level best to step when you ask for a step, not hit a breakpoint that you've already noticed. -- Daniel Jacobowitz CodeSourcery