mfussenegger / nvim-dap

Debug Adapter Protocol client implementation for Neovim
GNU General Public License v3.0
5.11k stars 179 forks source link

Local variables are not shown in widgets.scopes after applying 92dc531. #1066

Closed Alexey104 closed 8 months ago

Alexey104 commented 8 months ago

Debug adapter definition and debug configuration

local home=os.getenv( "HOME" )
local gdb_path = home .. "/.config/nvim/gdb/extension/debugAdapters/bin/OpenDebugAD7"

local dap = require('dap')

dap.adapters.cppdbg = {
  id = 'cppdbg',
  type = 'executable',
  command = gdb_path,
}

dap.configurations.cpp = {
  {
    name = "Launch file",
    type = "cppdbg",
    request = "launch",
    program = function()
      return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
    end,
    cwd = '${workspaceFolder}',
    stopAtEntry = true,
    setupCommands = {
        {
            text = 'set debuginfod enabled on',
            description =  'enable debuginfod',
            ignoreFailures = false
        },
        {
            text = '-enable-pretty-printing',
            description =  'enable pretty printing',
            ignoreFailures = false
        },
    },
  },
}

Debug adapter version

vscode-cpptools v1.17.5

Steps to Reproduce

1) Inside any cpp function call widgets.centered_float(widgets.scopes).

Expected Result

In addition to the content of registers, you should be able to see local variables from the current scope: Before

Actual Result

Starting with commit 92dc531eea2c9a3ef504a5c8ac0decd1fa59a6a3 and later there are no locals listed anymore, but only the registers: After

Fabian-programmer commented 8 months ago

Having the same problem. Thanks for investigating, was about to do the same

mfussenegger commented 8 months ago

Does this still happen after https://github.com/mfussenegger/nvim-dap/pull/1060 was merged? I can't reproduce it anymore with that fix.

Alexey104 commented 8 months ago

@mfussenegger, #1060 fixed the problem. Thank you a lot!