[Development] [RFCs] Migrate from GCC MinGW to LLVM MinGW
Cristian Adam
cristian.adam at qt.io
Fri Jul 21 14:26:00 CEST 2023
On 07/21/2023 11:04, Martin Storsjö wrote:
- With LLDB: As LLDB supports both DWARF and PDB, it will prefer DWARF if such debug info was found. As other toolchain files that are linked in happen to have some DWARF in them, the executable will have a little bit of such debug info available, so LLDB ends up using that and not looking at the PDB. So first I run "strip hello-crash.exe" to get rid of the residual DWARF, after that "lldb hello-crash.exe" followed by "run", and I get the crash easily visible. (This case could probably be made nicer.)
If LLDB worked for you without, possibly without stripping out residual DWARF, but WinDbg didn't, it sounds like it might have ended up using DWARF after all?
// Martin
Right, lldb was using the DWARF debugging information 🙁
I've attached 3 screenshots of Qt Creator using lldb:
1. Unstripped MaxiDump.exe showed the bad source line and the correct stacktrace (due to DWARF information)
2. Stripped MaxiDump.exe with LLVM MinGW's lldb showed only assembly with bad stacktrace
3. Stripped MaxiDump.exe with the official llvm.org binaries (MSVC flavor) showed also assembly but with proper stacktrace.
For number 3 I've tried with a copy of "c:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\DIA SDK\bin\amd64\msdia140.dll" in "c:\Program Files\LLVM\bin" and without.
I know that the llvm.org lldb binary is built using DIA SDK.
Then I decided to test clang-cl 16.0.6 and test the two lldb.exe versions.
The LLVM MinGW (stripped) binary and dmp files:
* MaxiDump.exe 15,872 bytes
* MaxiDump.dmp 29,878,132 bytes
The clang-cl binary and dmp files:
* MaxiDump.exe 15,360 bytes
* MaxiDump.dmp 28,460,315 bytes
They ware more or less the "same".
Then I loaded the "core" file and the results are:
* MSVC lldb.exe loaded the source file, but pointed at the wrong line, also the stack trace was missing one level
* MinGW lldb.exe loaded the source file at the right location and the stacktrace was fine!
Since MinGW lldb.exe can load a MiniDump file produced by clang-cl just fine, I assume there is a bug in the generation step of the MiniDump when using the llvm mingw binaries.
Cheers,
Cristian.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20230721/f534ffa7/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qtcreator-11-maxidump-mingw-lldb.png
Type: image/png
Size: 68001 bytes
Desc: qtcreator-11-maxidump-mingw-lldb.png
URL: <http://lists.qt-project.org/pipermail/development/attachments/20230721/f534ffa7/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qtcreator-11-maxidump-mingw-lldb-stripped.png
Type: image/png
Size: 108632 bytes
Desc: qtcreator-11-maxidump-mingw-lldb-stripped.png
URL: <http://lists.qt-project.org/pipermail/development/attachments/20230721/f534ffa7/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qtcreator-11-maxidump-msvc-lldb-stripped.png
Type: image/png
Size: 111687 bytes
Desc: qtcreator-11-maxidump-msvc-lldb-stripped.png
URL: <http://lists.qt-project.org/pipermail/development/attachments/20230721/f534ffa7/attachment-0007.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qtcreator-11-maxidump-clang-cl-mingw-lldb.png
Type: image/png
Size: 67457 bytes
Desc: qtcreator-11-maxidump-clang-cl-mingw-lldb.png
URL: <http://lists.qt-project.org/pipermail/development/attachments/20230721/f534ffa7/attachment-0008.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qtcreator-11-maxidump-clang-cl-msvc-lldb.png
Type: image/png
Size: 67836 bytes
Desc: qtcreator-11-maxidump-clang-cl-msvc-lldb.png
URL: <http://lists.qt-project.org/pipermail/development/attachments/20230721/f534ffa7/attachment-0009.png>
More information about the Development
mailing list