-
Notifications
You must be signed in to change notification settings - Fork 645
Unverified Breakpoint - With Remote Debug #941
Comments
To resolve the problem I need to change the project folder name, and after launch the debug. If the folder name is equal for the docker folder path I have the problem. If "remotePath": "/go/src/bitbucket.org/marked/markedProf1", is equal to ADD. /go/src/bitbucket.org/marked/markedProf1 - Dockerfile Someone can help me? |
cc @roblourens |
I can repro this too, albeit without the fix. I made a repo to demonstrate the problem: https://github.com/willseward/delve-crash Just run |
It works via the command line, but not with VS Code.
|
Thanks for the repo. This is from #742, which I don't think is quite right, and needs unit tests. I don't use Docker often. @willseward what's the correct remote path to main.go? Is it |
Thanks @roblourens The correct remote path to the main.go should be I'll keep looking at it. EDIT: I think the errant path may just be residual of the build process. Correct me if I'm wrong... |
I'm not sure what you mean by that. Can you explain what the dockerfile is doing with that path? |
The Dockerfile builds inside As for the path being part of the build process, I believe the build path is included in the symbols of the binary. |
Got it! If the original build path and the current path don't match, it won't work. The fix for me is: diff --git a/.vscode/launch.json b/.vscode/launch.json
index 06da33b..d6366f5 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -5,7 +5,7 @@
"type": "go",
"request": "launch",
"mode": "remote",
- "remotePath": "/app",
+ "remotePath": "/go/src/myapp",
"port": 2345,
"host": "127.0.0.1",
"program": "${fileDirname}",
diff --git a/docker-compose.yml b/docker-compose.yml
index 0884ba2..b1c7168 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -18,4 +18,4 @@ services:
- "2345:2345"
pid: "container:delvecrash_app_1"
volumes:
- - "./app:/app"
+ - "./app:/go/src/myapp" A strange peculiarity. |
@phenrigomes @willseward Do you still have issues with remote debugging with the latest version of the Go extension? |
The original problem still exists, but I don't think it's a bug---just some undocumented functionality. |
And by original problem do you mean #941 (comment) or #941 (comment) ? |
#941 (comment) is the work-around. The repro in the github repo still works. The next-to-latest commit is the one with the failure. |
I am having trouble with the set up. In the latest update to the Go extension, the error If you are up for it, can you try and debug the issue by running the Go extension from source?
|
This issue has been closed automatically because it needs more information and has not had recent activity. |
The breakpoint is gray in the editor.
Vs Code:
Version 1.11.2
Vs Code Go Plugin:
Version: 0.6.59
Delve:
Delve Debugger
Version: 0.12.2
Vs Code Config:
Docker compose:
The text was updated successfully, but these errors were encountered: