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

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

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

问题

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

用户指定的'dlvLoadConfig'设置将被调试适配器'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'"
        }
]
英文:

When I launch in VSCode dlv debug, I get this message:

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

Source is Go Nightly extension.

have dlvLoadConfig config section already become unavailable (obsolete)?

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'"
        }
]

答案1

得分: 4

你可能需要根据这里提到的内容更新你的配置:
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所期望的)。我只是在dlv(mac-osx)上创建了一个符号链接,它可以在dlv-dap模式下工作。

ln -s dlv dlv-dap

英文:

You might need to update your configuration as mentioned here:
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
(from :https://github.com/golang/vscode-go/blob/master/docs/dlv-dap.md )

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

On a side note, installing the latest didn't seem to copy the binary as dlv-dap (which seems to be expected by vscode) I just created a sym link to dlv (mac-osx), and it works in dlv-dap mode

ln -s dlv dlv-dap

答案2

得分: 2

将 "debugAdapter" 设置为 "legacy" 对我也有效。

"debugAdapter": "legacy",
英文:

Adding "debugAdapter" works for me too.

"debugAdapter": "legacy",

答案3

得分: 2

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

对于字符串值,根据2021年8月的情况,它使用512或4K(在"VARIABLES"部分显示时为512,函数调用结果为1K,如果从"DEBUG CONSOLE"查询变量或使用"COPY VALUE"则为4K)。

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

英文:

https://github.com/golang/vscode-go/blob/master/docs/debugging.md#settings
The new dlv-dap takes a completely different approach in loading data, so dlvLoadConfig is no longer necessary.

For string values, it uses 512 or 4K depending on the context as of Aug 2021. (512 for display in the VARIABLES section, 1K for function call results, 4K if you query the variables from the DEBUG CONSOLE or use COPY VALUE)

I noticed you were using maxStringLen: 1024 in your settings. We are currently considering to increase the limit of how much we show in the VARIABLES section. We are increasing this slowly and conservatively because it causes loading a lot of data for all variables automatically and it can slow down the debugging performance. If inspecting long string variables from DEBUG CONSOLE (on demand) is not sufficient, please open a new issue in the github.com/golang/vscode-go repo.

huangapple
  • 本文由 发表于 2021年8月11日 03:25:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/68732514.html
匿名

发表评论

匿名网友

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

确定