aboutsummaryrefslogtreecommitdiffstats
path: root/lua/pi/dap/configs/cpp.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/pi/dap/configs/cpp.lua')
-rw-r--r--lua/pi/dap/configs/cpp.lua33
1 files changed, 33 insertions, 0 deletions
diff --git a/lua/pi/dap/configs/cpp.lua b/lua/pi/dap/configs/cpp.lua
new file mode 100644
index 0000000..d51d6bd
--- /dev/null
+++ b/lua/pi/dap/configs/cpp.lua
@@ -0,0 +1,33 @@
+local dap = require("dap")
+
+dap.adapters.cppdbg = {
+ id = 'cppdbg',
+ type = 'executable',
+ command = '~/.local/share/nvim/mason/packages/cpptools/extension/debugAdapters/bin/OpenDebugAD7',
+}
+
+dap.configurations.cpp = {
+ {
+ name = "Launch file",
+ type = "cppdbg",
+ request = "launch",
+ program = function()
+ return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
+ end,
+ cwd = '${workspaceFolder}',
+ stopAtEntry = true,
+ },
+ {
+ name = 'Attach to gdbserver :1234',
+ type = 'cppdbg',
+ request = 'launch',
+ MIMode = 'gdb',
+ miDebuggerServerAddress = 'localhost:1234',
+ miDebuggerPath = '/usr/bin/gdb',
+ cwd = '${workspaceFolder}',
+ program = function()
+ return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
+ end,
+ },
+}
+dap.configurations.c = dap.configurations.cpp