Closed ZgblKylin closed 6 years ago
Still cannot undecorate, I use Qt5Core.dll(Qt framework, MinGW version) to test, it's symbols look like this - _ZN10QByteArray5clearEv
(void QByteArray::clear()
).
C++ symbols generated by MinGW
are decorated same as gcc
, not msvc
, so UnDecorateSymbolName
cannot resolve it.
I suggest use _cxa_demangle in libstdc++.
We could use MinGW
to build a c-library, link it to libstdc++
, and export this function as extern "C"
, then this library can be linked to msvc
projects.
So when UnDecorateSymbolName
failed, we can call that c-library for _cxa_demangle
instead.
I've packaged a Windows-based _cxa_demangle
lib in order to undecorate GCC symbols : https://github.com/lucasg/Dependencies/commit/76a0eb053e86a0bef59fc1be2e1a0e5ceafe7f39.
The lib is two years old, so recent symbols may not be undecorated correctly, but it should work for your case. I tested it on C:\Program Files\Git\mingw64\bin\libstdc++-6
and it demangled most of the exports.
You can test it here : https://ci.appveyor.com/project/lucasg/dependencies/build/1.0.145/job/pghdl4w4uiew4q0e/artifacts
That's great! It works perfect now.
Thanks a lot!
2 probable causes for this issue :
gcc
andmsvc
may not decorate C++ symbols the same way. I really hope this is not case, since otherwise I would have to detect which compiler generated the specifiedPE
file and use the corresponding undecorator function.I've fixed cause
#1
with this commit : dc624147841872fbfcae93a90a7bc7a1e3579584 (release is here : https://ci.appveyor.com/api/buildjobs/m3ft0c0pn5vc9685/artifacts/output%2FDependencies.zip ). Can you tell me if this fixed your issue ? If not, is it possible for you to send me a testdll
reproducing the issue ?Cheers,