feat(nvim/dap): setup lldb

This commit is contained in:
u2515h 2023-12-27 17:48:45 +01:00
parent 4771957859
commit ea9b7b7bd2

View File

@ -46,32 +46,8 @@ local dap, dapui = require("dap"), require("dapui")
dap.adapters.lldb = {
type = "executable",
command = deps.lldb_path .. "/bin/lldb-vscode",
name = "lldb",
name = "lldb"
}
local lldb = {
name = "Launch lldb",
type = "lldb", -- matches the adapter
request = "launch", -- could also attach to a currently running process
program = function()
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/",
"file")
end,
cwd = "$${workspaceFolder}",
stopOnEntry = false,
args = {},
console = internalConsole,
runInTerminal = true
}
dap.configurations.rust = {
lldb -- different debuggers or more configurations can be used here
}
--[[ local opts = {
dap = {
adapter = require("rust-tools.dap").get_codelldb_adapter("${pkgs.lldb}/bin/lldb-vscode", "${pkgs.lldb.lib}/lib/liblldb.so"),
},
}
require("rust-tools").setup { opts } ]]
local dap_breakpoint = {
error = {
text = "🟥",
@ -93,6 +69,9 @@ local dap_breakpoint = {
}
}
vim.keymap.set('n', '<leader>dk', function() dap.continue() end)
vim.keymap.set('n', '<leader>dl', function() dap.run_last() end)
vim.keymap.set('n', '<leader>b', function() dap.toggle_breakpoint() end)
vim.fn.sign_define("DapBreakpoint", dap_breakpoint.error)
vim.fn.sign_define("DapStopped", dap_breakpoint.stopped)
vim.fn.sign_define("DapBreakpointRejected", dap_breakpoint.rejected)