2023-03-13 20:43:34 +00:00
|
|
|
vim.keymap.set('n', '<F5>', function() require('dap').continue() end)
|
|
|
|
vim.keymap.set('n', '<leader>b', function() require('dap').toggle_breakpoint() end)
|
2023-03-13 19:58:45 +00:00
|
|
|
|
2023-03-13 20:43:34 +00:00
|
|
|
require('dap').adapters.lldb = {
|
|
|
|
type = 'executable',
|
|
|
|
command = '/usr/bin/lldb-vscode', -- adjust as needed
|
|
|
|
name = 'lldb',
|
2023-03-13 19:58:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
local lldb = {
|
2023-03-13 20:43:34 +00:00
|
|
|
name = 'Launch lldb',
|
|
|
|
type = 'lldb', -- matches the adapter
|
|
|
|
request = 'launch', -- could also attach to a currently running process
|
2023-03-13 19:58:45 +00:00
|
|
|
program = function()
|
|
|
|
return vim.fn.input(
|
2023-03-13 20:43:34 +00:00
|
|
|
'Path to executable: ',
|
|
|
|
vim.fn.getcwd() .. '/',
|
|
|
|
'file'
|
2023-03-13 19:58:45 +00:00
|
|
|
)
|
|
|
|
end,
|
2023-03-13 20:43:34 +00:00
|
|
|
cwd = '${workspaceFolder}',
|
2023-03-13 19:58:45 +00:00
|
|
|
stopOnEntry = false,
|
|
|
|
args = {},
|
|
|
|
runInTerminal = false,
|
|
|
|
}
|
|
|
|
|
|
|
|
require('dap').configurations.rust = {
|
|
|
|
lldb -- different debuggers or more configurations can be used here
|
|
|
|
}
|