public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* FYI: A new C++ demangler
@ 2003-07-10 14:36 H. J. Lu
  2003-07-10 14:40 ` Ian Lance Taylor
                   ` (2 more replies)
  0 siblings, 3 replies; 33+ messages in thread
From: H. J. Lu @ 2003-07-10 14:36 UTC (permalink / raw)
  To: binutils; +Cc: GDB

[-- Attachment #1: Type: text/plain, Size: 298 bytes --]

I will put a new C++ demangler in Linux binutils, which should fix all
known bugs in the old demangler. It is written in C++. It will be
enabled only if there is a working C++ compiler. Otherwise, the old
demangler will be used.

I am enclosing the patch here in case someone is interested.


H.J.

[-- Attachment #2: demangler-11.patch.bz2 --]
[-- Type: application/x-bzip2, Size: 26123 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread
* Re: FYI: A new C++ demangler
@ 2003-07-10 15:42 Michael Elizabeth Chastain
  2003-07-10 15:51 ` H. J. Lu
  2003-07-10 16:38 ` Ian Lance Taylor
  0 siblings, 2 replies; 33+ messages in thread
From: Michael Elizabeth Chastain @ 2003-07-10 15:42 UTC (permalink / raw)
  To: carlton, hjl; +Cc: binutils, gdb

I will throw the new demangler on my gdb test bed and look for regressions.
I'm sure H. J. has the demangler test suite covered and I can do the
gdb test suite.

I have kind of a silly question.  Do I need to rebuild binutils and/or gcc
with the new demangler, or can I just rebuild gdb?  That is, do gcc or
binutils ever need to run the demangler while compiling?

Regarding the controversy about adding a demangler written in C++,
I am neutral about that.  I'll just provide gdb test results.

Michael C

^ permalink raw reply	[flat|nested] 33+ messages in thread
* Re: FYI: A new C++ demangler
@ 2003-07-10 21:57 Michael Elizabeth Chastain
  0 siblings, 0 replies; 33+ messages in thread
From: Michael Elizabeth Chastain @ 2003-07-10 21:57 UTC (permalink / raw)
  To: ac131313, hjl, kettenis; +Cc: binutils, gdb

Andrew C writes:
> HJ, as a start why not separate out and submit these new tests you 
> refered to?  Knowing what's broken is a good starting point.

That part is already committed.  The libiberty test suite has 64 new
tests.  The current demangler fails 31 of the new tests.  I saw this in
my test bed and wrote it up.  Check out the "Libiberty Testing" section
near the top of:

  http://sources.redhat.com/ml/gdb-testers/2003-q3/msg00003.html

To me, the issue of what languages are acceptable for implementing the
demangler is separate from the issue of how the new demangler behaves
versus the old demangler.  I can say something about the second issue.
I see that the new demangler does perfectly on all the new tests in
libiberty, and I'm running gdb tests now.  I'll have more info to report
in a couple of hours.

Michael C

^ permalink raw reply	[flat|nested] 33+ messages in thread
* Re: FYI: A new C++ demangler
@ 2003-07-11  0:36 Michael Elizabeth Chastain
  0 siblings, 0 replies; 33+ messages in thread
From: Michael Elizabeth Chastain @ 2003-07-11  0:36 UTC (permalink / raw)
  To: binutils, hjl; +Cc: gdb

Summary: no regressions in the gdb test suite.  One change detected
that's a slight improvement.

I know this is moot because gdb can't use code implemented in C++,
but I thought it would be interesting to run the test anyways.

I tested this with the usual:

  target     => native
  host       => i686-pc-linux-gnu
  osversion  => red-hat-8.0
  gdb        => HEAD%20030708
  gcc        => 2.95.3, 3.2-7-rh, 3.3, gcc-3_3-branch%20030707, HEAD%20030707
  binutils   => 2.13.90.0.2-rh, 2.14, binutils-2_14-branch%20030707, HEAD%20030707
  glibc      => 2.2.93-5-rh
  gformat    => dwarf-2, stabs+
  glevel     => 2

All the gcc v2 results were unchanged (obviously, since gdb still uses the
same v2 demangler).

The gcc v3 results were the same for all versions of gcc v3,
binutils, and gformat.  There were three places where something like
this happened:

  # old
  print &'dm_type_unsigned_int'
  $6 = (int (*)(unsigned int)) 0x8048940 <dm_type_unsigned_int(unsigned)>
  (gdb) PASS: gdb.c++/cplusfuncs.exp: detect dm_type_unsigned_int

  # new
  print &'dm_type_unsigned_int'
  $6 = (int (*)(unsigned int)) 0x8048940 <dm_type_unsigned_int(unsigned int)>
  (gdb) PASS: gdb.c++/cplusfuncs.exp: detect dm_type_unsigned_int

That is, the old demangler prints 'unsigned' in some places, and the new
demangler prints 'unsigned int'.  This happened once in
gdb.c++/cplusfuncs.exp and twice in gdb.c++/templates.exp.

Michael C

^ permalink raw reply	[flat|nested] 33+ messages in thread
* Re: FYI: A new C++ demangler
@ 2003-07-12 18:02 Nathanael Nerode
  2003-07-15 16:17 ` Andrew Cagney
  0 siblings, 1 reply; 33+ messages in thread
From: Nathanael Nerode @ 2003-07-12 18:02 UTC (permalink / raw)
  To: fche; +Cc: gdb, binutils, hjl

Frank Eigler said:
>You might be accused of dogmatic monolingualism if you don't accept
>the notion that some such code may be more naturally expressed in a
>higher level language -- that could be one such reason.  Another
>reason of course is the fact that it is already done and working:
>rewriting costs new effort.

Look, if you want to *add a build requirement* to GDB, so that it 
*requires* a C++ compiler to build, then then new C++ demangler will
be fine for GDB.

We *don't* want to add such a build requirement for GCC or binutils, for 
very good reasons (a lot of systems don't ship with a C++ compiler).  HJ 
keeps proposing a *completely* demented idea, which is that 
the new demangler will be used if a C++ compiler happens to be lying 
around during build, and otherwise the broken demangler will be used.  I 
wish he'd see what's wrong with that picture.

-- 
Nathanael Nerode  <neroden at gcc.gnu.org>
http://home.twcny.rr.com/nerode/neroden/fdl.html

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

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

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-10 14:36 FYI: A new C++ demangler H. J. Lu
2003-07-10 14:40 ` Ian Lance Taylor
2003-07-10 14:54   ` H. J. Lu
2003-07-10 15:28 ` David Carlton
2003-07-10 15:36   ` H. J. Lu
2003-07-10 15:44     ` David Carlton
2003-07-10 20:57 ` Mark Kettenis
2003-07-10 21:17   ` Andrew Cagney
2003-07-10 21:44     ` H. J. Lu
2003-07-10 22:58     ` Frank Ch. Eigler
2003-07-10 23:19       ` Andrew Cagney
2003-07-10 21:22   ` DJ Delorie
2003-07-10 15:42 Michael Elizabeth Chastain
2003-07-10 15:51 ` H. J. Lu
2003-07-10 16:38 ` Ian Lance Taylor
2003-07-10 21:57 Michael Elizabeth Chastain
2003-07-11  0:36 Michael Elizabeth Chastain
2003-07-12 18:02 Nathanael Nerode
2003-07-15 16:17 ` Andrew Cagney
2003-07-15 18:03   ` Gabriel Dos Reis
2003-07-15 19:02     ` Andrew Cagney
2003-07-15 19:03     ` Alexandre Oliva
2003-07-15 19:16       ` H. J. Lu
2003-07-15 19:49         ` Alexandre Oliva
2003-07-15 19:55           ` H. J. Lu
2003-07-15 22:30             ` Alexandre Oliva
2003-07-15 23:14               ` H. J. Lu
2003-07-16  2:31                 ` Alexandre Oliva
2003-07-16  3:21                 ` Ian Lance Taylor
2003-07-16 17:12       ` Nathanael Nerode
2003-07-15 19:16     ` Ian Lance Taylor
2003-07-15 19:23       ` H. J. Lu
2003-07-15 20:05       ` DJ Delorie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).