Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Re: new demangler
@ 2003-12-15 23:16 Michael Elizabeth Chastain
  0 siblings, 0 replies; 18+ messages in thread
From: Michael Elizabeth Chastain @ 2003-12-15 23:16 UTC (permalink / raw)
  To: carlton, ian; +Cc: gdb

Works for me with c++filt.

  [mec.gnu@berman migdmt]$ /berman/migchain/install/target/native/binutils-2.14/bin/c++filt _ZN1C6CClassaSERKS0_
  C::CClass::operator=(C::CClass const&)

  [mec.gnu@berman migdmt]$ echo _ZN1C6CClassaSERKS0_ | /berman/migchain/install/target/native/binutils-2.14/bin/c++filt
  C::CClass::operator=(C::CClass const&)

  [mec.gnu@berman migdmt]$ /berman/fsf/_current_/berman/install/target/native/binutils/HEAD/bin/c++filt _ZN1C6CClassaSERKS0_
  C::CClass::operator=(C::CClass const&)

  [mec.gnu@berman migdmt]$ echo _ZN1C6CClassaSERKS0_ | /berman/fsf/_current_/berman/install/target/native/binutils/HEAD/bin/c++filt
  C::CClass::operator=(C::CClass const&)

One problem with talking about "the demangler" is that the options
parameter is different when the demangler is invoked in different ways.
c++filt uses different options for command line versus standard input,
and gdb specifies different options in different places.

Can you breakpoint cp_demangle inside gdb and see what's going on?

Michael C


^ permalink raw reply	[flat|nested] 18+ messages in thread
* Re: new demangler
@ 2003-12-18  4:04 Michael Elizabeth Chastain
  0 siblings, 0 replies; 18+ messages in thread
From: Michael Elizabeth Chastain @ 2003-12-18  4:04 UTC (permalink / raw)
  To: drow, jimb; +Cc: carlton, gdb

Jim Blandy writes:
> When working on big C++ programs, I think I remember seeing that the
> mangled and demangled names take up a *lot* of memory.

I analyzed this recently.

  http://sources.redhat.com/ml/gdb/2003-12/msg00071.html
  http://sources.redhat.com/ml/gdb/2003-12/msg00092.html

One specific thinko caused a lot of trouble for monotone, which is built
with the boost libraries.  But mozilla does not have any symbols which
were affected by this bug, so memory size on mozilla probably didn't get
any better with this bug fix.

The new demangler has the same memory requirement has old demangler +
bug fix (46 megabytes on monotone).  But the new demangler runs a lot
faster.  Check out the difference in elapsed time between "H21" and
"H30" in my table.  gdb with old demangler + bug fix starts up in 9.46
seconds, and gdb with new demangler starts up in 3.03 seconds.

> 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.

How about quantifying gdb performance (space and time) on a real
program first.  There might not be a problem at all.  Then look for some
low-hanging fruit before pulling out the algorithmic guns.

Michael C


^ permalink raw reply	[flat|nested] 18+ messages in thread
* Re: new demangler
@ 2003-12-15 23:55 Michael Elizabeth Chastain
  0 siblings, 0 replies; 18+ messages in thread
From: Michael Elizabeth Chastain @ 2003-12-15 23:55 UTC (permalink / raw)
  To: carlton, ian; +Cc: gdb

dc> Thanks!  Now, when I demangle that name with just DMGL_ANSI, I get
dc> "C::CClass::operator=".  Am I going crazy, or was there once '()'
dc> stuck on the end of that?

There used to be '()' stuck on the end of the output with DMGL_ANSI,
maybe with parameters between them, maybe not (I dunno).

Here are relevant PR's:

  http://sources.redhat.com/gdb/bugs/1471
  http://sources.redhat.com/gdb/bugs/34

Michael C


^ permalink raw reply	[flat|nested] 18+ messages in thread
* new demangler
@ 2003-12-15 22:53 David Carlton
  2003-12-15 22:54 ` Daniel Jacobowitz
  0 siblings, 1 reply; 18+ messages in thread
From: David Carlton @ 2003-12-15 22:53 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gdb

I just tried to merge my GDB branch with the current sources, and I'm
running into problems that seem to be caused by the new demangler.
Specifically, it doesn't seem to like "_ZN1C6CClassaSERKS0_", which
the old demangler claims is "C::CClass::operator=(C::CClass const&)".

David Carlton
carlton@kealia.com


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2003-12-18 16:01 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-15 23:16 new demangler Michael Elizabeth Chastain
  -- strict thread matches above, loose matches on Subject: below --
2003-12-18  4:04 Michael Elizabeth Chastain
2003-12-15 23:55 Michael Elizabeth Chastain
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
2003-12-18 16:01                           ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox