debugging, added mason pacakge for codelldb

main
Mathias Rothenhaeusler 2024-12-28 20:27:12 +01:00
parent 6c2df0572b
commit 0885e0e9b9
1 changed files with 23 additions and 1 deletions

View File

@ -106,8 +106,9 @@ return {
-- Rust
dap.adapters.lldb = {
type = "executable",
command = "/usr/bin/lldb", -- Adjust the path to your codelldb executable
command = "codelldb",
name = "lldb",
-- args = { "--log", "--log-file=/tmp/codelldb.log" },
}
dap.configurations.rust = {
@ -125,6 +126,27 @@ return {
-- Additional LLDB-specific settings
runInTerminal = false,
},
{
name = "Debug Test",
type = "lldb",
request = "launch",
program = function()
-- Prompt the user for the test binary
return vim.fn.input("Path to test binary: ", vim.fn.getcwd() .. "/target/debug/deps/", "file")
end,
cwd = "${workspaceFolder}",
stopOnEntry = false,
args = function()
-- Prompt the user for the specific test function to run
local test_name = vim.fn.input("Test name (leave empty to run all tests): ")
if test_name ~= "" then
return { "--exact", test_name }
else
return {}
end
end,
runInTerminal = false,
},
}
-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.