From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1638 invoked by alias); 24 Oct 2006 17:41:19 -0000 Received: (qmail 1629 invoked by uid 22791); 24 Oct 2006 17:41:18 -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; Tue, 24 Oct 2006 17:41:05 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1GcQGm-0003td-N3; Tue, 24 Oct 2006 13:40:56 -0400 Date: Tue, 24 Oct 2006 17:41:00 -0000 From: Daniel Jacobowitz To: Eli Zaretskii Cc: jimb@codesourcery.com, rodney.bates@wichita.edu, gdb@sourceware.org Subject: Re: breakpoint for accessing memory location Message-ID: <20061024174056.GA14740@nevyn.them.org> Mail-Followup-To: Eli Zaretskii , jimb@codesourcery.com, rodney.bates@wichita.edu, gdb@sourceware.org References: <453A6D1D.1080009@wichita.edu> <453B8C22.3010206@wichita.edu> <20061022172431.GA15887@nevyn.them.org> <20061024125708.GA4762@nevyn.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.13 (2006-08-11) 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-10/txt/msg00229.txt.bz2 On Tue, Oct 24, 2006 at 01:36:52PM -0400, Eli Zaretskii wrote: > > Date: Tue, 24 Oct 2006 08:57:09 -0400 > > From: Daniel Jacobowitz > > Cc: Jim Blandy , rodney.bates@wichita.edu, > > gdb@sourceware.org > > > > > > Does the debug info tell us enough to do that? > > > > Sometimes, but not reliably. > > If so, I don't think GDB can do better than we do now, since only the > compiler knows the true scope of a variable. Right? We can work out the scope from the debug info, in most cases; I was thinking about the wrong data in my previous message. But it's not clear what we can _do_ with it. DWARF-2 represents the PC ranges of lexical blocks at the source level. You can see exactly where a variable ought to be in scope from that. But unless you confine yourself to single-stepping, you won't know when you leave that range. You can't set a breakpoint at the end of it, because it may contain jumps. > > Another problem with watchpoints is that we don't support any kind of > > location lists for local variables > > Again, does the debug info include such location lists? Yes. It may say "0x4-0x12 var in %eax, 0x12-0x40 var in 8(%ebp), otherwise var has no value". -- Daniel Jacobowitz CodeSourcery