VSCode在使用Go语言时无法触发断点。

huangapple go评论95阅读模式
英文:

VSCode not hitting breakpoints using Go lang

问题

我正在使用Windows和最新的Visual Studio Code(v1.66.0),配合最新的"Go"扩展(v0.32.0),但我的断点似乎不再被触发。在调试过程中,断点从红色圆圈变为灰色,如果我将鼠标悬停在断点上,会显示"访问被拒绝"。我已尝试以管理员身份运行,但结果相同。Go模块是一个单独的文件,如截图所示。启动配置是由VSCode创建的默认配置,如下所示。有什么想法吗?

VSCode在使用Go语言时无法触发断点。

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch Package",
            "type": "go",
            "request": "launch",
            "mode": "auto",
            "program": "${fileDirname}"
        }
    ]
}
英文:

I'm using Windows and the latest Visual Studio Code (v1.66.0), with the latest "Go" extension (v0.32.0) and my breakpoints seem to no longer be getting hit. During debug, the breakpoint changes from a red circle to grey and if I hover over the breakpoint it displays "Access is denied". I've tried running as administrator with the same result. The Go module is a single file, as shown in the screenshot. The launch configuration is the default one created by VSCode, and is shown below. Any ideas?

VSCode在使用Go语言时无法触发断点。

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch Package",
            "type": "go",
            "request": "launch",
            "mode": "auto",
            "program": "${fileDirname}"
        }
    ]
}

答案1

得分: 1

给其他人提供信息,结果显示调试器“dlv.exe”被我的防病毒软件阻止了。

英文:

FYI for others searching, turns out that the debugger "dlv.exe" was being blocked by my antivirus software.

huangapple
  • 本文由 发表于 2022年3月31日 03:00:46
  • 转载请务必保留本文链接:https://go.coder-hub.com/71682734.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定