Demangling in MSVC

后端 未结 4 1391
轻奢々
轻奢々 2020-12-16 23:47

How can i demangle name in MSVC? There\'s abi::__cxa_demangle function in gcc. In MSDN i\'ve found UnDecorateSymbolName:

http://msdn.microsoft.com/ru-ru/library/windo

4条回答
  •  孤城傲影
    2020-12-17 00:26

    Visual studio already shipped a utility called undname. For my VS2010 and VS2013 install, it's installed to %VSINSTALL%\vc\bin directory. And for x64 platform, in %VSINSTALL%\vc\amd64\bin directory.

    The example usage is:

    D:\work\VS2013>undname "?static_x@?1??getX@@YAAAUX@@XZ@4U2@A"
    Microsoft (R) C++ Name Undecorator
    Copyright (C) Microsoft Corporation. All rights reserved.
    
    Undecoration of :- "?static_x@?1??getX@@YAAAUX@@XZ@4U2@A"
    is :- "struct X `struct X & __cdecl getX(void)'::`2'::static_x"
    

    Another way to get the demangled name is use /FAsc /Faoutput.asm compiler option, which will produce the assembly list, in which each mangled name is commented with it's demangled name. See This link for reference.

提交回复
热议问题