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: Jim Blandy <jimb@redhat.com>, David Carlton <carlton@kealia.com>,
	gdb <gdb@sources.redhat.com>
Subject: Re: new demangler
Date: Thu, 18 Dec 2003 05:21:00 -0000	[thread overview]
Message-ID: <20031218052122.GA7319@nevyn.them.org> (raw)
In-Reply-To: <m38ylau90q.fsf@gossamer.airs.com>

On Wed, Dec 17, 2003 at 09:58:29PM -0500, Ian Lance Taylor wrote:
> Jim Blandy <jimb@redhat.com> writes:
> 
> > Daniel Jacobowitz <drow@mvista.com> writes:
> > > When I can figure out a few more points of C++ grammar - it's taken me
> > > a *(!&#@ month so far and it's barely functional... - I'll have an
> > > efficient solution for breaking down names into the demangler's trees. 
> > > This will let us get the information we want much more reliably.
> > 
> > When working on big C++ programs, I think I remember seeing that the
> > mangled and demangled names take up a *lot* of memory.
> > 
> > If that recollection is correct, it might be cool to have GDB store
> > the trees instead of the names, and throw a bcache at the nodes in
> > these demangled name trees, working from the leaves upward, to get
> > maximum sharing.  I bet that would bring the memory requirements down
> > to something more closely resembling the actual number of classes,
> > methods, etc. in the program.

I don't know how well it would work compared to simply cutting down on
the number of demangled names we need in memory.  Specifically, instead
of one symbol table with fully qualified names, lots of little
dictionaries with the names of members.

> > I think the trees would be a lot easier to do certain kinds of
> > matching on, too.  "Is this a user-defined cast operator?"
> 
> Tangentially, note that the trees that I wrote for the demangler are
> based pretty directly on the mangling ABI.  They just follow the
> grammar productions used there.
> 
> To use them for anything other than demangling, it might be useful to
> try to work out a good tree representation for C++ names.  Then I or
> somebody can modify the demangler to use that tree representation
> instead.  It would probably be pretty close to the trees I use, but I
> doubt it would be identical.

So far, simply using yours hasn't been a problem.  A few of my rules
are a little awkward, but compared to the hacks normally found in yacc
grammars it's a downright beauty.

Was anything ever decided about conversion operators and typeof()?

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


  reply	other threads:[~2003-12-18  5:21 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-15 22:53 David Carlton
2003-12-15 22:54 ` Daniel Jacobowitz
2003-12-15 23:01   ` David Carlton
2003-12-15 23:10     ` Ian Lance Taylor
2003-12-15 23:17       ` David Carlton
2003-12-15 23:20         ` Ian Lance Taylor
2003-12-15 23:23           ` Ian Lance Taylor
2003-12-15 23:29             ` David Carlton
2003-12-15 23:33               ` Ian Lance Taylor
2003-12-15 23:38                 ` David Carlton
2003-12-16  5:30                   ` Daniel Jacobowitz
2003-12-18  2:22                     ` Jim Blandy
2003-12-18  2:58                       ` Ian Lance Taylor
2003-12-18  5:21                         ` Daniel Jacobowitz [this message]
2003-12-18 16:01                           ` Ian Lance Taylor
2003-12-15 23:16 Michael Elizabeth Chastain
2003-12-15 23:55 Michael Elizabeth Chastain
2003-12-18  4:04 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=20031218052122.GA7319@nevyn.them.org \
    --to=drow@mvista.com \
    --cc=carlton@kealia.com \
    --cc=gdb@sources.redhat.com \
    --cc=ian@wasabisystems.com \
    --cc=jimb@redhat.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