Finally got dap all configured, works with c/c++ and godot (gdscript).

Need to figure out a watch window or something I have frame and sessions
window but those are not that usful (might also need hover and memory
window)
This commit is contained in:
2026-06-29 21:09:21 -07:00
parent 1738040c89
commit 3c3890f786
2 changed files with 52 additions and 0 deletions
+47
View File
@@ -102,6 +102,12 @@ dap.adapters.godot = {
port = 6006,
}
dap.adapters.gdb = {
type = "executable",
command = "gdb",
args = { "--interpreter=dap", "--eval-command", "set print pretty on" }
}
dap.configurations.gdscript = {
{
type = "godot",
@@ -111,3 +117,44 @@ dap.configurations.gdscript = {
scene = "main"
}
}
dap.configurations.c = {
{
name = "Launch",
type = "gdb",
request = "launch",
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end,
args = {}, -- provide arguments if needed
cwd = "${workspaceFolder}",
stopAtBeginningOfMainSubprogram = false,
},
{
name = "Select and attach to process",
type = "gdb",
request = "attach",
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end,
pid = function()
local name = vim.fn.input('Executable name (filter): ')
return require("dap.utils").pick_process({ filter = name })
end,
cwd = '${workspaceFolder}'
},
{
name = 'Attach to gdbserver :1234',
type = 'gdb',
request = 'attach',
target = 'localhost:1234',
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end,
cwd = '${workspaceFolder}'
}
}
dap.configurations.cpp = dap.configurations.c
-- TODO: could do rust, zig, odin, jai (?)