eranif / codelite

A multi purpose IDE specialized in C/C++/Rust/Python/PHP and Node.js. Written in C++
https://codelite.org
GNU General Public License v2.0
2.09k stars 448 forks source link

[Bug]: LLVM Clang 17, GNU dbg or DAP debugger does not work #3276

Open Raduq91 opened 8 months ago

Raduq91 commented 8 months ago

What happened?

A bug happened!

Version

Other

Operating system

Windows 10

Steps to reproduce

What I got:
CodeLite 17.0.0 - Stable released on January 11, 2023

LLVM Clang 17.0.3
https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.3/LLVM-17.0.3-win64.exe

MSYS2 Clang
https://github.com/msys2/msys2-installer/releases/download/2023-10-26/msys2-x86_64-20231026.exe
(from MSYS2 ) (and used Windows - CodeLite Documentation )

pacman -Sy git                                  \
           openssh                              \
           mingw-w64-clang-x86_64-gdb           \
           mingw-w64-clang-x86_64-toolchain     \
           mingw-w64-clang-x86_64-python3       \
           mingw-w64-clang-x86_64-cmake         \
           mingw-w64-clang-x86_64-libffi        \
           mingw-w64-clang-x86_64-jq            \
           mingw-w64-clang-x86_64-libxml2       \
           unzip

Codelite settings: MakeFile Generator: CodeLite Makefile Generator Compiler gcc-17.0.2(clang msys64)

Modified by MakeFile Generator: Output File: $(ProjectName).exe Executable to Run/Debug: $(WorkspacePath)/build-$(WorkspaceConfiguration)/bin/$(OutputFile) Working Directory: $(WorkspacePath)/build-$(WorkspaceConfiguration)/lib

Debug Adapter Client: Command: E:\CodeLite\LLDB_cpptools-win64\extension\debugAdapters\bin\OpenDebugAD7.exe --server (edit) E:\CodeLite\compilar\msys64-clang\clang64\bin\lldb-vscode.exe -p 4711 Connection string: tcp://127.0.0.1:4711

If I compile ‘hello world’ example with: MakeFile Generator: CodeLite Makefile Generator Compiler: gcc-17.0.2(clang msys64)

Both GNU DBG and Debug Adapter Client work normaly.

Build Output:

E:/CodeLite/compilar/msys64-clang/clang64/bin/mingw32-make.exe -j16 -e -f  Makefile
"----------Building project:[ test - Debug ]----------"
mingw32-make[1]: Entering directory 'E:/CodeLite/proiecte/test'
E:/CodeLite/compilar/msys64-clang/clang64/bin/g++.exe  -c  "E:/CodeLite/proiecte/test/main.cpp" -gdwarf-2 -fstandalone-debug -O0 -Wall  -o ../build-Debug/test/main.cpp.o -I. -I.
E:/CodeLite/compilar/msys64-clang/clang64/bin/g++.exe -o ..\build-Debug\bin\test.exe @../build-Debug/test/ObjectsList.txt -L.
mingw32-make[1]: Leaving directory 'E:/CodeLite/proiecte/test'
=== build completed successfully (0 errors, 0 warnings) ===

If I compile ‘hello world’ example with: MakeFile Generator: CodeLite Makefile Generator Compiler: gcc-17.0.3(clang llvm)

No debugger works. GNU DGB: nothing happens Debug Adapter Client: The debug interface that stays for less than half a second (using DAP: Adding ‘std::system(“pause”);’ the debug interface does not close, Continue does nothing, Stop works, Next does nothing, Pause works and Next works in Assembly. Breakpoints Appear in the list but are not respected)

Build Output:

E:/CodeLite/compilar/msys64-clang/clang64/bin/mingw32-make.exe -j16 -e -f  Makefile
"----------Building project:[ test - Debug ]----------"
mingw32-make[1]: Entering directory 'E:/CodeLite/proiecte/test'
E:/CodeLite/compilar/LLVM-17.0.3-Clang/bin/clang++.exe  -c  "E:/CodeLite/proiecte/test/main.cpp" -m64 -g -O0 -gdwarf-2 -Wall -fstandalone-debug  -o ../build-Debug/test/main.cpp.o -I. -I.
E:/CodeLite/compilar/LLVM-17.0.3-Clang/bin/clang++.exe -o ..\build-Debug\bin\test.exe @../build-Debug/test/ObjectsList.txt -L.
mingw32-make[1]: Leaving directory 'E:/CodeLite/proiecte/test'
=== build completed successfully (0 errors, 0 warnings) ===

So with msys2 clang/g++ , GNU DBG and DAP works, but not with LLVM Clang. LLVM Clang does not come with make(or is named something else?) and I use ‘mingw32-make.exe -j16’ from msys2 clang, is this a problem? Do I need to pass something else to the compiler to make debugger working?



### Relevant log output

_No response_