tango.core.tools.Demangler

D symbol name demangling

Attempts to demangle D symbols generated by the DMD frontend. (Which is not always technically possible.)

A sample program demangling the names passed as arguments.

module demangle;
import tango.core.tools.Demangler;
import tango.io.Stdout;

void usage(){
    Stdout("demangle [--help] [--level 0-9] mangledName1 [mangledName2...]").newline;
}

int main(const(char)[][]args){
    uint start=1;
    if (args.length>1) {
        if (args[start]=="--help"){
            usage();
            ++start;
        }
        if (args[start]=="--level"){
            ++start;
            if (args.length==start || args[start].length!=1 || args[start][0]<'0' || 
                args[start][0]>'9') {
                Stdout("invalid level '")((args.length==start)?"*missing*":args[start])
                    ("' (must be 0-9)").newline;
                usage();
                return 2;
            }
            demangler.verbosity=args[start+1][0]-'0';
            ++start;
        }
    } else {
        usage();
        return 0;
    }
    foreach (n;args[start..$]){
        Stdout(demangler.demangle(n)).newline;
    }
    return 0;
}

Members

Classes

Demangler
class Demangler

Flexible demangler. Attempts to demangle D symbols generated by the DMD frontend. (Which is not always technically possible.)

Demangler
class Demangler
Undocumented in source.

Functions

decompressOMFSymbol
const(char)[] decompressOMFSymbol(const(char)[] garbled, char[]* buf)
Undocumented in source. Be warned that the author may not have intended to support it.
decompressSymbol
const(char)[] decompressSymbol(const(char)[] func, char[]* buf)

decompresses a symbol and returns the full symbol, and possibly a reduced buffer space (does something only on windows with DMD.)

isMD5Hashed
bool isMD5Hashed(const(char)[] name)
Undocumented in source. Be warned that the author may not have intended to support it.
toUint
uint toUint(const(char)[] s)
Undocumented in source. Be warned that the author may not have intended to support it.

Static variables

demangler
Demangler demangler;

The default demangler.

demangler
Demangler demangler;

The default demangler.

Meta

License

tango license, apache 2.0

Authors

Zygfryd (aka Hxal), Fawzi