-
Notifications
You must be signed in to change notification settings - Fork 645
Remote debugging to Docker container gives empty values for all variables #2601
Comments
@Strum355 I've got the same issue today but attaching to remote pid on a local machine. Start DLV like this: PS> dlv debug --headless --listen=:2345 --api-version=2 In VS Code, attach using the following config: "name": "Attach to Process",
"type": "go",
"request": "launch",
"mode": "remote",
"remotePath": "${workspaceRoot}/main.go",
"port": 2345,
"host": "127.0.0.1",
"program": "${workspaceRoot}/main.go",
"env": {},
"apiVersion": 2,
"dlvLoadConfig": {
"followPointers": true,
"maxVariableRecurse": 1,
"maxStringLen": 1000,
"maxArrayValues": 1000,
"maxStructFields": -1
} As far as I can see, it started happening after VS Code automatically had installed Go extension |
Can confirm v0.10.2 works, so theres a pretty big regression in v0.11.0 :/ v0.11.0 seems to be down as an update to the debugging side of the extension so that seems likely |
@Strum355 @olegburov Is this only when attaching to a headless delve instance? Are the variables showing up fine in the case of starting the program as part of debugging itself? i.e when 6a77627 is the only change around debugging that was made in v0.11.0. None of the change was around how the variables are displayed though. @Strum355 In your logs, under "VariablesResponse", the value for |
@olegburov Are you using the same debug configuration both in v0.10.2 and v0.11.0? |
@ramya-rao-a, yes I used the same between |
I was just asking to narrow down on what are the changes between the 2 attempts you had made other than changing the Go extension version. I am able to repro the same and see the empty values being returned from delve. Will dig deeper into what changed to get this difference between the 2 versions |
I found the issue. While refactoring the code around starting delve in 6a77627, we had an early exit in case of remote debugging (as the extension doesn't have to start delve in this case). The part where we set the I have pushed a fix for it, can either of you try it out by using the latest beta version of this extension? |
@ramya-rao-a, thanks a lot for looking into this. With |
Thanks for confirming @olegburov! This issue is now fixed in the latest update (0.11.1) to the Go extension |
And I see the same behaviour in 0.10.2. |
OK, it looks like the issue goes away if I set maxVariableRecurse to 3 |
Go version: 1.12.6
vscode-go version: 0.11.0
Delve version: commit a7c2d837d5fe920fb7a08812cebd6981d0a09035
launch.json
delve command in Docker container
dlv debug ./cmd/<repo_name> -l 0.0.0.0:3456 --headless=true --api-version=2 --log
VSCode debugger:
Delve CLI:
VSCode Debug Console
The text was updated successfully, but these errors were encountered: