Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@mvista.com>
To: Ian Lance Taylor <ian@wasabisystems.com>
Cc: gdb <gdb@sources.redhat.com>
Subject: Re: C++/Java regressions
Date: Wed, 26 Nov 2003 21:12:00 -0000	[thread overview]
Message-ID: <20031126211228.GA13423@nevyn.them.org> (raw)
In-Reply-To: <m3r7zusux4.fsf@gossamer.airs.com>

On Wed, Nov 26, 2003 at 04:04:55PM -0500, Ian Lance Taylor wrote:
> Daniel Jacobowitz <drow@mvista.com> writes:
> 
> > On Tue, Nov 25, 2003 at 11:04:41PM -0500, Ian Lance Taylor wrote:
> > > Then when gdb goes to look up T5<int>, 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<int>' 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


  parent reply	other threads:[~2003-11-26 21:12 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-25  1:37 David Carlton
2003-11-25  1:48 ` The demangler was rewritten from scratch! Andrew Cagney
2003-11-25  3:58 ` C++/Java regressions Ian Lance Taylor
2003-11-26  4:04 ` Ian Lance Taylor
2003-11-26 15:32   ` Daniel Jacobowitz
2003-11-26 21:05     ` Ian Lance Taylor
2003-11-26 21:11       ` David Carlton
2003-11-26 21:12       ` Daniel Jacobowitz [this message]
2003-11-26 21:32         ` Ian Lance Taylor
2003-12-01 16:45           ` Daniel Jacobowitz
2003-11-30  2:57         ` Jim Blandy
2003-11-30  3:12           ` Daniel Jacobowitz
2003-11-25  4:44 Michael Elizabeth Chastain
2003-11-25 17:54 ` Ian Lance Taylor
2003-11-25 14:49 Michael Elizabeth Chastain
2003-11-25 15:06 ` Daniel Jacobowitz
2003-11-25 15:33 Michael Elizabeth Chastain
2003-11-25 17:06 Michael Elizabeth Chastain
2003-11-25 17:14 ` David Carlton
2003-11-25 17:59   ` Daniel Jacobowitz
2003-11-26 21:18 Michael Elizabeth Chastain
2003-11-26 21:33 ` Ian Lance Taylor
2003-11-26 21:44 Michael Elizabeth Chastain
2003-11-26 22:21 ` Ian Lance Taylor
2003-11-26 22:28   ` Daniel Jacobowitz
2003-11-26 22:34     ` Ian Lance Taylor
2003-11-26 22:48 Michael Elizabeth Chastain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20031126211228.GA13423@nevyn.them.org \
    --to=drow@mvista.com \
    --cc=gdb@sources.redhat.com \
    --cc=ian@wasabisystems.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox