feat(nvim/dap): setup lldb
This commit is contained in:
parent
4771957859
commit
ea9b7b7bd2
29
init.lua
29
init.lua
@ -46,32 +46,8 @@ local dap, dapui = require("dap"), require("dapui")
|
|||||||
dap.adapters.lldb = {
|
dap.adapters.lldb = {
|
||||||
type = "executable",
|
type = "executable",
|
||||||
command = deps.lldb_path .. "/bin/lldb-vscode",
|
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 = {
|
local dap_breakpoint = {
|
||||||
error = {
|
error = {
|
||||||
text = "🟥",
|
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("DapBreakpoint", dap_breakpoint.error)
|
||||||
vim.fn.sign_define("DapStopped", dap_breakpoint.stopped)
|
vim.fn.sign_define("DapStopped", dap_breakpoint.stopped)
|
||||||
vim.fn.sign_define("DapBreakpointRejected", dap_breakpoint.rejected)
|
vim.fn.sign_define("DapBreakpointRejected", dap_breakpoint.rejected)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user