Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to demangle names in Visual Studio assembler output?

Using Visual Studio 2010/2012, one can compile a c++ source file with the /FAs switch to generate the assembly output of the resulting code. But the generated asm file contains all symbols in their mangled form.

Is there a switch or other smart way to make Visual Studio generate unmangled symbols instead? I know that one could manually feed the asm file through undname.exe but a switch would be much more convenient than a custom post-build event.

like image 293
Bloops Avatar asked Oct 09 '12 15:10

Bloops


1 Answers

It is not possible to do so, because of the nature of /FA's output. FA outputs valid assembly code. The symbols one needs to express a C++ function unmangled are simply not valid label names in microsoft's x86 assembly. There is also no good notation for anonymous namespaces.

Any output which handled those cases would not be compilable using an assembler. If you made an assembler which did handle such names, it would need to know whose name mangling rules to apply to assemble it. This defeats the main purpose of outputting assembly (to see EXACTLY what is going on).

like image 105
Cort Ammon Avatar answered Oct 05 '22 05:10

Cort Ammon