🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

6 total messages Started by FLEINERC%CFRUNI51.BITNET Mon, 23 Nov 1992 08:06
demangeling
#596
Author: FLEINERC%CFRUNI51.BITNET
Date: Mon, 23 Nov 1992 08:06
12 lines
700 bytes
Does there exist a program to demangle names used by C++ ?
it should accept for example
     __ct__7ostreamFv
and print
     ostream::ostream()

If not, is someone writting such a beast ?

thanks for any infos

Claudio Fleiner (fleinerc@cfruni51.bitnet)
Re: demangeling
#597
Author: Guy Pickering
Date: Mon, 23 Nov 1992 14:16
22 lines
1368 bytes
 (FLEINERC%CFRUNI51.BITNET@mitvma.mit.edu) wrote:
: 
: Does there exist a program to demangle names used by C++ ?
: it should accept for example
:      __ct__7ostreamFv
: and print
:      ostream::ostream()


With AT&T C++ V3.01 you get a program c++filt which does this.
Also there is a patch for gdb to allow cfront name demangling.

Guy

--
+--------------------------------+-----------------------------------------+
| Guy Pickering                  | School of Electronic & Electrical Eng,  |
| E-MAIL: G.PICKERING@uk.ac.bham | University of Birmingham,               |
| Tel: (021) 414 4340            | Edgbaston, Birmingham. B15 2TT.         |
+--------------------------------+-----------------------------------------+
| "I have ten pairs of trainers...One for each day of the week" - Sam Fox  |
+--------------------------------+-----------------------------------------+
List of PD C++ Libraries??
#600
Author: Hong-Hsiang Chen
Date: Mon, 23 Nov 1992 16:13
21 lines
1431 bytes
Well, since the major advantage of C++ is the promised silver bullet of 
reusable software components, i.e., class libraries, I am wondering if there
is a list somewhere out there of public domain and/or free c++ libraries,
not to mention tools...

Obviously libg++, InterViews, Keith Gorlen's OOPS, OATH, COOL, spring to mind,
but I'm sure there are lots more lurking out there on the 'net...

A list of tools such as ident++, bison++, c++2latex, tags++, etc. would be
nice also.

The FAQ is mum about this... I would think such a list would/should be
included and definitely desirable...

If there isn't such a beast, well then, time to start compiling one ... :-)

--
-----
Sean Chen.  hhc@athena.mit.edu
"Nunc in scutella iaceo,/et volitare nequeo,/dentes fredentes video./Miser!"
  Olim lacus colueram, _Carmina Burana_
Re: demangeling
#607
Author: David Edelsohn
Date: Mon, 23 Nov 1992 22:05
12 lines
1427 bytes
	A collection of subroutines to demangle C++ symbol names is
included with GCC (G++) called cp-dem.c.  Simply write a driver program to
call the entry point (and provide for the xmalloc/xalloc calls) and you're
on your way.

					David
===============================================================================
David Edelsohn                                      T.J. Watson Research Center
c$dje@watson.ibm.com                                P.O. Box 218
+1 914 945 3011 (Tieline 862)                       Yorktown Heights, NY 10598
"The Church doesn't have problems with sex; the world does" -- Vatican official
"A good theory should fit on a T-shirt" -- Astronomer at Jan 1992 AAS meeting
Re: demangeling
#608
Author: Steve Clamage
Date: Mon, 23 Nov 1992 23:39
30 lines
1491 bytes
FLEINERC%CFRUNI51.BITNET@mitvma.mit.edu writes:


>Does there exist a program to demangle names used by C++ ?
>it should accept for example
>     __ct__7ostreamFv
>and print
>     ostream::ostream()

Name mangling is an implementation detail, not part of the definition
of the C++ language.  There is no one way to mangle names, and indeed,
the ARM recommends that different compilers use different mangling
techniques (if they use name mangling at all).

The reason for the recommendation is that there are many arbitrary
decisions which an implementation must make, and it is unlikely that
two different implemenations will make them the same way.  If name
mangling were the same, it would be possible to link object files
from incompatible compilers, producing bizarre program failures.  If
the program fails to link, you at least have a clue that the compilers
are incompatible.

Thus, there is no one portable demangling program.

Many C++ implementations come with a name demangler .  Check
your documentation, or ask your compiler vendor.
-- 

Steve Clamage, TauMetric Corp, steve@taumet.com
Vice Chair, ANSI C++ Committee, X3J16
Re: demangeling
#609
Author: Brendan Kehoe
Date: Tue, 24 Nov 1992 03:50
158 lines
4509 bytes
In article <9211231128.AA20601@life.ai.mit.edu> FLEINERC%CFRUNI51.BITNET@mitvma.mit.edu writes:

   Does there exist a program to demangle names used by C++ ?
   it should accept for example
	__ct__7ostreamFv
   and print
	ostream::ostream()

   If not, is someone writting such a beast ?

There is, in the libiberty directory of gdb-4.7.  It might be a good
thing to include in the 2.4 release of gcc/g++; we'll see.

The next release of gdb will have a demangler that you can build
easily (the stuff in 4.7 has some trouble); in the meantime, apply
these diffs in the libiberty directory to be able to just do

	../configure __whatever__
	make demangle

and have it generate the program properly.


*** Makefile.in.~1~	Thu Nov 19 03:12:13 1992
--- Makefile.in	Thu Nov 19 03:58:24 1992
***************
*** 218,224 ****
  # Create a standalone demangler if so desired ("make demangle").
  
! demangle: ${srcdir}/${DEMANGLER}.c
! 	${CC} -o $@ -DMAIN ${INTERNAL_CFLAGS} \
! 	  `echo ${srcdir}/${DEMANGLER}.c | sed 's,^\./,,'`
  
  ls:
--- 218,224 ----
  # Create a standalone demangler if so desired ("make demangle").
  
! demangle: ${srcdir}/cplus-dem.c
! 	$(CC) -o $@ -DMAIN $(CFLAGS) -I. -I$(srcdir)/../include $(HDEFINES) $(XTRAFLAGS) \
! 	  `echo $^ | sed 's,^\./,,'`
  
  ls:
*** cplus-dem.c.~1~	Tue Oct  6 11:18:33 1992
--- cplus-dem.c	Thu Nov 19 03:58:27 1992
***************
*** 35,38 ****
--- 35,41 ----
  #include <stdio.h>
  
+ extern char *xmalloc ();
+ extern char *xrealloc ();
+ 
  /* In order to allow a single demangler executable to demangle strings
     using various common values of CPLUS_MARKER, as well as any specific
*************** remember_type (work, start, len)
*** 1720,1724 ****
  	}
      }
!   tem = (char *) xmalloc (len + 1);
    memcpy (tem, start, len);
    tem[len] = '\0';
--- 1729,1733 ----
  	}
      }
!   tem = xmalloc (len + 1);
    memcpy (tem, start, len);
    tem[len] = '\0';
*************** string_need (s, n)
*** 2061,2065 ****
  	  n = 32;
  	}
!       s->p = s->b = (char *) xmalloc (n);
        s->e = s->b + n;
      }
--- 2070,2074 ----
  	  n = 32;
  	}
!       s->p = s->b = xmalloc (n);
        s->e = s->b + n;
      }
*************** string_need (s, n)
*** 2069,2073 ****
        n += tem;
        n *= 2;
!       s->b = (char *) xrealloc (s->b, n);
        s->p = s->b + tem;
        s->e = s->b + n;
--- 2078,2082 ----
        n += tem;
        n *= 2;
!       s->b = xrealloc (s->b, n);
        s->p = s->b + tem;
        s->e = s->b + n;
*************** demangle_it (mangled_name)
*** 2223,2233 ****
  }
  
! PTR
  xmalloc (size)
      long size;
  {
!   PTR newmem;
  
!   if ((newmem = malloc ((int) size)) == NULL)
      {
        fprintf (stderr, "\nCan't allocate %u bytes\n", size);
--- 2232,2242 ----
  }
  
! char *
  xmalloc (size)
      long size;
  {
!   char * newmem;
  
!   if ((newmem = (char *) malloc ((int) size)) == NULL)
      {
        fprintf (stderr, "\nCan't allocate %u bytes\n", size);
*************** xmalloc (size)
*** 2237,2248 ****
  }
  
! PTR
  xrealloc (oldmem, size)
!     PTR oldmem;
      long size;
  {
!   PTR newmem;
  
!   if ((newmem = realloc ((char *) oldmem, (int) size)) == NULL)
      {
        fprintf (stderr, "\nCan't reallocate %u bytes\n", size);
--- 2246,2257 ----
  }
  
! char *
  xrealloc (oldmem, size)
!     char * oldmem;
      long size;
  {
!   char * newmem;
  
!   if ((newmem = (char *) realloc ((char *) oldmem, (int) size)) == NULL)
      {
        fprintf (stderr, "\nCan't reallocate %u bytes\n", size);
*************** main (argc, argv)
*** 2307,2310 ****
--- 2316,2321 ----
  	}
      }
+ 
+   exit (0);
  }
  

--
Brendan Kehoe                                               brendan@cygnus.com
Cygnus Support, Mountain View, CA                              +1 415 903 1400
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads