From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18385 invoked by alias); 31 Dec 2006 02:19:58 -0000 Received: (qmail 18376 invoked by uid 22791); 31 Dec 2006 02:19:58 -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; Sun, 31 Dec 2006 02:19:50 +0000 Received: from drow by nevyn.them.org with local (Exim 4.63) (envelope-from ) id 1H0qId-0000E0-Qw; Sat, 30 Dec 2006 21:19:47 -0500 Date: Sun, 31 Dec 2006 02:19:00 -0000 From: Daniel Jacobowitz To: Nick Roberts Cc: gdb-patches@sources.redhat.com Subject: Re: MI: Another -var-update bug? [PATCH] Message-ID: <20061231021947.GA719@nevyn.them.org> Mail-Followup-To: Nick Roberts , gdb-patches@sources.redhat.com References: <17790.36044.454650.114329@kahikatea.snap.net.nz> <17791.40309.90872.126841@kahikatea.snap.net.nz> <20061230150650.GB15107@nevyn.them.org> <17814.60022.564828.19567@kahikatea.snap.net.nz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17814.60022.564828.19567@kahikatea.snap.net.nz> User-Agent: Mutt/1.5.13 (2006-08-11) 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: 2006-12/txt/msg00382.txt.bz2 On Sun, Dec 31, 2006 at 11:38:46AM +1300, Nick Roberts wrote: > Currently variable objects consider a variable to be back in scope if a > frame is re-entered. Hmm. Interesting... not sure if that's the most useful behavior - frame re-entrance is a matter of a great deal of luck. > > Since baz can't see i or j, it's legitimate for the compiler to move > > the call to baz up to right after the call to bar. > > That sounds like some kind of optimisation. Does this happen with -O0? Probably not, but it would be up to the compiler. > > Then we'll appear > > to "leave" the block and "re-enter" it after another step. > > Entering another function doesn't take existing variables out of scope > does it? Block addresses are measured against the PC of the frame that > the variable is defined in. That's not what I meant by leaving the block. We'll appear to execute a line inside the block, a line outside the block (from the same function), and then a line inside the block again. But I guess this is not much different from calling a function, right? > I can't speak for others but in Emacs I just use a grey font for variables that > go out of scope and leave it to the user to explicily delete them. The worst > scenario, if there is a problem at all, is that the watch expression would be > inexplicably greyed for one step. Good, that's not bad at all. If Vlad doesn't think this is likely to break kdevelop or Eclipse, the patch is OK. -- Daniel Jacobowitz CodeSourcery