Skip to content

Commit ebd07b1

Browse files
polinasokhyangah
authored andcommitted
src/goDebugConfiguration+docs: improve dlvLoadConfig communication
Expands the warning and adds FAQ entry. Updates #1318 Change-Id: Idb74b855d1d7efed997a2b3e7f42127fed2ca8be GitHub-Last-Rev: 5153c1b GitHub-Pull-Request: #1715 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/344370 Reviewed-by: Hyang-Ah Hana Kim <[email protected]> Reviewed-by: Suzy Mueller <[email protected]> Trust: Hyang-Ah Hana Kim <[email protected]> Run-TryBot: Hyang-Ah Hana Kim <[email protected]> TryBot-Result: kokoro <[email protected]>
1 parent c3de634 commit ebd07b1

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

docs/debugging.md

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Note that the extension still uses the legacy debug adapter for remote debugging
5959

6060
If you want to switch to `legacy` for only a subset of your launch configurations, you can use [the `debugAdapter` attribute](#launchjson-attributes) to switch between `"dlv-dap"` and `"legacy"` mode.
6161

62-
If you chose to switch to legacy because of bugs in the new debug adapter,
62+
If you chose to switch to legacy because of bugs or limitations in the new debug adapter,
6363
please [open an issue](https://github.com/golang/vscode-go/issues/new)
6464
to help us improve the new debug adapter.
6565
## Features
@@ -163,12 +163,12 @@ You can inspect variables in the VARIABLES section of the Run view or by hoverin
163163

164164
By default, the VARIABLES section hides global variables, and shows only local variables and function arguments. However, you can still inspect global variables from the DEBUG CONSOLE panel. If you prefer to have the VARIABLES section show global variables, set the `showGlobalVariables` attribute in the `launch.json` configuration, or set it in the `go.delveConfig` setting.
165165

166-
When you select a variable and right click from the VARIABLES section, the context menu will present shortcuts to features such as:
166+
When you select a variable and right click from the VARIABLES section, the context menu will present shortcuts to features such as:
167167

168-
* Set Value: you can set/modify simple string, numeric, pointer values. Using composite literals, or memory allocation is not supported.
169-
* Copy Value: this copies the value in clipboard.
170-
* Copy as Expression: this is useful when you need to query from the REPL in the DEBUG CONSOLE panel.
171-
* Add to Watch: this will automatically add the expression to the WATCH section.
168+
* `Set Value`: you can set/modify simple string, numeric, pointer values. Using composite literals, or memory allocation is not supported.
169+
* `Copy Value`: this copies the value in clipboard.
170+
* `Copy as Expression`: this is useful when you need to query from the REPL in the DEBUG CONSOLE panel.
171+
* `Add to Watch`: this will automatically add the expression to the WATCH section.
172172

173173
Shadowed variables will be marked with `()`.
174174

@@ -301,7 +301,7 @@ You can adjust the default value of the following configuration properties using
301301
* `showGlobalVariables`: Show global variables in the Debug view (default: `false`).
302302
* `substitutePath`: Path mappings to apply to get from a path in the editor to a path in the compiled program (default: `[]`).
303303

304-
⚠️ Where is the `dlvLoadConfig` setting? Delve debugger imposes variable loading limits to avoid loading too many variables at once and negatively impacting debugging latency. The legacy adapter supported `dlvLoadConfig` to adjust these limits for the duration of the session. The user therefore had to come up with a one-size-fits-all limit if the default behavior was not satisfactory. `dlv-dap` mode uses a different approach as described in [the Data Inspection section](#data-inspection). If this setting is configured and `dlv-dap` mode is used, the extension will show a warning prompt now. If the current variable loading behavior and internal limits are not working for you, please open an issue and share your feedback.
304+
⚠️ Where is the `dlvLoadConfig` setting? Delve debugger imposes variable loading limits to avoid loading too many variables at once and negatively impacting debugging latency. The legacy adapter supported `dlvLoadConfig` to adjust these limits for the duration of the session. The user therefore had to come up with a one-size-fits-all limit if the default behavior was not satisfactory. `dlv-dap` mode uses a different approach as described in [the Data Inspection section](#data-inspection). If this setting is configured and `dlv-dap` mode is used, the extension will show a warning prompt now. If the current variable loading behavior and internal limits are not working for you, please [open an issue](https://github.com/golang/vscode-go/issues/new) and share your feedback.
305305

306306
<p align="center"><img src="images/dlv-load-config-warning.png" alt="dlvLoadConfig is invalid" width="50%"> </p>
307307

@@ -408,7 +408,7 @@ For simple launch cases, build the delve binary, and configure `"go.alternateToo
408408
```
409409

410410
<p align="center"><img src="images/debug-output.png" alt="Go Debug output channel" width="100%"></p>
411-
If you are having issues with seeing logs and/or suspect problems in the extension's integration, you can start the Delve DAP server from a separate terminal and configure the extension to directly connect to it. Please remember to file an issue if you encounter any logging-related issues.
411+
If you are having issues with seeing logs and/or suspect problems in the extension's integration, you can start the Delve DAP server from a separate terminal and configure the extension to directly connect to it. Please remember to [file an issue](https://github.com/golang/vscode-go/issues/new) if you encounter any logging-related problems.
412412

413413
```
414414
$ dlv-dap dap --listen=:12345 --log --log-output=dap
@@ -431,6 +431,16 @@ $ dlv-dap dap --listen=:12345 --log --log-output=dap
431431

432432
To support being able to set breakpoints while the program is running, the debug adapter needs to stop the program. Due to the extra synchronization required to correctly resume the program, the debug adapter currently sends a stopped event. This means that if you are editing breakpoints while the program is running, you will need to hit continue to continue your debug session. We plan to change the behavior of the debug adapter for more seamless editing of breakpoints. You can track the progress [here](https://github.com/golang/vscode-go/issues/1676).
433433

434+
### I need to view large strings. How can I do that if `dlvLoadConfig` with `maxStringLen` is deprecated?
435+
436+
The legacy adapter used `dlvLoadConfig` as one-time session-wide setting to override dlv's conservative default variable loading limits, intended to protect tool's performance. The new debug adapter is taking a different approach with on-demand loading of composite data and updated string limits, relaxed when interacting with individual strings. In particular, if the new default limit of 512, applied to all string values in the variables pane, is not sufficient, you can take advantage of a larger limit of 4096 with one of the following:
437+
438+
* Hover over the variable in the source code
439+
* `Copy as Expression` to query the string via REPL in the DEBUG CONSOLE panel
440+
* `Copy Value` to clipboard
441+
442+
Please [open an issue](https://github.com/golang/vscode-go/issues/new) if this is not sufficient for your use case or if you have any additional feedback.
443+
434444
[Delve]: https://github.com/go-delve/delve
435445
[VS Code variables]: https://code.visualstudio.com/docs/editor/variables-reference
436446
[snippets]: https://code.visualstudio.com/docs/editor/userdefinedsnippets

src/goDebugConfiguration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ export class GoDebugConfigurationProvider implements vscode.DebugConfigurationPr
193193
) {
194194
this.showWarning(
195195
'ignoreDebugDlvConfigWithDlvDapWarning',
196-
"User specified 'dlvLoadConfig' setting will be ignored by debug adapter 'dlv-dap'."
196+
"'dlvLoadConfig' is deprecated with dlv-dap debug adapter.\n\nDlv-dap loads composite data on demand and uses increased string limits on source code hover, in Debug Console and via Copy Value. Please file an issue if these are not sufficient for your use case."
197197
);
198198
}
199199
if (!debugConfiguration.hasOwnProperty('dlvLoadConfig') && dlvConfig.hasOwnProperty('dlvLoadConfig')) {

0 commit comments

Comments
 (0)