diff options
| author | Elvis Claros Castro <elvis@claros.ar> | 2024-08-23 09:40:05 -0300 |
|---|---|---|
| committer | Elvis Claros Castro <elvis@claros.ar> | 2024-08-23 09:40:05 -0300 |
| commit | 969aa6d3444f857c383b0e271febe087cd224349 (patch) | |
| tree | 626929d795c5e4c262afb00570a87f3df0212fc3 /lua/pi/dap/configs/cpp.lua | |
| parent | 59ab00e081d92db8760d65f3146f4156a962d5e4 (diff) | |
| download | nvim-conf-969aa6d3444f857c383b0e271febe087cd224349.tar.gz nvim-conf-969aa6d3444f857c383b0e271febe087cd224349.zip | |
Feat: update
Diffstat (limited to 'lua/pi/dap/configs/cpp.lua')
| -rw-r--r-- | lua/pi/dap/configs/cpp.lua | 33 |
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 |