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

Viewed 1956

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

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

Adding "debugAdapter" works for me too.

"debugAdapter": "legacy",

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.

Related