pocco81 / dap-buddy.nvim

🐞 Debug Adapter Protocol manager for Neovim
GNU General Public License v3.0
400 stars 48 forks source link

Error occur in using codelldb #53

Open lsli0116 opened 2 years ago

lsli0116 commented 2 years ago

Hi there,

I am using codelldb to debug c++ and configure it according to the steps in the wiki, but there are always error occurring.

Error executing vim.schedule lua callback: ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:308: attempt to concatenate field 'threadId' (a nil value) stack traceback: ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:308: in function 'callback' ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:579: in function <...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:571> Press ENTER or type command to continue Debug adapter didn't respond. Either the adapter is slow (then wait and ignore this) or there is a problem with your adapter or codelldb configuration. Check the logs for errors (:help dap.set_log_level) Press ENTER or type command to continue

So I run :lua require"dap".set_log_level("DEBUG") in the neovim and the following is the content in the dap.log

[ DEBUG ] 2022-01-10T14:14:35Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:804 ] "request" { arguments = { adapterID = "nvim-dap", clientId = "neovim", clientname = "neovim", columnsStartAt1 = true, linesStartAt1 = true, locale = "en_US.UTF-8", pathFormat = "path", supportsRunInTerminalRequest = true, supportsVariableType = true }, command = "initialize", seq = 0, type = "request" } [ DEBUG ] 2022-01-10T14:14:36Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:536 ] { body = { exceptionBreakpointFilters = { { default = true, filter = "cpp_throw", label = "C++: on throw" }, { default = false, filter = "cpp_catch", label = "C++: on catch" } }, supportTerminateDebuggee = true, supportsCancelRequest = true, supportsCompletionsRequest = true, supportsConditionalBreakpoints = true, supportsConfigurationDoneRequest = true, supportsDataBreakpoints = true, supportsDelayedStackTraceLoading = true, supportsEvaluateForHovers = true, supportsFunctionBreakpoints = true, supportsGotoTargetsRequest = true, supportsHitConditionalBreakpoints = true, supportsLogPoints = true, supportsReadMemoryRequest = true, supportsRestartFrame = true, supportsSetVariable = true }, command = "initialize", request_seq = 0, success = true, type = "response" } [ DEBUG ] 2022-01-10T14:14:36Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:804 ] "request" { arguments = { cwd = "/Users/lsli/tmp/c++", name = "Launch file", program = "/Users/lsli/tmp/c++/main", request = "launch", stopOnEntry = true, type = "codelldb" }, command = "launch", seq = 1, type = "request" } [ DEBUG ] 2022-01-10T14:14:36Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:536 ] { event = "initialized", seq = 1, type = "event" } [ DEBUG ] 2022-01-10T14:14:36Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:804 ] "request" { arguments = { breakpoints = { { line = 5 } }, lines = { 5 }, source = { name = "main.cpp", path = "/Users/lsli/tmp/c++/main.cpp" } }, command = "setBreakpoints", seq = 2, type = "request" } [ DEBUG ] 2022-01-10T14:14:36Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:536 ] { body = { module = { addressRange = "FFFFFFFFFFFFFFFF", id = "FFFFFFFFFFFFFFFF", name = "main", path = "/Users/lsli/tmp/c++/main", symbolFilePath = "/Users/lsli/tmp/c++/main", symbolStatus = "Symbols loaded." }, reason = "new" }, event = "module", seq = 2, type = "event" } [ DEBUG ] 2022-01-10T14:14:36Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:536 ] { arguments = { args = { "/Users/lsli/.local/share/nvim/dapinstall/codelldb/extension/adapter/codelldb", "terminal-agent", "--port=51377" }, cwd = "", kind = "integrated", title = "Launch file" }, command = "runInTerminal", seq = 3, type = "request" } [ DEBUG ] 2022-01-10T14:14:36Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:83 ] "run_in_terminal" { args = { "/Users/lsli/.local/share/nvim/dapinstall/codelldb/extension/adapter/codelldb", "terminal-agent", "--port=51377" }, cwd = "", kind = "integrated", title = "Launch file" } [ DEBUG ] 2022-01-10T14:14:36Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:821 ] "response" { body = { processId = 20701 }, command = "runInTerminal", request_seq = 3, seq = 3, success = true, type = "response" } [ DEBUG ] 2022-01-10T14:14:36Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:536 ] { body = { breakpoints = { { id = 1, message = "Resolved locations: 0", verified = false } } }, command = "setBreakpoints", request_seq = 2, success = true, type = "response" } [ INFO ] 2022-01-10T14:14:36Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:472 ] "Server rejected breakpoint" { id = 1, message = "Resolved locations: 0", verified = false } [ DEBUG ] 2022-01-10T14:14:36Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:804 ] "request" { arguments = { filters = { "cpp_throw" } }, command = "setExceptionBreakpoints", seq = 4, type = "request" } [ DEBUG ] 2022-01-10T14:14:36Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:536 ] { command = "setExceptionBreakpoints", request_seq = 4, success = true, type = "response" } [ DEBUG ] 2022-01-10T14:14:36Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:804 ] "request" { command = "configurationDone", seq = 5, type = "request" } [ DEBUG ] 2022-01-10T14:14:36Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:536 ] { body = { output = "Launching: /Users/lsli/tmp/c++/main\n" }, event = "output", seq = 4, type = "event" } [ DEBUG ] 2022-01-10T14:14:36Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:536 ] { body = { output = "Launched process 20702\n" }, event = "output", seq = 5, type = "event" } [ DEBUG ] 2022-01-10T14:14:36Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:536 ] { body = { allThreadsStopped = true, reason = "unknown" }, event = "stopped", seq = 6, type = "event" } [ DEBUG ] 2022-01-10T14:14:36Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:536 ] { command = "launch", request_seq = 1, success = true, type = "response" } [ DEBUG ] 2022-01-10T14:14:36Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:536 ] { command = "configurationDone", request_seq = 5, success = true, type = "response" } [ DEBUG ] 2022-01-10T14:14:37Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:536 ] { body = { module = { id = "FFFFFFFFFFFFFFFF", name = "" }, reason = "removed" }, event = "module", seq = 7, type = "event" } [ DEBUG ] 2022-01-10T14:14:37Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:536 ] { body = { module = { addressRange = "100010000", id = "100010000", name = "dyld", path = "/usr/lib/dyld", symbolFilePath = "/usr/lib/dyld", symbolStatus = "Symbols loaded." }, reason = "new" }, event = "module", seq = 8, type = "event" } [ DEBUG ] 2022-01-10T14:14:37Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:536 ] { body = { module = { addressRange = "100000000", id = "100000000", name = "main", path = "/Users/lsli/tmp/c++/main", symbolFilePath = "/Users/lsli/tmp/c++/main", symbolStatus = "Symbols loaded." }, reason = "new" }, event = "module", seq = 9, type = "event" } [ DEBUG ] 2022-01-10T14:14:37Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:536 ] { body = { category = "stderr", output = "Stop reason: signal SIGSTOP\n" }, event = "output", seq = 10, type = "event" } [ DEBUG ] 2022-01-10T14:14:37Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:536 ] { body = { allThreadsStopped = true, reason = "signal", text = "signal SIGSTOP", threadId = 157296 }, event = "stopped", seq = 11, type = "event" } [ DEBUG ] 2022-01-10T14:14:37Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:804 ] "request" { command = "threads", seq = 6, type = "request" } [ DEBUG ] 2022-01-10T14:14:37Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:536 ] { body = { threads = { { id = 157296, name = "1: tid=157296" } } }, command = "threads", request_seq = 6, success = true, type = "response" } [ DEBUG ] 2022-01-10T14:14:37Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:804 ] "request" { arguments = { threadId = 157296 }, command = "stackTrace", seq = 7, type = "request" } [ DEBUG ] 2022-01-10T14:14:37Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:804 ] "request" { arguments = { threadId = 157296 }, command = "stackTrace", seq = 8, type = "request" } [ DEBUG ] 2022-01-10T14:14:37Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:536 ] { body = { stackFrames = { { column = 0, id = 1001, line = 3, name = "_dyld_start", presentationHint = "subtle", source = { name = "@_dyld_start", sourceReference = 1000 } } }, totalFrames = 1 }, command = "stackTrace", request_seq = 7, success = true, type = "response" } [ DEBUG ] 2022-01-10T14:14:37Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:536 ] { body = { stackFrames = { { column = 0, id = 1002, line = 3, name = "_dyld_start", presentationHint = "subtle", source = { name = "@_dyld_start", sourceReference = 1000 } } }, totalFrames = 1 }, command = "stackTrace", request_seq = 8, success = true, type = "response" } [ DEBUG ] 2022-01-10T14:14:37Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:804 ] "request" { arguments = { source = { name = "@_dyld_start", sourceReference = 1000 }, sourceReference = 1000 }, command = "source", seq = 9, type = "request" } [ DEBUG ] 2022-01-10T14:14:37Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:804 ] "request" { arguments = { frameId = 1001 }, command = "scopes", seq = 10, type = "request" } [ DEBUG ] 2022-01-10T14:14:37Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:536 ] { body = { content = '; id = {0x00000911}, range = [0x0000000000004ac0-0x0000000000004ad9), mangled="_dyld_start"\n; Source location: unknown\n100014AC0: 48 89 E7 movq %rsp, %rdi\n100014AC3: 6A 00 pushq $0x0\n100014AC5: 48 C7 C5 00 00 00 00 movq $0x0, %rbp\n100014ACC: 48 83 E4 F0 andq $-0x10, %rsp\n100014AD0: 48 83 EC 08 subq $0x8, %rsp\n100014AD4: E9 57 08 00 00 jmp 0x100015330 ; start\n', mimeType = "text/x-lldb.disassembly" }, command = "source", request_seq = 9, success = true, type = "response" } [ DEBUG ] 2022-01-10T14:14:37Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:536 ] { body = { scopes = { { expensive = false, name = "Local", variablesReference = 1003 }, { expensive = false, name = "Static", variablesReference = 1004 }, { expensive = false, name = "Global", variablesReference = 1005 }, { expensive = false, name = "Registers", variablesReference = 1006 } } }, command = "scopes", request_seq = 10, success = true, type = "response" } [ DEBUG ] 2022-01-10T14:14:37Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:804 ] "request" { arguments = { variablesReference = 1003 }, command = "variables", seq = 11, type = "request" } [ DEBUG ] 2022-01-10T14:14:37Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:804 ] "request" { arguments = { variablesReference = 1004 }, command = "variables", seq = 12, type = "request" } [ DEBUG ] 2022-01-10T14:14:37Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:804 ] "request" { arguments = { variablesReference = 1005 }, command = "variables", seq = 13, type = "request" } [ DEBUG ] 2022-01-10T14:14:37Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:804 ] "request" { arguments = { variablesReference = 1006 }, command = "variables", seq = 14, type = "request" } [ DEBUG ] 2022-01-10T14:14:37Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:804 ] "request" { arguments = { variablesReference = 1003 }, command = "variables", seq = 15, type = "request" } [ DEBUG ] 2022-01-10T14:14:37Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:804 ] "request" { arguments = { variablesReference = 1004 }, command = "variables", seq = 16, type = "request" } [ DEBUG ] 2022-01-10T14:14:37Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:804 ] "request" { arguments = { variablesReference = 1005 }, command = "variables", seq = 17, type = "request" } [ DEBUG ] 2022-01-10T14:14:37Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:804 ] "request" { arguments = { variablesReference = 1006 }, command = "variables", seq = 18, type = "request" } [ DEBUG ] 2022-01-10T14:14:37Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:536 ] { body = { variables = {} }, command = "variables", request_seq = 11, success = true, type = "response" } [ DEBUG ] 2022-01-10T14:14:37Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:536 ] { body = { variables = {} }, command = "variables", request_seq = 12, success = true, type = "response" } [ DEBUG ] 2022-01-10T14:14:37Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:536 ] { body = { variables = {} }, command = "variables", request_seq = 13, success = true, type = "response" } [ DEBUG ] 2022-01-10T14:14:37Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:536 ] { body = { variables = { { evaluateName = "General Purpose Registers", name = "General Purpose Registers", value = "{rax:0x0000000000000000, rbx:0x0000000000000000, ...}", variablesReference = 1007 }, { evaluateName = "Floating Point Registers", name = "Floating Point Registers", value = "{fctrl:0x037f, fstat:0x0000, ftag:0x0000, ...}", variablesReference = 1008 }, { evaluateName = "Exception State Registers", name = "Exception State Registers", value = "{trapno:0x00000000, err:0x00000000, ...}", variablesReference = 1009 } } }, command = "variables", request_seq = 14, success = true, type = "response" } [ DEBUG ] 2022-01-10T14:14:37Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:536 ] { body = { variables = {} }, command = "variables", request_seq = 15, success = true, type = "response" } [ DEBUG ] 2022-01-10T14:14:37Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:536 ] { body = { variables = {} }, command = "variables", request_seq = 16, success = true, type = "response" } [ DEBUG ] 2022-01-10T14:14:37Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:536 ] { body = { variables = {} }, command = "variables", request_seq = 17, success = true, type = "response" } [ DEBUG ] 2022-01-10T14:14:37Z+0800 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:536 ] { body = { variables = { { evaluateName = "General Purpose Registers", name = "General Purpose Registers", value = "{rax:0x0000000000000000, rbx:0x0000000000000000, ...}", variablesReference = 1010 }, { evaluateName = "Floating Point Registers", name = "Floating Point Registers", value = "{fctrl:0x037f, fstat:0x0000, ftag:0x0000, ...}", variablesReference = 1011 }, { evaluateName = "Exception State Registers", name = "Exception State Registers", value = "{trapno:0x00000000, err:0x00000000, ...}", variablesReference = 1012 } } }, command = "variables", request_seq = 18, success = true, type = "response" }

And the following is my configuration for the dap_install:

local dap_install = require("dap-install")
local dbg_list = require("dap-install.api.debuggers").get_installed_debuggers()

for _, debugger in ipairs(dbg_list) do
    dap_install.config(debugger)
end

Thanks in advance!