Debug skipping some lines when using Step Over (F10) #3303
Labels
Debug
Issues related to the debugging functionality of the extension.
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
Milestone
What version of Go, VS Code & VS Code Go extension are you using?
Version Information
go version
to get version of Go from the VS Code integrated terminal.gopls -v version
to get version of Gopls from the VS Code integrated terminal.code -v
orcode-insiders -v
to get version of VS Code or VS Code Insiders.Go: Locate Configured Go Tools
command.Tools Configuration
Environment
GOBIN: undefined
toolsGopath:
gopath: /Users/rcaetano/go
GOROOT: /Users/rcaetano/sdk/go1.21.1
PATH: /Users/rcaetano/sdk/go1.21.1/bin:/Users/rcaetano/.pyenv/shims:/Users/rcaetano/Downloads/google-cloud-sdk/bin:/Users/rcaetano/.gvm/bin:/Users/rcaetano/.nvm/versions/node/v14.18.1/bin:/usr/local/bin:/Users/rcaetano/Library/Python/3.8/bin:/Users/rcaetano/go/bin:/Users/rcaetano/.nvm/versions/node/v14.18.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/usr/local/sbin:/usr/local/go/bin:/Users/rcaetano/.fig/bin:/Users/rcaetano/.local/bin:/Users/rcaetano/go/bin/mockery
PATH (vscode launched with): /Users/rcaetano/.pyenv/shims:/Users/rcaetano/Downloads/google-cloud-sdk/bin:/Users/rcaetano/.gvm/bin:/Users/rcaetano/.nvm/versions/node/v14.18.1/bin:/usr/local/bin:/Users/rcaetano/Library/Python/3.8/bin:/Users/rcaetano/go/bin:/Users/rcaetano/.nvm/versions/node/v14.18.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/usr/local/sbin:/usr/local/go/bin:/Users/rcaetano/.fig/bin:/Users/rcaetano/.local/bin:/Users/rcaetano/go/bin/mockery
Tools
Go env
Workspace Folder (fury_shipping-circuits-api): /Users/rcaetano/workspace/forecast/fury_shipping-circuits-api
Share the Go related settings you have added/edited
Describe the bug
When debugging, some lines of codes are sometimes skipped when using Step Over (F10). For example, in this snipped of code (replaced the real names):
When I put a breakpoint in the first line, F10 goes to
if err
. But if I use F10 again, it does not break in the last line, it executes it, unless I put a breakpoint in it. This happens a lot, and its quite anoying. But is not in every code.I was not able to reproduce this behavior in a separated project to put in here. I copied the exact code (all the file), mocked all the dependencies, but used the same structs/entities, and still not reproduceble. Maybe this is related to the amount of memory used by my API (stack), and the debug makes some kind of optmizations? Just guessing.
When I use Delve directly, and only attach the debug into it, it works perfectly. So its a behavior of the extension I think.
Is this a possible bug, or an expected behavior? If the last, is there anything, some config, that I can change to try to fix it?
Steps to reproduce the behavior:
Not able to reproduce.
The text was updated successfully, but these errors were encountered: