forge
Explore
Log in

Don't you dare go Hollow

dotfiles

Clone
★ 0

0 watching0 forksShellGPL-3.0334.8 KiBb1320e9Tahinli17 days ago105 commits

nvim-dap.lua51 lines, 1.7 KiBHistoryRawDownload
1return {
2 "mfussenegger/nvim-dap",
3 config = function()
4 local dap = require("dap")
5 dap.adapters.gdb = {
6 type = "executable",
7 command = "gdb",
8 args = { "--interpreter=dap", "--eval-command", "set print pretty on" }
9 }
10
11 local gdb = {
12 {
13 name = "Launch",
14 type = "gdb",
15 request = "launch",
16 program = function()
17 return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
18 end,
19 cwd = "${workspaceFolder}",
20 stopAtBeginningOfMainSubprogram = false,
21 },
22 {
23 name = "Select and attach to process",
24 type = "gdb",
25 request = "attach",
26 program = function()
27 return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
28 end,
29 pid = function()
30 local name = vim.fn.input('Executable name (filter): ')
31 return require("dap.utils").pick_process({ filter = name })
32 end,
33 cwd = '${workspaceFolder}'
34 },
35 {
36 name = 'Attach to gdbserver :1234',
37 type = 'gdb',
38 request = 'attach',
39 target = 'localhost:1234',
40 program = function()
41 return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
42 end,
43 cwd = '${workspaceFolder}'
44 },
45 }
46
47 dap.configurations.c = gdb
48 dap.configurations.asm = gdb
49 dap.configurations.cpp = gdb
50 end
51}