From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31862 invoked by alias); 2 Sep 2005 13:19:37 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 31670 invoked by uid 22791); 2 Sep 2005 13:18:59 -0000 Received: from zigzag.lvk.cs.msu.su (HELO zigzag.lvk.cs.msu.su) (158.250.17.23) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Fri, 02 Sep 2005 13:18:59 +0000 Received: from Debian-exim by zigzag.lvk.cs.msu.su with spam-scanned (Exim 4.50) id 1EBBRX-0005JS-D7 for gdb@sources.redhat.com; Fri, 02 Sep 2005 17:18:56 +0400 Received: from zigzag.lvk.cs.msu.su ([158.250.17.23]) by zigzag.lvk.cs.msu.su with esmtp (Exim 4.50) id 1EBBRP-0005J1-Jz; Fri, 02 Sep 2005 17:18:47 +0400 From: Vladimir Prus To: Daniel Jacobowitz Subject: Re: "info locals" -- is variable initialized Date: Fri, 02 Sep 2005 13:19:00 -0000 User-Agent: KMail/1.7.2 Cc: gdb@sources.redhat.com References: <20050902131321.GA12830@nevyn.them.org> In-Reply-To: <20050902131321.GA12830@nevyn.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200509021718.47151.ghost@cs.msu.su> X-SW-Source: 2005-09/txt/msg00015.txt.bz2 On Friday 02 September 2005 17:13, Daniel Jacobowitz wrote: > On Fri, Sep 02, 2005 at 01:53:41PM +0400, Vladimir Prus wrote: > > So, there's a window there variable does not exists according to C++, but > > exists according to gdb. > > With better debug information, this doesn't happen (or the window is > reduced to an instruction or two in the call sequence for the > constructor). GCC 4's variable tracking feature does this passably > well, IIRC, by use of dwarf2 location lists. Do I need for extra flags for gcc? I've tried with gcc-4.0 before posting the message, and it did printed all vars. > In general no there is nothing gdb can do. How about using decl_line. Here's what debug info says <2><2188c>: Abbrev Number: 140 (DW_TAG_variable) DW_AT_name : url DW_AT_decl_file : 1 DW_AT_decl_line : 14 DW_AT_type : <1d555> DW_AT_location : 3 byte block: 91 98 7f (DW_OP_fbreg: -104) If gdb could tell the value of 'decl_line' via some command, that might be a good approximation. - Volodya