我已经为 c++ 配置了 nvim-dap,配置如下:
dap.adapters.cppdbg = {
name = 'cppdbg',
type = 'executable',
command = vim.fn.stdpath('data') .. '/mason/bin/OpenDebugAD7.cmd',
}
dap.configurations.cpp = {
{
name = 'Debug Program',
type = 'cppdbg',
request = 'launch',
MIMode = 'lldb',
cwd = '${workspaceFolder}',
stopAtEntry = true,
program = function ()
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. '/', 'file')
end,
}
}
但是 nvim-dap 仍然无法启动。
我花了几天时间试图弄清楚但无济于事。当我运行 nvim-dap 时,一段时间后会出现以下消息
Debug adapter didn't respond. Either the adapter is slow (then wait and ignore this) or there is a problem with your adapter or
cppdbg configuration. Check the logs for errors (:help dap.set_log_level)
。还会弹出一个控制台,显示 waiting for v8 protocol on stdin/stdout
。
MIDebuggerPath = '/path/to/lldb-mi'
)