From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21800 invoked by alias); 26 Nov 2003 21:12:33 -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 21793 invoked from network); 26 Nov 2003 21:12:32 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 26 Nov 2003 21:12:32 -0000 Received: from drow by nevyn.them.org with local (Exim 4.24 #1 (Debian)) id 1AP6xZ-0006zO-B6; Wed, 26 Nov 2003 16:12:29 -0500 Date: Wed, 26 Nov 2003 21:12:00 -0000 From: Daniel Jacobowitz To: Ian Lance Taylor Cc: gdb Subject: Re: C++/Java regressions Message-ID: <20031126211228.GA13423@nevyn.them.org> Mail-Followup-To: Ian Lance Taylor , gdb References: <20031126153234.GA10644@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.1i X-SW-Source: 2003-11/txt/msg00264.txt.bz2 On Wed, Nov 26, 2003 at 04:04:55PM -0500, Ian Lance Taylor wrote: > Daniel Jacobowitz writes: > > > On Tue, Nov 25, 2003 at 11:04:41PM -0500, Ian Lance Taylor wrote: > > > Then when gdb goes to look up T5, it finds the DWARF psymbol for > > > the class itself, but it also finds that the symbol might be a > > > namespace. It then decides that it is a namespace. > > > > That sounds like the bit that's wrong. If it found a psymbol for the > > class why does it decide to call it a namespace? > > Good question. My guess is that it's because lookup_symbol_aux() > calls current_language->la_lookup_symbol_nonlocal() before it calls > lookup_symbol_aux_psymtabs(). If I force la_lookup_symbol_nonlocal() > to return NULL, then lookup_symbol_aux_psymtabs() finds the typedef, > and `ptype T5' works more or less correctly. > > One solution might be that when gdb finds that a symbol has a class > definition, it makes sure that it does not have a pseudo-namespace > definition. The pseudo-namespaces are always supposed to be shadowed by symbols. >From your explanation it looks like they're shadowing psymbols; but since psymbols are supposed to behave identically to symbols (that's the whole point), something is wrong. I'll look at it if I get a chance before David Carlton does; this is originally his code. Thanks for the investigation. > > I'm considering a routine for canonicalization of C++ demangled names. > > If it helps, that's more or less what my libiberty C++ demangler does. > It first translate the name into a simple tree structure, and then > walks the tree translating it into a string. I could expose the tree, > although it would have to be documented a bit better. Oh, so it's already two-pass? If we could work out an API for the tree, then GDB could build and supply trees to get a canonical form back from the demangler. That has the added bonus of not needing to post-process the demangler output (if we know that we've got a GNU v3 name and thus this demangler was used, of course - v2 would still need to be parsed). That sounds like an ideal solution. Do you have an opinion on the "A::bar const" DMGL_PARAMS issue that Michael Chastain noticed, by the way? -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer