From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9937 invoked by alias); 4 Oct 2002 22:10:45 -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 9927 invoked from network); 4 Oct 2002 22:10:44 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 4 Oct 2002 22:10:44 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 17xbaa-0000be-00 for ; Fri, 04 Oct 2002 18:10:32 -0500 Received: from drow by nevyn.them.org with local (Exim 3.35 #1 (Debian)) id 17xafF-0005ZI-00 for ; Fri, 04 Oct 2002 18:11:17 -0400 Date: Fri, 04 Oct 2002 15:10:00 -0000 From: Daniel Jacobowitz To: gdb Subject: Re: current namespace game plan Message-ID: <20021004221117.GA21018@nevyn.them.org> Mail-Followup-To: gdb References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.1i X-SW-Source: 2002-10/txt/msg00046.txt.bz2 On Fri, Oct 04, 2002 at 02:57:32PM -0700, David Carlton wrote: > I've been tossing around namespace ideas in my head for a while, and > they're starting to converge on a game plan that makes sense to me; I > wanted to run it by other people. Feel free to skip the parts of this > message starting with "So that's the first step". > > > The initial goal is to have GDB work about as well as it does now, > with the addition that lookup of global symbols will be more likely to > find symbols in namespaces where appropriate (and where the compiler > provides enough debugging information). There are a few ways that you > can add namespaces that should be searched during symbol lookup: > > * By explicit 'using' directives. > * By anonymous namespaces. > * By looking at what namespace the current function is defined in. > * By looking at the arguments of a function that you're trying to > call. You're skipping what I'd consider the most important step. We can't even get namespaces right when the user gives us a fully qualified name. We do it for variables and functions by resorting to the minsym and physname. But types? No way. They all get entered in the top level. Same thing for types in other types. We need: - DWARF-2 namespace support in the reader which is very easy, both Dan Berlin and I have working code for this - DWARF-2 namespace support in GCC which Dan Berlin has done, awaiting the GDB support - Inference support in both DWARF-2 and Stabs readers; I have the prototypes of this all done. We can correctly infer a type's full name for everything but enums, I believe. And: - Code to not print excessive qualification on names, for instance printing the fully qualified type in constructors; it's ugly and causes needless testsuite churn. What I really should do is bundle up what I have onto a branch. If I feel inspired enough I'll try to do it tomorrow. The last point caused me to stop and focus on type printing and type correctness for a bit, and I got completely sidetracked; a branch would help a lot. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer