From 6b14bb8f0102481007350b373ebac34506e40e1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Blomstr=C3=B6m?= <39986991+AntBlo@users.noreply.github.com> Date: Thu, 2 May 2024 23:42:18 +0200 Subject: [PATCH] Add info about enabling debugging for new contributors (#1719) --- CONTRIBUTING.md | 9 +++++++++ .../src/getting-started/configuring-your-editor.md | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 778d88032..7c0ca4f19 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -69,6 +69,15 @@ the issue or issues that your changes address. - [vadimcn.vscode-lldb](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb) 2. Open `Command Palette` with Ctrl+Shift+P or F1 and type `LLDB: Generate Launch Configurations from Cargo.toml` then select it, this will generate a file that should be saved as `.vscode/launch.json`. +You may also want to enable debugging by creating a `.vscode/settings.json` file: + ```json + { + "rust-analyzer.runnables.extraEnv": { + "CARGO_PROFILE_DEV_DEBUG": true + } + } + ``` + since this repo has `debug = 0` in the root `Cargo.toml` to speed up compilation. 3. Now you can enable breakpoint on code through IDE and then start debugging the library/binary you want, such as the following example: diff --git a/contributor-book/src/getting-started/configuring-your-editor.md b/contributor-book/src/getting-started/configuring-your-editor.md index 3c879270e..601a43d66 100644 --- a/contributor-book/src/getting-started/configuring-your-editor.md +++ b/contributor-book/src/getting-started/configuring-your-editor.md @@ -25,6 +25,15 @@ To use the debugger, follow these steps: that should be saved as `.vscode/launch.json`. 2. Select the configuration from the "run and debug" side panel, then select the target from the list. + You may also want to enable debugging by creating a `.vscode/settings.json` file: + ``` + { + "rust-analyzer.runnables.extraEnv": { + "CARGO_PROFILE_DEV_DEBUG": true + } + } + ``` + since this repo has `debug = 0` in the root `Cargo.toml` to speed up compilation. 3. Now you can enable breakpoints on code through IDE then start debugging the library/binary you want, like in the following example: