Re: MSVC C++ name demangling



Tim Roberts wrote:
Soeren Meyer-Eppler <Soeren.Meyer-Eppler@xxxxxxxxxxxxx> wrote:

Questions:
- Is there an open source MSVC name demangler?

No, but every version of Visual Studio in the last 8 years has
included an "undname.exe" utility for exactly that purpose.

For VS98, it's in the "common\tools" directory. For VS2003 and
VS2005, it's in the "bin" directory with the command-line compiler.

Additionally if you want to do the same from your own code you can use this

extern "C"
char * _unDName(
char * outputString,
const char * name,
int maxStringLength,
void * (* pAlloc )(size_t),
void (* pFree )(void *),
unsigned short disableFlags);


const char * const pName = <decorated name>
char * const pTmpUndName = _unDName(0, pName, 0, malloc, free, 0x2800);
if (pTmpUndName)
{
//copy pTmpUndName somewhere, this is the undecorated name
free(pTmpUndName);
}

If your linker cannot find __unDName it is exported from VC CRT dll
(whatever its name is on your version).

Note that UnDecorateSymbolName you mentioned is a stripped down version of
__unDName. It can only handle a subset of possible C++ mangled names.

--
Eugene
http://www.gershnik.com



.



Relevant Pages

  • [PATCH 2.6.19-rc1 V9] drivers: add LCD support
    ... Adds support for the ks0108 LCD Controller as a device driver. ... +The buffer should be a 128*64 unsigned char array: ... * GNU General Public License for more details. ... +static void cfag12864b_setbit ...
    (Linux-Kernel)
  • [PATCH 2.6.19-rc1 V9] drivers: add LCD support
    ... Adds support for the ks0108 LCD Controller as a device driver. ... +The buffer should be a 128*64 unsigned char array: ... * GNU General Public License for more details. ... +static void cfag12864b_setbit ...
    (Linux-Kernel)
  • Re: back once again...
    ... reference to type ... a, signed char ... int dycObjectP(dyt obj); ... void dycBeginClass; ...
    (comp.lang.misc)
  • [PATCH 2.6.18 V8] drivers: add LCD support
    ... Adds a LCD class for registering LCD devices. ... +The buffer should be a 128*64 unsigned char array: ... * GNU General Public License for more details. ... +static void cfag12864b_setbit ...
    (Linux-Kernel)
  • [PATCH 2.6.18 V7] drivers: add lcd display support
    ... Adds support for the cfag12864b LCD Display as a device driver. ... +The buffer should be a 128*64 unsigned char array: ... * GNU General Public License for more details. ... +static void cfag12864b_setbit ...
    (Linux-Kernel)