You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
c0e33de src/goEnvironmentStatus: update hard coded go versions
81f6db9 src/goModules: update example module names to reflect naming guidelines
ba2daa3 src/goMain.ts: disable check for active debug session
d32a326 package.json: drop minify when packaging
cc6f312 src/debugAdapter: let infer path logic handle non-existing files
5a59bbf src/goDebugConfiguration: remote attach should not be warned about port
1d258a2 src/goTest: group test explorer settings, fix bugs
104052d package.json: update gopls settings (v0.7.2)
dc044d1 test/integration: write legacy DA trace line-by-line
3a09d5d test/integration: log DAP trace when legacy adapter test fails
9248382 src/config: remove WrappedConfiguration in favor of trusted workspace
fb6208d docs: change blog.golang.org to go.dev/blog
ab3d3a6 src/goDebugFactory: add --check-go-version=false
9a9ec9a src/goTest: cleanup
b9bf001 src/goTest: basic profiling support
850fefd test/integration/goTest: remove unused imports
d1d9901 src/goTest: fix test run cancellation
977e93e docs/debugging.md: add FAQ section for next while nexting
6019957 src/goTest: support running sub-tests
9021bff src/goTest: do not set range for dynamic subtests
1c36262 src/goDebugConfiguration: show warning that port is being used
09d4bbe docs/debugging.md: update description of port and host
41279a6 Revert "src/goDebugFactory.ts: direct users to use 'debugServer' for remote"
a4c2c4a CHANGELOG.md: prep for v0.27.2
53accf5 src/goDebugFactory: fix debugger launch on Windows
e6c2d3c all: change learn.go.dev to go.dev/learn
aa3293c src/goDebugConfiguration: massage launch config for debug/test
289839c test/integration/goDebug.test.ts: enable disconnect tests
c069def src/goTest: remove unused names
e53d60e src/goTest: clean up test ID parsing
3e12e73 src/goTest: split up test explorer
a1cc5e5 src/goInstallTools: unpin dlv-dap version, and pick master
2ff7ead src/goTestExplorer: handle stretchr suites
33d814a .github: update issue template to collapse version details
ebd07b1 src/goDebugConfiguration+docs: improve dlvLoadConfig communication
c3de634 codelens: fix regexps for test funcs names
2f484bd src/goTestExplorer: handle weird doc URIs on load
c79e0c4 src/goDebugFactory: increase timeout for dlv dap server start
3f434bd all: bundle with esbuild instead of webpack
83aa2cb src/goTestExplorer: implement a test provider for the new test api
945a47e package.json: recognize *.*tmpl as go template files
ad3a6ca all: add support for go.work files as go.mod files
0ff533d tools/relnotes: use types from work-stats package
e81d5fc CHANGELOG.md: v0.27.1 change log
46b3efe src/goToolsInformation: use the commit hash to pin dlv-dap version
e0a268b package-lock.json: npm audit fix
336b9f7 src/goDebugConfiguration: convert processId to int
b4226ab package.json: add support for replay and core debug modes
6060589 docs/debugging.md: add FAQ section
6a6fdb6 src/goDebugFactory: log errors without killing delve process
4e7f6f5 src/goMain: export a small API
8a4731f package.json: start v0.28.0-dev
cd72252 package.json: use fileDirname for Launch Package snippet
f77de39 CHANGELOG.md: mention the removal of 'port' support in dlv-dap
45b06e0 src/goDebugFactory.ts: direct users to use 'debugServer' for remote
Updates #1776
Change-Id: Ifd897cf869e1f1a485026d0631b88b00d2ec83ce
Copy file name to clipboardExpand all lines: docs/debugging.md
+18-2Lines changed: 18 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -246,12 +246,12 @@ Here is the list of attributes specific to Go debugging.
246
246
|`dlvFlags`| Extra flags for `dlv`. See `dlv help` for the full list of supported. Flags such as `--log-output`, `--log`, `--log-dest`, `--api-version`, `--output`, `--backend` already have corresponding properties in the debug configuration, and flags such as `--listen` and `--headless` are used internally. If they are specified in `dlvFlags`, they may be ignored or cause an error.<br/> | <center>_same as Launch_</center>|
247
247
|`env`| Environment variables passed to the program.<br/> | <center>_n/a_</center> |
248
248
|`envFile`| Absolute path to a file containing environment variable definitions. Multiple files can be specified by provided an array of absolute paths<br/>(Default: `${workspaceFolder}/.env`)<br/> | <center>_n/a_</center> |
249
-
|`host`|The host name of the machine the delve debugger will be listening on.<br/>(Default: `"127.0.0.1"`)<br/> | <center>_same as Launch_</center>|
249
+
|`host`|In legacy mode, this will only apply to remote-attach configurations, which will look for "dlv ... --headless --listen=<host>:<port>" server started externally. In dlv-dap mode (which does not yet support remote-attach), this will apply to all other configurations. The extension will try to connect to an external server started with "dlv dap --listen=<host>:<port>" to ask it to launch/attach to the target process.<br/>(Default: `"127.0.0.1"`)<br/> | <center>_same as Launch_</center>|
250
250
|`logDest`| dlv's `--log-dest` flag. See `dlv log` for details. Number argument is not allowed. Supported only in `dlv-dap` mode, and on Linux and Mac OS.<br/> | dlv's `--log-dest` flag. See `dlv log` for details. Number argument is not allowed. Supported only in `dlv-dap` mode and on Linux and Mac OS.<br/> |
251
251
|`logOutput`| Comma separated list of components that should produce debug output. Maps to dlv's `--log-output` flag. Check `dlv log` for details.<br/><p>Allowed Values: `"debugger"`, `"gdbwire"`, `"lldbout"`, `"debuglineerr"`, `"rpc"`, `"dap"`<br/>(Default: `"debugger"`)<br/> | <center>_same as Launch_</center>|
252
252
|`mode`| One of `auto`, `debug`, `test`, `exec`, `replay`, `core`. In `auto` mode, the extension will choose either `debug` or `test` depending on active editor window.<br/><p>Allowed Values: `"auto"`, `"debug"`, `"test"`, `"exec"`, `"replay"`, `"core"`<br/>(Default: `auto`)<br/> | Indicates local or remote debugging. Local maps to the `dlv attach` command, remote maps to `connect`. `remote` is not supported in `dlv-dap` mode currently. Use `host` and `port` instead.<br/><p>Allowed Values: `"local"`, `"remote"`<br/>(Default: `local`)<br/> |
253
253
|`output`| Output path for the binary of the debugee.<br/>(Default: `"debug"`)<br/> | <center>_n/a_</center> |
254
-
|`port`|The port that the delve debugger will be listening on.<br/>(Default: `2345`)<br/> | <center>_same as Launch_</center>|
254
+
|`port`|In legacy mode, this will only apply to remote-attach configurations, which will look for "dlv ... --headless --listen=<host>:<port>" server started externally. In dlv-dap mode (which does not yet support remote-attach), this will apply to all other configurations. The extension will try to connect to an external server started with "dlv dap --listen=<host>:<port>" to ask it to launch/attach to the target process.<br/>(Default: `2345`)<br/> | <center>_same as Launch_</center>|
255
255
|`processId`| <center>_n/a_</center> | <br/><p><b>Option 1:</b> Use process picker to select a process to attach, or Process ID as integer.<br/><p>Allowed Values: `"${command:pickProcess}"`, `"${command:pickGoProcess}"`<br/><br/><p><b>Option 2:</b> Attach to a process by name. If more than one process matches the name, use the process picker to select a process.<br/><br/><p><b>Option 3:</b> The numeric ID of the process to be debugged. If 0, use the process picker to select a process.<br/><br/>(Default: `0`)<br/> |
256
256
|`program`| Path to the program folder (or any go file within that folder) when in `debug` or `test` mode, and to the pre-built binary file to debug in `exec` mode. If it is not an absolute path, the extension interpretes it as a workspace relative path.<br/>(Default: `"${workspaceFolder}"`)<br/> | <center>_n/a_</center> |
257
257
|`remotePath`| <center>_n/a_</center> | (Deprecated) *Use `substitutePath` instead.*<br/>The path to the source code on the remote machine, when the remote path is different from the local machine. If specified, becomes the first entry in substitutePath.<br/>(Default: `""`)<br/> |
@@ -441,6 +441,22 @@ The legacy adapter used `dlvLoadConfig` as one-time session-wide setting to over
441
441
442
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
443
444
+
### Why does my debug session have an `invalid command` error when I try to step?
445
+
446
+
When stepping through a program on a particular goroutine, the debugger will make sure that the step is completed, even when interrupted by events on a different goroutine. If a breakpoint is hit on a different goroutine, the debug adapter will stop the program execution to allow you to inspect the state, even though the step request is still active.
447
+
448
+
If you attempt to make another step request you will get an `invalid command` error.
449
+
450
+
<palign="center"><imgsrc="images/invalidCommandExceptionInfo.png"alt="Disable breakpoints from the Breakpoints context menu"width="75%"> </p>
451
+
452
+
453
+
Use `Continue` to resume program execution.
454
+
455
+
If you do not want the step request to be interrupted, you can disable all breakpoints from VS Code from the context menu in the `Breakpoints` view.
456
+
457
+
<palign="center"><imgsrc="images/disablebps.png"alt="Disable breakpoints from the Breakpoints context menu"width="75%"> </p>
0 commit comments