-- https://github.com/mfussenegger/nvim-dap ---@type LazyPluginSpec return { "mfussenegger/nvim-dap", keys = { { "db", function() require("dap").toggle_breakpoint() end, }, { "", function() require("dap.ui.widgets").hover() end, }, { "", function() require("dap").step_into() end, }, { "", function() require("dap").step_over() end, }, { "", function() require("dap").step_out() end, }, { "", function() require("dap").continue() end, }, { "", function() local widgets = require("dap.ui.widgets") widgets.centered_float(widgets.scopes) end, }, { "", function() require("dap").terminate() end, }, }, config = function() local dap = require("dap") -- https://sourceware.org/gdb/current/onlinedocs/gdb#Debugger-Adapter-Protocol dap.adapters.gdb = { type = "executable", command = "gdb", args = { "--interpreter=dap", "--eval-command", "set print pretty on", "--eval-command", "set startup-with-shell off", }, } dap.configurations.cpp = { { name = "Launch", type = "gdb", request = "launch", program = function() return vim.fn.input( "Path to executable: ", vim.fn.getcwd() .. "/", "file" ) end, cwd = "${workspaceFolder}", stopAtBeginningOfMainSubprogram = false, }, } end, }