Closed petervalencic closed 2 months ago
Do you have a way for us to reproduce this?
Is this WSL 1 or WSL 2?
Hi, I'm using WSL2:
The strange thing is that some time ago I was able to debug the Go app. I mainly use vscode for Go, Java, node and Python development (switching projects depending on work).. The last week was debugging Python project and then switched back to Go and the debugger just ran over the code without considering breakpoints. At the same time, the toolbar with the debug buttons did not appear on the vscode screen.
Do you have a way for us to reproduce this? Can you reproduce the problem using the command line client? Can you add "logOutput": "dap"
to launch.json and post the output?
The output is:
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch main.go",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceRoot}/test.go",
"env": {},
"args": [],
"logOutput": "dap",
}
]
}
If I run the DLV in terminal:
You also need to add "showLog": true
apparently. The way to run the command line client is dlv debug
not dlv debug ./test
. Once it's running type help
for how to set breakpoints and run the program.
Also please post text not screenshots or videos.
What I have done is that I have removed Go from my system.. reinstalled the latest version of Go and installed Delve ...
peterv@SILFC857M3:/home/ec2-user/scripts/gotest$ go version
go version go1.22.2 linux/amd64
peterv@SILFC857M3:/home/ec2-user/scripts/gotest$ dlv version
Delve Debugger
Version: 1.22.1
Build: $Id: 0c3470054da6feac5f6dcf3e3e5144a64f7a9a48 $
Now the debug is working well:
I didn't have time to investigate more on what was wrong, but I'm able to debug it now. That solved my problem. You can close the ticket. Thank you for your help and time!
Hi, have strange issue from a while. I'm unable to debug golang project using dlv and vscode.
What version of Delve are you using (
dlv version
)? Delve Debugger Version: 1.22.1 Build: $Id: 0c3470054da6feac5f6dcf3e3e5144a64f7a9a48 $What version of Go are you using? (
go version
)? go version go1.21.4 linux/386What operating system and processor architecture are you using? WSL Ubuntu
What did you do? Trying to debug a simple code (worked in past). The debugger won't to stop on the breakpoint
What did you expect to see? To be able to debug the code
What did you see instead? I see the same result as if the run command were used..
This is my launch.json file:
When trying to debug the code I get:![image](https://github.com/go-delve/delve/assets/10866388/2d512687-b74f-4ff6-b9a1-cf9abfc8414c)
Don't know what is wrong or how to make the debugger to stop at the breakpoint in the code..