Skip to content

Commit

Permalink
Sinemakinci/fix c make debug (#3371)
Browse files Browse the repository at this point in the history
* Update debug-launch.md

Fixing debugging to not be quick debugging references

* Add files via upload

New images for launching debugger

* Update debug-launch.md

fixing run without debugging section

* Add files via upload

* Add files via upload

* Add files via upload

* Update debug-launch.md

fixing images

* Add files via upload

* Delete docs/images/debug_target.png

* Add files via upload

* Delete docs/images/debug_target.png

* Add files via upload

* Update cmake-settings.md

adding debug config

* Update cmake-settings.md
  • Loading branch information
sinemakinci1 authored Oct 10, 2023
1 parent eee8703 commit 6c48439
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions docs/cmake-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Options that support substitution, in the table below, allow variable references
| `cmake.configureOnOpen` | Automatically configure CMake project directories when they are opened. | `null` (prompt for configure) | no |
| `cmake.configureSettings` | An object containing `key:value` pairs, which will be passed to CMake when configuring. The same as passing `-DVAR_NAME=ON` via `cmake.configureArgs`. NOTE: If you are setting an array argument within `cmake.configureSettings`, you should use array notation, i.e. `"CONFIGURE_SETTINGS_LIST": [ "a", "b" ]` | `null` (no values) | yes |
| `cmake.copyCompileCommands`| If not `null`, copies the `compile_commands.json` file generated by CMake to the path specified by this setting whenever CMake successfully configures. | `null` (do not copy the file) | yes |
| `cmake.debugConfig`| The debug configuration to use when debugging a target | `null` (no values) | yes |
| `cmake.defaultVariants` | Override the default set of variants that will be supplied when no variants file is present. See [CMake variants](variants.md). | | no |
| `cmake.environment` | An object containing `key:value` pairs of environment variables, which will be available when configuring, building, debugging, running or testing with CTest. | `null` (no environment variables) | yes |
| `cmake.generator` | Set to a string to override CMake Tools preferred generator logic. If set, CMake will unconditionally use it as the `-G` CMake generator command line argument. ||no|
Expand Down
16 changes: 10 additions & 6 deletions docs/debug-launch.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,22 @@ By default, launching or debugging an executable target causes it to be built fi

The first time you run target debugging, CMake Tools asks for you to specify a target, which will be persisted between sessions.

The active launch target is shown in the status bar to the right of the *Debug* button:
The active launch target is shown in the status bar to the right of the *Debug* and *Play* buttons:

![Image of launch target to the right of the debug button](images/launch_target.png)
![Image of launch target to the right of the debug and run button](images/launch_debugv2.png)

Selecting the active launch target button will show the launch target selector so that you can change the active launch target.

## Quick debugging
## Debugging without a launch.json

Quick-debugging lets you start a debugger on a target without creating a `launch.json`.
CMake Tools lets you start a debugger on a target without creating a `launch.json`.

> **Note:**
> Only the debugger from Microsoft's `vscode-ms-vscode.cpptools` extension supports quick-debugging. See [Debug using a launch.json file](#debug-using-a-launchjson-file), below, for information about `launch.json` and using other debuggers.
Start quick debugging by running the *CMake: Debug Target* command from the VS Code command pallette, or by pressing the keyboard shortcut (the default is **Ctrl+F5**).
Start a debugging session on the active target by running the *CMake: Debug* command from the VS Code command pallette, by selecting the Debug button in the status bar, or by pressing the keyboard shortcut (the default is **Ctrl+F5**).

![Image of launching the debugger for the selected target](images/debug_target.png)

> **Note:**
> Quick-debugging does not let you specify program arguments or other debugging options. See the next section for more options.
Expand Down Expand Up @@ -223,7 +225,9 @@ Depending on your configuration or your settings, there may need to be additiona

## Run without debugging

If you want to run a target without debugging it, from VS Code's command pallette, run the *CMake: Execute the current target without a debugger* command, or by pressing the keyboard shortcut (the default `Shift+F5`).
You can run a target without debugging it, by running the *CMake: Run without Debugging* from VS Code's command palatte, by selecting the play button in the status bar, or by pressing the keyboard shortcut (the default `Shift+F5`).

![Image of launching the selected target in the terminal window](images/run_target.png)

The output of the target will be shown in an integrated terminal.

Expand Down
Binary file added docs/images/debug_target.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/launch_debugv2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/run_target.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6c48439

Please sign in to comment.