Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Re: Slow handling of C++ symbol names
@ 2003-12-03 20:27 Michael Elizabeth Chastain
  2003-12-03 20:35 ` Ian Lance Taylor
  0 siblings, 1 reply; 29+ messages in thread
From: Michael Elizabeth Chastain @ 2003-12-03 20:27 UTC (permalink / raw)
  To: ian; +Cc: gdb, wcohen

As far as DMGL_VERBOSE and other DMGL_* options go, I am actually just
running two versions of c++filt with no special options and then
comparing the results.  So I am not covering the layer of software where
gdb uses different DMGL_* options.

A little grep fu says that gdb uses combinations of:

  DMGL_NO_OPTS
  DMGL_ANSI
  DMGL_ARM
  DMGL_JAVA
  DMGL_PARAMS

Michael C


^ permalink raw reply	[flat|nested] 29+ messages in thread
* Re: Slow handling of C++ symbol names
@ 2003-12-03 22:30 Michael Elizabeth Chastain
  0 siblings, 0 replies; 29+ messages in thread
From: Michael Elizabeth Chastain @ 2003-12-03 22:30 UTC (permalink / raw)
  To: cagney, mec.gnu; +Cc: drow, gdb, ian

 Here is a new table:

   gdb  memory  utime  stime  elapsed
   5.3    263M  85.47  26.80   189.68
   6.0    264M  83.76  26.08   187.90
   H19    263M  83.44  25.99   190.00
   H21     46M   7.37   2.07     9.46
   H30     46M   2.72   0.29     3.03

H19 is gdb HEAD 2003-11-19 16:00:00 UTC.
This has the exact same demangler as gdb 6.0 (modulo comments).

H21 is gdb HEAD 2003-11-21 17:00:00 UTC.
This has the old demangler with two bug-fix patches.

H01 is gdb HEAD 2003-11-30 06:08:24 UTC.
This is the new demangler.

Nothing happened to performance from 5.3 to 6.0 or from 6.0 to H19.

Something happened between H19 and H21.  So I did:

  cvs diff -u -D "2003-11-19 16:00:00 UTC" -D "2003-11-21 17:00:00 UTC"

This gives about 2000 lines of changes from H19 to H21, very manageable.
Nothing changed in gdb c++ support.  All the good changes were in
libiberty/cp-demangle.c.  So I believe the bug fixes in the old
demangler were very effective.  Either that, or they introduced new bugs
which cause gdb to get to its first prompt a lot sooner.

Something happened from H19 to H30.  I don't know if it's
gdb or the demangler, but I'm inclined to credit the demangler.

Michael C


^ permalink raw reply	[flat|nested] 29+ messages in thread
* Re: Slow handling of C++ symbol names
@ 2003-12-03 20:17 Michael Elizabeth Chastain
  0 siblings, 0 replies; 29+ messages in thread
From: Michael Elizabeth Chastain @ 2003-12-03 20:17 UTC (permalink / raw)
  To: cagney, mec.gnu; +Cc: drow, gdb, ian

Crap, I thought my timeline looked funny!
Try moving some of those 2003-08-XX to 2003-11-XX:

  2003-05-03  Fix typo in "std::basic_istream ... char_traints ..." [sic] 
  2003-08-12  Fix license (no code change)
  2003-11-19  Some bug fixes to old demangler by ILT
  2003-11-20  Another ILT bug fix to old demangler
  2003-11-21  New demangler

Michael C


^ permalink raw reply	[flat|nested] 29+ messages in thread
* Re: Slow handling of C++ symbol names
@ 2003-12-03 20:14 Michael Elizabeth Chastain
  0 siblings, 0 replies; 29+ messages in thread
From: Michael Elizabeth Chastain @ 2003-12-03 20:14 UTC (permalink / raw)
  To: cagney; +Cc: drow, gdb, ian

mec> Here are some memory usage and time numbers.
mec> 
mec>   gdb   memory  utime  stime  elapsed
mec>   5.3   263M    84.79  26.52  185.92
mec>   6.0   263M    83.17  26.45  181.04
mec>  HEAD    43M     2.78   0.27    3.23
mec> 
mec> gdb HEAD is from '2003-11-30 06:08:24 UTC'.

ac> Michael, not to overload you but would it also be possible to do the 
ac> numbers on a just-before-new-mangler-mainline?

Yeah, that's pretty straightforward.

Here's a timeline on cp-demangle.c (times are from the src/ archive).

  2003-05-03  Fix typo in "std::basic_istream ... char_traints ..." [sic] 
  2003-08-12  Fix license (no code change)
  2003-08-19  Some bug fixes to old demangler by ILT
  2003-08-20  Another ILT bug fix to old demangler
  2003-08-21  New demangler

So I'll do:

  gdb HEAD 2003-11-19 16:00:00 UTC
  which is just before the bug fixes of the old demangler,
  
  gdb HEAD 2003-11-21 17:00:00 UTC
  which is just before the new demangler appeared in src

Michael C


^ permalink raw reply	[flat|nested] 29+ messages in thread
* Re: Slow handling of C++ symbol names
@ 2003-12-03 19:57 Michael Elizabeth Chastain
  2003-12-03 20:16 ` Daniel Jacobowitz
  0 siblings, 1 reply; 29+ messages in thread
From: Michael Elizabeth Chastain @ 2003-12-03 19:57 UTC (permalink / raw)
  To: drow, ian; +Cc: gdb

ilt> Everything makes sense to me and I get the results I expect.

That's good enough for me.  I don't care much about the verbosity.
My problem is: I've got 20,000 mangled names, and they demangle
to 250 megabytes of text, and I want to find real bugs like the
"operator< <" versus "operator <<" bug.

It's a big needle-in-haystack problem.  I'm messing around with
a Perl script that helps sort out the haystack.  After "monotone",
I'd like to run it on mangled names from cygwin and mozilla and
open-office too.

Michael C


^ permalink raw reply	[flat|nested] 29+ messages in thread
* Re: Slow handling of C++ symbol names
@ 2003-12-03 16:48 Michael Elizabeth Chastain
  2003-12-03 16:52 ` David Carlton
  2003-12-03 16:58 ` Ian Lance Taylor
  0 siblings, 2 replies; 29+ messages in thread
From: Michael Elizabeth Chastain @ 2003-12-03 16:48 UTC (permalink / raw)
  To: ian, mec.gnu; +Cc: ac131313, drow, gdb, wcohen

Ian Lance Taylor writes:
> Could you extract a few of the larger demangled names from each version,
> and post them?  It might be a good double-check that something isn't
> weirdly broken.

I'm working on it.

I'm writing a Perl script to pass each name through both demanglers,
strip the differences, and compare the results.  There are a lot of
picky differences to account for.

So far I've found one type of difference that looks like a bug in the
new demangler.

  _ZStltI9file_pathSsEbRKSt4pairIT_T0_ES6_
  OLD: bool std::operator< <file_path, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::pair<file_path, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > const&, std::pair<file_path, std::basic_string<char, > std::char_traits<char>, std::allocator<char> > > const&)
  NEW: bool std::operator<<file_path, std::string>(std::pair<file_path, std::string> const&, std::pair<file_path, std::string> const&)

The old demangler produces "operator< <", and the new demangler produces
"operator <<".  I'm not a name mangling expert but I think that
"operator <" is correct here and the new demangler suffers from
shift-operator-versus-template-syntax gotcha.

Also, why do you want the demangled names?  I would think you would
have the same old+new demanglers that I do, so that the mangled names
would suffice.  My reason is that the mangled names which are different
amount to 3 megabytes or so, but the demangled names which are different
amount to 300 megabytes or so.

Michael C


^ permalink raw reply	[flat|nested] 29+ messages in thread
* Re: Slow handling of C++ symbol names
@ 2003-12-02 22:38 Michael Elizabeth Chastain
  0 siblings, 0 replies; 29+ messages in thread
From: Michael Elizabeth Chastain @ 2003-12-02 22:38 UTC (permalink / raw)
  To: ian, mec.gnu; +Cc: ac131313, drow, gdb, wcohen

> Could you extract a few of the larger demangled names from
> each version, and post them?  It might be a good double-check that
> something isn't weirdly broken.  It would be nice to have the mangled
> symbol name too, but not critical.

Actually the demangled names are too big to post!

How about if I extract all the mangled names and put up a tarball?
I'll get some representative demangled names from each version too.
I gotta write Perl just to process these things, I can't open up
a 250 megabyte file in any text editor on my 128 megabyte laptop!

(I am going out dancing tonight, back in 6 hours or so.  If you are
 really impatient you could grab Will Cohen's original binary from
 that URL).

Michael C


^ permalink raw reply	[flat|nested] 29+ messages in thread
* Re: Slow handling of C++ symbol names
@ 2003-12-02 22:09 Michael Elizabeth Chastain
  2003-12-02 22:23 ` Ian Lance Taylor
  2003-12-03 18:52 ` Andrew Cagney
  0 siblings, 2 replies; 29+ messages in thread
From: Michael Elizabeth Chastain @ 2003-12-02 22:09 UTC (permalink / raw)
  To: ac131313, wcohen; +Cc: drow, gdb

Andrew Cagney writes:
> I guess we get to restart the analysis :-(

Sounds like a job for GDB QA Guy!  :)

I downloaded Will's executables from:

  http://people.redhat.com/wcohen/gdb_tuning/monostrip
  http://people.redhat.com/wcohen/gdb_tuning/monotone

Here are some memory usage and time numbers.

  gdb   memory  utime  stime  elapsed
  5.3   263M    84.79  26.52  185.92
  6.0   263M    83.17  26.45  181.04
 HEAD    43M     2.78   0.27    3.23

gdb HEAD is from '2003-11-30 06:08:24 UTC'.

My system is a dell inspiron 2500 with intel celeron 800 MHz, 128
megabytes of memory, running without the X window system.  I used "top"
to monitor the memory usage.  I am just reporting the biggest "SIZE"
that I saw in "top" before gdb exited.

So there was no increase in resource usage from gdb 5.3 to gdb 6.0.

All three versions of gdb print "(no debugging symbols found)...".
All three versions can do "break main; run; cont; backtrace"
and print a good looking backtrace.  ("cont" hits a segfault).

I checked "maint print msymbols" with gdb 6.0 and gdb HEAD.
Both versions had a highest msymbol number of 23521.
However, gdb 6.0 produced an output file 266966644 bytes long,
and gdb HEAD produced an output file only 32695256 bytes long.

So next I counted the length of each line in the output.  The length of
the line is a few characters longer than the actual demangled minsym
because of the line index and stuff.

The top ten line lengths for gdb 6.0 were:

  1911946
  1740037
  1699747
  1697323
  1636399
  1626161
  1601007
  1512726
  1512726
  1512641

And the top ten line lengths for gdb HEAD were:

  77302
  77302
  77172
  77172
  77172
  77154
  77147
  77147
  77147
  77147

So, the new demangler is printing different, much smaller output.

In every case that I've seen, the new demangler has been correct,
and the old demangler has had many bugs.  So I have no reason to doubt
the new demangler now.  It would be useful to take some of these
2000-byte mangled symbols and check that the 70K demangled forms are
correct, but I don't have the resources for that yet.

I don't know why gdb HEAD is printing "(no debugging symbols found)...",
even for "monotone".  That's probably the most important bug now.

Michael C


^ permalink raw reply	[flat|nested] 29+ messages in thread
[parent not found: <3FBBDC27.50204@redhat.com>]

end of thread, other threads:[~2003-12-03 22:30 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-03 20:27 Slow handling of C++ symbol names Michael Elizabeth Chastain
2003-12-03 20:35 ` Ian Lance Taylor
  -- strict thread matches above, loose matches on Subject: below --
2003-12-03 22:30 Michael Elizabeth Chastain
2003-12-03 20:17 Michael Elizabeth Chastain
2003-12-03 20:14 Michael Elizabeth Chastain
2003-12-03 19:57 Michael Elizabeth Chastain
2003-12-03 20:16 ` Daniel Jacobowitz
2003-12-03 16:48 Michael Elizabeth Chastain
2003-12-03 16:52 ` David Carlton
2003-12-03 16:58 ` Ian Lance Taylor
2003-12-03 17:08   ` Daniel Jacobowitz
2003-12-03 17:34     ` Ian Lance Taylor
2003-12-03 17:38       ` Daniel Jacobowitz
2003-12-03 17:54         ` Ian Lance Taylor
2003-12-02 22:38 Michael Elizabeth Chastain
2003-12-02 22:09 Michael Elizabeth Chastain
2003-12-02 22:23 ` Ian Lance Taylor
2003-12-02 22:29   ` Daniel Jacobowitz
2003-12-03 18:52 ` Andrew Cagney
     [not found] <3FBBDC27.50204@redhat.com>
2003-11-19 21:13 ` Daniel Jacobowitz
2003-11-20 16:09   ` Andrew Cagney
2003-11-20 16:19     ` Daniel Jacobowitz
2003-11-20 16:54       ` Andrew Cagney
2003-11-20 16:58         ` Daniel Jacobowitz
2003-11-21 17:58         ` Daniel Jacobowitz
2003-11-26 14:27           ` Andrew Cagney
2003-11-26 16:24             ` Will Cohen
2003-11-26 20:48               ` Andrew Cagney
2003-11-26 20:45             ` Will Cohen

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