Skip to content

Commit 7191492

Browse files
authored
documentation on natvis support (#4858)
1 parent cecdf22 commit 7191492

3 files changed

Lines changed: 29 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Features:
2323

2424
Improvements:
2525
- Run tests sequentially in alphabetical order (matching the Test Explorer display order) when `cmake.ctest.allowParallelJobs` is disabled. [#4829](https://github.com/microsoft/vscode-cmake-tools/issues/4829)
26+
- Document how to configure `cmake.debugConfig.visualizerFile` to use custom Natvis files with quick debugging, without requiring a `launch.json`. [#4616](https://github.com/microsoft/vscode-cmake-tools/issues/4616)
2627
- Add `.github/copilot-instructions.md` to ground GitHub Copilot in the repo's architecture and coding conventions.
2728
- Clicking on a CTest in the Project Outline now navigates to the test source file, matching the existing Test Explorer behavior. [#4773](https://github.com/microsoft/vscode-cmake-tools/issues/4773)
2829
- Clicking on a CTest unit test in the Test Explorer now navigates to the test source file by matching the test executable to its CMake target's source files. [#4449](https://github.com/microsoft/vscode-cmake-tools/issues/4449)

docs/cmake-settings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Options that support substitution, in the table below, allow variable references
4242
| `cmake.ctestArgs` | An array of additional arguments to pass to CTest. | `[]` | yes |
4343
| `cmake.ctestDefaultArgs` | Default arguments to pass to CTest. | `["-T", "test", "--output-on-failure"]` | no |
4444
| `cmake.ctestPath` | Path to CTest executable. | `null` | no |
45-
| `cmake.debugConfig`| The debug configuration to use when debugging a target. When `type` is specified, automatic debugger detection is skipped and a custom debug adapter can be used. Additional properties required by the debug adapter can be added freely. | `null` (no values) | yes |
45+
| `cmake.debugConfig`| The debug configuration to use when debugging a target. When `type` is specified, automatic debugger detection is skipped and a custom debug adapter can be used. Additional properties required by the debug adapter can be added freely. See [Debug and launch](debug-launch.md#customize-the-debug-adapter) for examples, including Natvis via `visualizerFile` without a `launch.json`. | `null` (no values) | yes |
4646
| `cmake.defaultActiveFolder`| The name of active folder, which be used as default (Only works when `cmake.autoSelectActiveFolder` is disabled). | `""` | no |
4747
| `cmake.defaultVariants` | Override the default set of variants that will be supplied when no variants file is present. See [CMake variants](variants.md). | See package.json | no |
4848
| `cmake.deleteBuildDirOnCleanConfigure` | If `true`, delete build directory during clean configure. | `false` | no |

docs/debug-launch.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,33 @@ Add the following to your `.vscode/settings.json`:
5757

5858
Then run **CMake: Debug Target** from the command palette. CMake Tools will automatically fill in `program`, `cwd`, and `name` from the selected target, and apply your settings on top. Any property recognized by the debug adapter can be added to `cmake.debugConfig`.
5959

60+
### Use Natvis without a launch.json
61+
62+
If you use the cpptools debug adapters (`cppvsdbg` or `cppdbg`), you can provide custom Natvis files directly in `cmake.debugConfig` via `visualizerFile`.
63+
64+
Add this to your `.vscode/settings.json`:
65+
66+
```jsonc
67+
{
68+
"cmake.debugConfig": {
69+
"visualizerFile": "${workspaceFolder}/.vscode/types.natvis"
70+
}
71+
}
72+
```
73+
74+
You can also specify multiple Natvis files:
75+
76+
```jsonc
77+
{
78+
"cmake.debugConfig": {
79+
"visualizerFile": [
80+
"${workspaceFolder}/.vscode/base.natvis",
81+
"${workspaceFolder}/.vscode/project.natvis"
82+
]
83+
}
84+
}
85+
```
86+
6087
If you omit `type`, CMake Tools falls back to the original behavior: auto-detecting `cppdbg` or `cppvsdbg` from the CMake cache.
6188

6289
## Debug using a launch.json file

0 commit comments

Comments
 (0)