🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.help
Article #416

Re: GCC Symbol Demangler Wanted

#416
From: Jason Merrill
Date: Sat, 10 Oct 1992 06:57
56 lines
1560 bytes
In article <22836@galaxy.ucr.edu> ezix@troi.ucr.edu (edward j. zix) writes:
>
>Is there a Name demangler available on the net?
>It is kind of a pain to do it by hand.
>i.e. Given something like "Q25Outer5Inner", return "Outer::Inner"

Try cp-dem.c from the gcc distribution.  You need to write your own
front-end, or use mine:

#ifdef STANDALONE
static void
fatal (s, a1, a2)
     char *s;
{
  fprintf (stderr, "demangle: ");
  fprintf (stderr, s, a1, a2);
  fprintf (stderr, "\n");
  exit (1);
}

char *
xmalloc (size)
     int size;
{
  register char *val = (char *) malloc (size);

  if (val == 0)
    fatal ("virtual memory exhausted");
  return val;
}

char *
xrealloc (ptr, size)
     char *ptr;
     int size;
{
  char *result = (char *) realloc (ptr, size);
  if (!result)
    fatal ("virtual memory exhausted");
  return result;
}

main(argc, argv)
     int argc;
     char **argv;
{
    char* s;
    while(--argc) {
	s = cplus_demangle(*++argv);
	if (s) {
	    puts(s);
	    free(s);
	}
    }
}
#endif
Technical Details
Message-ID: <1992Oct10.065727.27305@muddcs.claremont.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!sun-barr!ames!elroy.jpl.nasa.gov!news.claremont.edu!jarthur.claremont.edu!jason
References: <22836@galaxy.ucr.edu>

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.help
Path: arc1-ca.pugleaf.net!sparky!uunet!sun-barr!ames!elroy.jpl.nasa.gov!news.claremont.edu!jarthur.claremont.edu!jason
From: jason@jarthur.claremont.edu (Jason Merrill)
Subject: Re: GCC Symbol Demangler Wanted
Message-ID: <1992Oct10.065727.27305@muddcs.claremont.edu>
Sender: news@muddcs.claremont.edu (The News System)
Organization: Harvey Mudd College, Claremont, CA 91711
References: <22836@galaxy.ucr.edu>
Distribution: usa
Date: Sat, 10 Oct 1992 06:57:27 GMT
Lines: 56