You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.7 KiB
52 lines
1.7 KiB
return { |
|
{ |
|
"mfussenegger/nvim-dap", |
|
config = function() |
|
local dap = require("dap") |
|
|
|
-- 1. The adapter (cpptools' OpenDebugAD7 → drives gdb over MI, same engine VSCode used) |
|
dap.adapters.cppdbg = { |
|
id = "cppdbg", |
|
type = "executable", |
|
command = vim.fn.stdpath("data") .. "/mason/bin/OpenDebugAD7", |
|
} |
|
|
|
-- 2. Shared bits used by every variant |
|
local common_env = { |
|
{ name = "SERVER", value = "192.168.122.111" }, |
|
{ name = "QT_FATAL_WARNINGS", value = "0" }, |
|
} |
|
local function env_with(...) |
|
local e = vim.deepcopy(common_env) |
|
for _, item in ipairs({ ... }) do table.insert(e, item) end |
|
return e |
|
end |
|
|
|
local base = { |
|
type = "cppdbg", |
|
request = "launch", |
|
MIMode = "gdb", |
|
miDebuggerPath = "/usr/bin/gdb", |
|
miDebuggerArgs = "-ex 'set debuginfod enabled off'", |
|
setupCommands = { |
|
{ text = "-enable-pretty-printing", description = "Pretty printing", ignoreFailures = true }, |
|
{ text = "-gdb-set disassembly-flavor intel", description = "Intel disassembly", ignoreFailures = true }, |
|
}, |
|
} |
|
|
|
-- 3. One entry per binary/variant |
|
dap.configurations.cpp = { |
|
vim.tbl_extend("force", base, { |
|
name = "SMiKO (-d -u 10000)", |
|
program = "${workspaceFolder}/src/smiko/binary/unix/SMiKO", |
|
args = { "-d", "-u", "10000" }, |
|
cwd = "${workspaceFolder}/src/smiko/binary/unix", |
|
environment = env_with( |
|
{ name = "LD_LIBRARY_PATH", value = "${workspaceFolder}/src/smiko/binary/unix/lib" } |
|
), |
|
}), |
|
} |
|
dap.configurations.c = dap.configurations.cpp |
|
end, |
|
}, |
|
}
|
|
|