compiler-explorer / compiler-explorer

Run compilers interactively from your web browser and interact with the assembly
https://godbolt.org/
BSD 2-Clause "Simplified" License
16k stars 1.71k forks source link

Support MSVC name unmangling #541

Closed nunoplopes closed 6 years ago

nunoplopes commented 6 years ago

It would be nice to support MSVC name unmangling. It's easy to do: just call the undname tool. It works well with wine.

$ wine undname '?h@@YAXJ@Z' 2> /dev/null
Microsoft (R) C++ Name Undecorator
Copyright (C) Microsoft Corporation. All rights reserved.

Undecoration of :- "?h@@YAXJ@Z"
is :- "void __cdecl h(long)"
mattgodbolt commented 6 years ago

CC @andrewpardoe - is there an unmangler for msvc?

AndrewPardoe commented 6 years ago

Yes, the undname tool: https://docs.microsoft.com/en-us/cpp/build/reference/decorated-names#Undecorated

mattgodbolt commented 6 years ago

Perfect. I should learn to use a search engine! (Bing maybe? :))

AndrewPardoe commented 6 years ago

That is what I used, as a matter of fact! But it helps to know what you're looking for a priori.

Trass3r commented 6 years ago

To be closed? It does not demangle lambdas correctly, but I guess that is a problem with undname. Or maybe a newer version of the tool is required.

partouf commented 6 years ago

there are some exceptions because of the Wine environment, otherwise undname is used, so yes, this can be closed.