Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Remote Attach fails to set a breakpoint if program is started with --continue option #2690

Closed
quoctruong opened this issue Aug 8, 2019 · 3 comments

Comments

@quoctruong
Copy link
Contributor

Steps to Reproduce:

  1. Start a remote program through dlv with --continue option (recently added to dlv through cmd/dlv: add --continue to continue process on launch/attach go-delve/delve#1585). For example:
dlv exec /app --continue --accept-multiclient --api-version=2 --headless --listen=:3000
  1. Attach the VSCode Go Debugger and set a breakpoint.
  2. Breakpoints won't get hit.
@nagstaku
Copy link

I would guess that maybe there is a mis-match of files on your local system to the remote system and that is why it's never hitting (or at least that is what I experienced recently).

the applicable settings I had to set were:
"remotePath": "/app/root/dir/",
"cwd": "${workspaceFolder}/app/root/dir"

Although you should also post the rest of your launch.json

The vscode debug experience seems very rough currently, it doesn't seem to indicate if it's even able to reach a debug host for instance (ie, the port isn't even open on the target system, and never even connects).

You can add:
"tracing": "verbose",

and examine its output to look for oddities. Also, if possible, consider adding tcpflow to your target system, and then running this while attempting to attach debuggers (this is how i initially found my problems). For an alpine based docker container:

apk add tcpflow
tcpflow -i any -c

(-i is interface, and -c is Console print. Print the contents of packets, without storing in a file.)

@quoctruong
Copy link
Contributor Author

I actually have a PR (#2685) to fix this bug. It seems to happen because VSCode does not halt dlv before setting a breakpoint in this case.

@ramya-rao-a
Copy link
Contributor

This should now be fixed in the latest version (0.11.5) of the extension

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants