On 07/21/2023 14:26, Cristian Adam via Development wrote:
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.


I've opened up Bad MiniDump "core" file generation · Issue #356 · 
mstorsjo/llvm-mingw 
(github.com)<https://github.com/mstorsjo/llvm-mingw/issues/356> for better 
tracking.

Cheers,
Cristian.

-- 
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development

Reply via email to