MINGW-packages
MINGW-packages copied to clipboard
The mingw64 lldb-vscode works differently to the clang64 version
The lldb-vscode.exe from the clang64 by default detects and intercepts an exception that then propagates to the DAP client as a stop, but the lldb-vscode.exe from the mingw64 does not detect or intercept an exception, so the app exits and the DAP client sees the app exit.
For detailed low level info on the investigation Eranif and myself have done on this have a look at the following wxWidget DAP client library issue: https://github.com/eranif/dbgd/issues/7
I would expect that both lldb-vscode.exe work the same and detect and intercept exceptions by default as this is how the Linux and MacOS versions work.
The lldb-vscode.exe from the clang64 by default detects and intercepts an exception that then propagates to the DAP client as a stop, but the lldb-vscode.exe from the mingw64 does not detect or intercept an exception, so the app exits and the DAP client sees the app exit.
This is not the case, both programs work exactly the same in this regard.
I guess the problem is within libgcc and binaries built by Clang from CLANG64 subsystem do work because they use libunwind instead of libgcc.
You should be able to easily confirm it by running both debuggers on exactly the same binary. IIUC you have tested mingw64/bin/lldb
and clang64/bin/lldb
on two different binaries.
I agree lldb.exe works correctly and have tested it as posted in the info in the link I included. The issue is with lldb-vscode.exe, which is for DAP debugging.
To test it you will need a DAP compatible debugger. The github repo link src includes one that can be used if you do not have one, but it requires Codelite.
I did some more testing and found the following:
Mingw64 compiler | Clang64 compiler | |
---|---|---|
MingW64 lldb-vscode.exe | FAILS | PASS |
Clang64 lldb-vscode.exe | FAILS | PASS |
As such is it possible to change the MingW64 executable build to get it to work? Compiler flags, different library linked in code startup change. I am open to any potential changes.
As such is it possible to change the MingW64 executable build to get it to work?
Hard to tell without knowing what makes it work.
Compiler flags, different library linked in code startup change. I am open to any potential changes.
You could try building LLDB in MINGW64 environment using:
-
CC=clang CXX=clang++ LD=clang
- adding
LDFLAGS=-fuse-ld=lld
- finally step 1 with
CXXFLAGS=-stdlib=libc++ LDFLAGS='-fuse-ld=lld -stdlib=libc++'
I have been able work around the problem bty to solve this by using the DAP setExceptionBreakpoints request to enable the filters that were set to false.