golang / vscode-go

Go extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=golang.Go
Other
3.85k stars 736 forks source link

debug: support data breakpoints (watchpoint) #3509

Open ripplewang888 opened 2 weeks ago

ripplewang888 commented 2 weeks ago

Is your feature request related to a problem? Please describe. As gdb does, break at a watch point for when a variable value change. Delve support watch command, but I cant' execute this command in vscode.

Describe the solution you'd like (dlv) watch -rw b Watchpoint b set at 0x556188 (dlv) l

how to do this in vscode? I want to set a watchpoint break.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

ripplewang888 commented 2 weeks ago

image I think should add two menu bars when right click global variables.

ripplewang888 commented 2 weeks ago

@gopherbot can you assign this issue to sb?

hyangah commented 2 weeks ago

I guess the closest is data breakpoint. Delve DAP (the debug adapter behind the scene) is not supporting data breakpoints yet.

https://github.com/go-delve/delve/blob/a164b89df10aba455e0196222e51fa4b65e5746c/service/dap/server.go#L796-L799

Contribution to DAP (in the go-delve repo) is welcome.

ripplewang888 commented 2 weeks ago

@hyangah , thanks. Do you know when to support this feature?