mfussenegger / nvim-dap

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

attempt to perform arithmetic on local 'column' (a nil value) #1196

Closed helviett closed 5 months ago

helviett commented 5 months ago

Debug adapter definition and debug configuration

Adapter comes with LLVM installation (18.1.3). Configures as in wiki:

dap.adapters.lldb = {
  type = 'executable',
  command = 'C:\\Program Files\\LLVM\\bin\\lldb-dap.exe',
  name = 'lldb'
}

Debug configuration:

local dap = require('dap')
local last_scene = vim.fn.getcwd() .. '\\'
dap.configurations.cpp = {
  {
    name = 'Launch',
    type = 'lldb',
    request = 'launch',
    program = '${workspaceFolder}\\build\\Sandbox\\Sandbox.exe',
    cwd = '${workspaceFolder}\\Sandbox',
    stopOnEntry = false,
    args = function ()
        last_scene = vim.fn.input('Scene: ', last_scene, 'file')
        return { last_scene }
    end,
  },
}

Debug adapter version

0.7.0

Steps to Reproduce

I compile project via CMake with clang compiler that comes with LLVM installation and just launch debugging session:

vim.keymap.set('n', '<F5>', function() dap.continue() end)

And then hit breakpoint.

Expected Result

Everything works, I hit breakpoint, can step through the code, check variables, etc.

Actual Result

I get the following error:

...data\site\pack\packer\start\nvim-dap/lua/dap/session.lua:377: attempt to perform arithmetic on local 'column' (a nil value)

stack traceback:                                                                                                              
^I...data\site\pack\packer\start\nvim-dap/lua/dap/session.lua:377: in function 'set_cursor'
^I...data\site\pack\packer\start\nvim-dap/lua/dap/session.lua:425: in function 'fn'
^I...data\site\pack\packer\start\nvim-dap/lua/dap/session.lua:499: in function 'jump_to_location'
^I...data\site\pack\packer\start\nvim-dap/lua/dap/session.lua:566: in function 'jump_to_frame'
^I...data\site\pack\packer\start\nvim-dap/lua/dap/session.lua:719: in function <...data\site\pack\packer\start\nvim-dap/lua/dap/session.lua:650> 
^I[C]: in function 'xpcall' 
^I...m-data\site\pack\packer\start\nvim-dap/lua/dap/async.lua:12: in function <...m-data\site\pack\packer\start\nvim-dap/lua/dap/async.lua:11>

dap.log

Couldn't figure out solution myself.

mfussenegger commented 5 months ago

Judging from the trace and the log you're hitting https://github.com/llvm/llvm-project/pull/73393

helviett commented 5 months ago

Yes, you're right. Downgrading to 17.x resolved the problem. Thanks for the help and work on nvim-dap!