调试适配器 'dlv-dap' 将忽略用户指定的 'dlvLoadConfig' 设置

User specified 'dlvLoadConfig' setting will be ignored by debug adapter 'dlv-dap'

当我在 VSCode dlv 调试中启动时,我收到此消息:

User specified 'dlvLoadConfig' setting will be ignored by debug adapter 'dlv-dap'.

来源是 Go Nightly 扩展。

dlvLoadConfig 配置部分已经变得不可用(过时)?

launch.json :

    "configurations": [
        {
            "name": "Application Server",
            "type": "go",
            "request": "launch",
            "mode": "auto",
            "program": "${workspaceFolder}/cmd/main.go",
            "args": ["--config", "${workspaceFolder}/configuration/application.toml"],
            "env": {
                "CC":"/usr/bin/gcc",
                "GOOS":"linux",
                "GOARCH":"amd64",
                "CGO_ENABLED":1
            },

            "dlvLoadConfig": {
                "followPointers": true,
                "maxVariableRecurse": 1,
                "maxStringLen": 1024,
                "maxArrayValues": 64,
                "maxStructFields": -1
            },

            "trace": "log"
//            "buildFlags": "-tags dev -ldflags '-X main.BuildDate=2021-04-28T19:38:16+03:00'"
        }
]

您可能需要按照此处所述更新您的配置: https://github.com/golang/vscode-go/blob/master/docs/debugging.md#switching-to-legacy-debug-adapter

https://github.com/golang/vscode-go/blob/master/docs/debugging.md (来自:https://github.com/golang/vscode-go/blob/master/docs/dlv-dap.md

"go.delveConfig": {
    "debugAdapter": "legacy",
}

附带说明一下,安装最新版本似乎没有将二进制文件复制为 dlv-dap(这似乎是 vscode 所期望的)我刚刚创建了一个 sym link 到 dlv (mac-osx),并且工作在dlv-dap模式下

ln -s dlv dlv-dap

添加“调试适配器”对我有用。

"debugAdapter": "legacy",

https://github.com/golang/vscode-go/blob/master/docs/debugging.md#settings 新的 dlv-dap 在加载数据时采用了完全不同的方法,因此不再需要 dlvLoadConfig。

对于字符串值,它使用 512 或 4K,具体取决于截至 2021 年 8 月的上下文。(512 用于在 VARIABLES 部分中显示,1K 用于函数调用结果,4K 如果您从 DEBUG CONSOLE 查询变量或使用复制值)

我注意到您在设置中使用了 maxStringLen: 1024。我们目前正在考虑增加 the limit 我们在 VARIABLES 部分中显示的数量。我们正在缓慢而保守地增加它,因为它会导致自动为所有变量加载大量数据,并且会降低调试性能。如果从 DEBUG CONSOLE(按需)检查长字符串变量还不够,请在 github.com/golang/vscode-go 存储库中打开一个新问题。