- Qt Creator 14 dropped support for Python 2 pretty printers. This led to Qt 5.15.x 32 and 64 bit users being unable to debug applications using the Qt 5.15.x MinGW Kit with MinGW 8.1 and GDB 8.1. Python 2.7 support ended in 2019, but Qt 5.15.x is still supported until 2025.
- The easy solution is to update GDB 11.2.0 from the MinGW 11.2.0 package which uses Python 3 for the GDB pretty printers. However, GDB has a C++ Runtime dependency in the form of DLL files that are incompatible between MinGW 8.1 and 11.2, such as libgcc_s_seh-1.dll, libstdc++-6.dll, and libwinpthread-1.dll.
- Visual C++ users know about application xml manifest files. Applications built by MinGW GCC usually don't have such a file. It needs to be included in the executable as a resource using the mt.exe tool (LLVM offers an llvm-mt.exe alternative).
The xml manifest for x86_64 looks like:
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="gdb.mingw.sxs" version="11.2.0.0" processorArchitecture="amd64"></assemblyIdentity> </dependentAssembly> </dependency> </assembly>
And for x86:
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="gdb.mingw.sxs" version="11.2.0.0" processorArchitecture="x86"></assemblyIdentity> </dependentAssembly> </dependency> </assembly>
After including the file in
gdborig.exe
andgdbserver.exe
executables like$ mt.exe -nologo -manifest "appmanifest.xml" -outputresource:"gdborig.exe;#1"
, create agdb.mingw.sxs
directory and copy the relevant files into it. For x86_64, thegdb.mingw.sxs.manifest
looks like:<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <noInheritable/> <assemblyIdentity type="win32" name="gdb.mingw.sxs" version="11.2.0.0" processorArchitecture="amd64"/> <file name="libgcc_s_seh-1.dll" hash="96eeefab4af1670cc59e9a77b5f93c65a85ac181" hashalg="SHA1"/> <file name="libstdc++-6.dll" hash="92c59fa3fddf375ee27601975c10b44882d9ecd0" hashalg="SHA1"/> <file name="libwinpthread-1.dll" hash="96387d1c8e3bfbcaeb05fda32c031468417afb7b" hashalg="SHA1"/> </assembly>
And for x86:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <noInheritable/> <assemblyIdentity type="win32" name="gdb.mingw.sxs" version="11.2.0.0" processorArchitecture="x86"/> <file name="libgcc_s_dw2-1.dll" hash="08d3beb878ccdc4c516d51e98e66fd10be1ea239" hashalg="SHA1"/> <file name="libstdc++-6.dll" hash="92f9c0504b554c17092d52e72bde7d48723c1589" hashalg="SHA1"/> <file name="libwinpthread-1.dll" hash="13b8af525e224f7f69cf1bbe879aa284344d5e0e" hashalg="SHA1"/> </assembly>
- With all these steps in place, the
gdb.exe
11.2.0 can start in a MinGW 8.1 toolchain directory. Some Python dependencies also need to be packaged, which can be obtained from [QTBUG-128398] or using the Qt SDK.
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。