Skip to content

Commit ff5b107

Browse files
authored
Merge pull request MicrosoftDocs#4778 from sinemakinci1/main
Updating CMake Debugging Docs to have CMake Debugger
2 parents cf3ee7c + 8b9cc44 commit ff5b107

File tree

6 files changed

+16
-2
lines changed

6 files changed

+16
-2
lines changed

docs/build/configure-cmake-debugging-sessions.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,28 @@ Native CMake support is available in Visual Studio 2017 and later. To see the do
1616

1717
All executable CMake targets are shown in the **Startup Item** dropdown in the toolbar. Select one to start a debugging session and launch the debugger.
1818

19-
![Screenshot of the CMake startup item dropdown.](media/cmake-startup-item-dropdown.png "CMake startup item dropdown")
19+
:::image type="complex" source="media/new-dropdowns.png" alt-text="Screenshot of the CMake startup items.":::
20+
There is a play button dropdown to select the current debug target. It shows your debug targets. In this example, the HelloWorld.exe debug target is available.
21+
:::image-end:::
2022

2123
You can also start a debug session from Solution Explorer. First, switch to **CMake Targets View** in the **Solution Explorer** window.
2224

23-
![Screenshot of the CMake targets view command.](media/cmake-targets-view.png "CMake Targets View menu item")
25+
:::image type="complex" source="media/switch-to-targets-view.png" alt-text="Screenshot of the CMake Targets View menu":::
26+
The solution explorer is shown. A right-click on an item in the Folder View has opened a menu. On that menu, the Switch to Targets View item is highlighted.
27+
:::image-end:::
2428

2529
Then, right-click on an executable and select **Debug**. This command automatically starts debugging the selected target based on your active configuration.
2630

31+
:::image type="complex" source="media/debug-targets-view.png" alt-text="Screenshot of the CMake Targets View debug option menu.":::
32+
When you right-click on a target in the CMake Targets view, there is an option to debug a chosen target. The Debug option is highlighted.
33+
:::image-end:::
34+
35+
Starting in Visual Studio 2022 Version 17.6, you can also start a debugging session on your CMakeLists.txt file. To do so, just set a breakpoint in your CMakeLists.txt file and run **Configure Project with CMake Debugger** from the **Project** dropdown.
36+
37+
:::image type="complex" source="media/cmake-debugger-entry.png" alt-text="Screenshot of the CMake Debugger dropdown.":::
38+
The Project dropdown is shown. The option to Configure Project with CMake debugger is highlighted.
39+
:::image-end:::
40+
2741
## Customize debugger settings
2842

2943
You can customize the debugger settings for any executable CMake target in your project. They're found in a configuration file called *launch.vs.json*, located in a *`.vs`* folder in your project root. A launch configuration file is useful in most debugging scenarios, because you can configure and save your debugging setup details. There are three entry points to this file:
21.9 KB
Loading
17.4 KB
Loading
35.3 KB
Loading

docs/build/media/new-dropdowns.png

7.25 KB
Loading
32.5 KB
Loading

0 commit comments

Comments
 (0)