microsoft / microsoft/vscode-cmake-tools

CMake+MinGW+Clang not start `cppdbg` debugger

Open
#3,667 11 comments 0 reactions 0 assignees View on GitHub
bug Feature: debug/launch more info needed
Dominant language
TypeScript
Stars
1.7k
Forks
546
Avg merge
2d 16h
Merged PRs (30d)
32

Description

env:
VSCode 1.87.2
c/c++ v1.19.6
CMakeTools v1.17.17
cmake 3.29
clang 18.1.1

repro step:
1. create any simple c/c++ project.
main.c:
```
#include

int main(int argc, char *argv[]) {
printf("test\n");
while (1) {

}
return 0;
}
```

CMakeLists.txt:
```
cmake_minimum_required(VERSION 3.25.0)
project(x)

add_compile_options(
-gdwarf-4
)
aux_source_directory(. SRC)
add_executable(${PROJECT_NAME} ${SRC})
```

2. switch kit `[Clang 18.1.1 x86_64-w64-windows-gnu(mingw64)]` from VSCode status bar for `cmake-tools`
3. click debug button from VSCode status bar for `cmake-tools`
![image](https://github.com/microsoft/vscode-cmake-tools/assets/8215947/25c54376-3094-4c28-a381-071f80a2f4ee)
4. `cmake-tools` will start the `cppvsdbg` debugger, not `cppdbg`
![image](https://github.com/microsoft/vscode-cmake-tools/assets/8215947/1da90720-df09-401c-91c0-a583d1230f73)
![image](https://github.com/microsoft/vscode-cmake-tools/assets/8215947/29514ef7-b97a-4d75-9682-3ce770ebaddb)

so, it does not hit the breakpoint when debugging.

![image](https://github.com/microsoft/vscode-cmake-tools/assets/8215947/91330a54-30dd-4026-8d73-54f134545401)

switch kit to `gcc`, it start the `cppdbg` debugger correctly.

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with the shown main.c and CMakeLists.txt, using the Clang MinGW kit and the CMake Tools debug button. Compare the debugger selected for the Clang kit with the gcc kit, then verify that the Clang configuration starts cppdbg and reaches the breakpoint instead of starting cppvsdbg.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp, vscode
Domain
build-system, devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.