Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#571 Demangle testsuite names

open
nobody
None
5
2012-09-14
2012-08-23
No

When invoking Net/testsuite, I get test names such as:

N7CppUnit10TestCallerI14ICMPClientTestEE.testPing

It would be good to demangle the names back to their source form.

Discussion

  • Here's an example of how to do this using glibc:

    include <stdio.h>

    include <stdlib.h>

    include <cxxabi.h>

    int main(int argc, char argv)
    {
    const char
    name = "_Z" "N7CppUnit10TestCallerI14ICMPClientTestEE";
    int error;
    char demangled = abi::__cxa_demangle(name, 0, 0, &error);

    if (!error) printf("%s\n", demangled);
    free(demangled);
    exit(0);
    

    }

    In Win32, this is done as:

    DWORD nameLen;
    const TCHAR* name = _T("_Z" "N7CppUnit10TestCallerI14ICMPClientTestEE");
    TCHAR buf[128];
    
    nameLen = UnDecorateSymbolName(name, buf, 128, UNDNAME_COMPLETE);
    wsprintf("%.*s\n", nameLen, buf);