From 969aa6d3444f857c383b0e271febe087cd224349 Mon Sep 17 00:00:00 2001 From: Elvis Claros Castro Date: Fri, 23 Aug 2024 09:40:05 -0300 Subject: Feat: update --- lua/pi/dap/configs/cpp.lua | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 lua/pi/dap/configs/cpp.lua (limited to 'lua/pi/dap/configs/cpp.lua') 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 -- cgit v1.2.3