From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28907 invoked by alias); 16 Apr 2002 21:58:49 -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 28900 invoked from network); 16 Apr 2002 21:58:48 -0000 Received: from unknown (HELO nevyn.them.org) (128.2.145.6) by sources.redhat.com with SMTP; 16 Apr 2002 21:58:48 -0000 Received: from drow by nevyn.them.org with local (Exim 3.35 #1 (Debian)) id 16xayl-0001ml-00; Tue, 16 Apr 2002 17:59:11 -0400 Date: Tue, 16 Apr 2002 14:58:00 -0000 From: Daniel Jacobowitz To: Jim Blandy Cc: gdb@sources.redhat.com Subject: Re: C++ nested classes, namespaces, structs, and compound statements Message-ID: <20020416175911.A6603@nevyn.them.org> Mail-Followup-To: Jim Blandy , gdb@sources.redhat.com References: <20020406044204.245E45EA11@zwingli.cygnus.com> <20020406013408.A4570@nevyn.them.org> <20020408214935.A14098@nevyn.them.org> <20020410150824.A22581@nevyn.them.org> <20020412195613.C11562@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.23i X-SW-Source: 2002-04/txt/msg00275.txt.bz2 On Tue, Apr 16, 2002 at 04:46:27PM -0500, Jim Blandy wrote: > > Daniel Jacobowitz writes: > > > Okay, I think I see. You're preserving the distinctions implicit in > > > the existing structures (fields and symbols are separate), > > > distinguishing types from symbols (i.e. an entry for a typedef would > > > be an environment_entry whose kind == type_kind, instead of a symbol > > > with an address class of LOC_TYPEDEF), and positing that namespaces > > > would be a fourth kind of thing. The `data' field would point to a > > > `struct type' or a `struct field', or whatever. > > > > Yes, that's right. There's also transparent scopes (which might be a > > special kind of namespace... or not). By that I mean {} enclosed > > regions with their own local variables. A function belongs to a > > namespace, a namespace does not enclose a particular range of PCs - but > > a scope does enclose a particular PC range. Hopefully but not > > necessarily a single contiguous range. Optimization or explicit > > .section directives could break it up. > > At the moment GDB assumes they're contiguous. (Of course.) Dwarf 3 > allows one to describe lexical blocks that occupy discontinuous > address ranges, but we don't read that. (Of course.) Of course :) > But why would lexical blocks occur in an environment? They don't > generally have names. Functions do, but I would say a function "has > a" lexical block, rather than saying it "is a" lexical block. A function can have local types (in GNU C, and possibly in standard C++, etc.). It also contains lexical blocks with no names. int foo() { typedef int x; return (x) 1; } The type 'x' is local to foo() in this example. The DWARF-2 information supports this interpretation. -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer