Skip to content

Commit

Permalink
feat: Configured a better debugger (codelldb) for CPP with pretty pri…
Browse files Browse the repository at this point in the history
…nting CPP containers.
  • Loading branch information
muhammadzkralla committed Oct 18, 2024
1 parent 16332e5 commit 2812626
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lazy-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" },
"nvim-dap": { "branch": "master", "commit": "7ff6936010b7222fea2caea0f67ed77f1b7c60dd" },
"nvim-dap-ui": { "branch": "master", "commit": "ffa89839f97bad360e78428d5c740fdad9a0ff02" },
"nvim-lspconfig": { "branch": "master", "commit": "541f3a2781de481bb84883889e4d9f0904250a56" },
"nvim-lspconfig": { "branch": "master", "commit": "d6b0c3b38cdb45dcbd658efc2bb721568f68d93f" },
"nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" },
"nvim-treesitter": { "branch": "master", "commit": "92725df6222614307c4712eb9982e5287f21aa11" },
"nvim-treesitter": { "branch": "master", "commit": "68b2bdd99d889e9705f7e90ae64d990f3ff03cf3" },
"nvim-web-devicons": { "branch": "master", "commit": "19d257cf889f79f4022163c3fbb5e08639077bd8" },
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
"rose-pine": { "branch": "main", "commit": "d396005db5bbd1d4ec7772a7c96c96f4c4802328" },
Expand Down
24 changes: 23 additions & 1 deletion lua/plugins/dap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,19 @@ return {
command = '/home/zkrallah/.local/share/nvim/mason/packages/cpptools/extension/debugAdapters/bin/OpenDebugAD7',
}

dap.adapters.codelldb = {
type = 'server',
port = "${port}",
executable = {
command = '/home/zkrallah/.local/share/nvim/mason/bin/codelldb', -- Path to lldb-vscode
args = { "--port", "${port}" },
},
name = "lldb"
}

dap.configurations.cpp = {
{
name = "Launch file",
name = "Launch file using cpppdbg",
type = "cppdbg",
request = "launch",
program = function()
Expand All @@ -27,6 +37,18 @@ return {
cwd = '${workspaceFolder}',
stopAtEntry = true,
},
{
name = "Launch file using codelldb",
type = "codelldb",
request = "launch",
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end,
cwd = '${workspaceFolder}',
stopAtEntry = false,
args = {},
runInTerminal = false,
},
{
name = 'Attach to gdbserver :1234',
type = 'cppdbg',
Expand Down

0 comments on commit 2812626

Please sign in to comment.