Closed hmartinez82 closed 6 years ago
I rely on demumble and dbghelp.dll
's UnDecorateSymbolName
to demangle decorated symbols. Unfortunately demumble
is not maintained anymore and UnDecorateSymbolName
only unmangle MSVC names.
I'm currently trying to incoporate LLVM's demangler, but it keeps crashing on pretty sane inputs.
I've integrated llvm's MicrosoftDemangler in Dependencies, can you tell me if that's solve the issue ? https://ci.appveyor.com/api/buildjobs/vdvsksuje713kxkx/artifacts/output%2FDependencies_x64_Debug.zip
@lucasg nope, tried that one, it's still not demangling rvalue references. These three are showing in the attached DependenciesGui you posted above:
private: __cdecl QJsonArray::QJsonArray(class QJsonPrivate::Data * __ptr64,class QJsonPrivate::Array * __ptr64) __ptr64
??0QJsonArray@@QEAA@$$QEAV0@@Z
public: __cdecl QJsonArray::QJsonArray(class QJsonArray const & __ptr64) __ptr64
The middle one should be
public: __cdecl QJsonArray::QJsonArray(class QJsonArray && __ptr64) __ptr64
which I checked with undname ??0QJsonArray@@QEAA@$$QEAV0@@Z
I wonder what 'undname' that comes with Visual Studio uses
It rely on vcruntime
's UndNameEx
which is not documented, but probably more up to date than dbghelp
's UndecorateSymbol
. Anyway I found LLVM demangler pretty satisfying for this task, I push an update later this week.
@lucasg so you got it working wit the new demangler?
Yep, it should work now. There still a cosmetic issue : llvm
demangler does not undecorate exactly the same way Microsoft's does so it may looks weird side-by-side, but that's pretty harmless. You can test it : https://ci.appveyor.com/api/buildjobs/ejg576s7vvbeqg0p/artifacts/output%2FDependencies_x64_Debug.zip
Alternatively, you can test directly the demangler using demangler-test.exe
in the zipped folder. The command line is currently horrendous, but here the usage :
& .\demangler-test.exe [-DEMANGLER] MANGLING-NAME | FILE
Possible names for the DEMANGLER
option:
"Demumble"
: https://github.com/nico/demumble demangler"LLVMItanium"
: llvm::itaniumDemangler
"LLVMMicrosoft"
: llvm::microsoftDemangler
"Microsoft"
: UndecorateSymbol
"Default"
: use successively the four precedent ones until successE.g. :
& .\demangler-test.exe -Default '"??0QJsonArray@@QEAA@$$QEAV0@@Z"'
__cdecl QJsonArray::QJsonArray(class QJsonArray &&)
(fwiw demumble is maintained, it's just working pretty well and changing rarely. I just pushed a change to make it demangle rvalue refs etc; looks like you went with the same approach I went with by now.)
Functions and methods with && as the parameter modifier are not being unmangled