demangling

Fergus Henderson fjh at cs.mu.oz.au
Tue Sep 9 21:32:06 AEST 1997


>From the mailing list archives in /home/mercury/public/mailing_lists...

From: Tyson Richard DOWD <trd at cs.mu.oz.au>
Subject: Re: [m-dev.] diff: fixes for demangling
To: mercury-developers at cs.mu.oz.au
Date: Thu, 24 Jul 1997 15:33:19 +1000 (EST)

> +++ mdemangle.c	1997/07/23 19:40:08
> @@ -13,6 +13,12 @@
>  ** A mercury symbol demangler.
>  ** This is used to convert error messages from the linker back
>  ** into a form that users can understand.
> +**
> +** This is implemented in C to minimize startup time and memory usage.
> +**
> +** BEWARE:
> +** This code is duplicated in profiler/demangle.m and profiler/mdemangle.m.
> +** Any changes here will need to be duplicated there and vice versa.
>  */

(Fergus and I just discussed this, so to fill others in...).

We now have a double maintenance problem... we also have a problem in
that maintaining C code is quite difficult, time consuming, and
error prone. Since we are using the demangling code in the profiler, it
would be good to write it in Mercury (it would still be fiddly, but much
easier).

We could do this, and avoid any startup time and memory usage problems
by using a shell script wrapper of some sort, that only invokes the
*real* demangler if there is a "mercury__" in the input. If there is a
link error, it doesn't really matter much what the startup time and
memory usage is like.

We could then implement the real demangler in, say, Mercury. Of course
there would be small bootstrapping problems if a distribution doesn't
link, but if the demangler doesn't link properly, there's a either real
problem with the distribution (and so, in comparison, it doesn't matter
too much that the symbols are mangled), or a system problem (in which
case the symbols probably won't be Mercury symbols.

Something to do after this release, however.

----- End of forwarded message from Tyson Richard DOWD -----

-- 
Fergus Henderson <fjh at cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3         |     -- the last words of T. S. Garp.



More information about the developers mailing list