change cpp debugger to codelldb and configure it to handle rust

This commit is contained in:
Seymur Bagirov 2024-02-15 02:47:42 +04:00
parent 4be1094312
commit c65e4792a1

View File

@ -24,10 +24,28 @@ return {
-- c/c++ debugger -- c/c++ debugger
local dap = require("dap") local dap = require("dap")
dap.adapters.cppdbg = { dap.adapters.codelldb = {
id = "cppdbg", type = "server",
type="executable", port = "${port}",
command = vim.fn.stdpath("data") .. "/mason/bin/OpenDebugAD7" executable = {
command = vim.fn.stdpath("data") .. "/mason/bin/codelldb",
args = {"--port", "${port}"}
}
}
dap.configurations.rust = {
{
name = "Rust Debug",
type = "codelldb",
request = "launch",
program = function()
vim.fn.jobstart("cargo build");
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/target/debug", "file")
end,
cwd = "${workspaceFolder}",
stopOnEntry = true,
showDisassembly = false,
}
} }