mfussenegger / nvim-dap

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

nvim-dap is immediately closed after starting. #1048

Closed harisonkhlil closed 1 year ago

harisonkhlil commented 1 year ago

Debug adapter definition and debug configuration

-- Dap for c/c++
dap.adapters.codelldb = {
  type = "server",
  port = "${port}",
  executable = {
    command = "/Users/xxx/.vscode/extensions/vadimcn.vscode-lldb-1.10.0/adapter/codelldb",
    args = { "--port", "${port}" },
  },
}

dap.configurations.cpp = {
  {
    name = "Launch file",
    type = "codelldb",
    request = "launch",
    program = function()
      return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/build/", "file")
    end,
    cwd = "${workspaceFolder}",
    stopOnEntry = false,
  },
}

Debug adapter version

1.10

Steps to Reproduce

Please watch the video below:

video

Expected Result

Successfully run to breakpoint.

Actual Result

Crash

dap.log

mfussenegger commented 1 year ago

Make sure you compile your program with debug symbols, otherwise it cannot resolve the breakpoints.

See also https://github.com/mfussenegger/nvim-dap/wiki/Debug-symbols-in-various-languages-and-build-systems