nvim: get basic cpp debugging working
This commit is contained in:
parent
3c3bb83ff7
commit
c3669df95a
4
programs
4
programs
@ -131,10 +131,12 @@ python-black
|
|||||||
bash-language-server
|
bash-language-server
|
||||||
vscode-css-languageserver
|
vscode-css-languageserver
|
||||||
rust-analyzer
|
rust-analyzer
|
||||||
|
gdb
|
||||||
|
lldb
|
||||||
|
python-debugpy
|
||||||
arc-gtk-theme
|
arc-gtk-theme
|
||||||
lxappearance-gtk3
|
lxappearance-gtk3
|
||||||
radare2
|
radare2
|
||||||
gdb
|
|
||||||
typst
|
typst
|
||||||
|
|
||||||
# .local/bin/pyinstantref script
|
# .local/bin/pyinstantref script
|
||||||
|
5
src/.clang-format
Normal file
5
src/.clang-format
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
BasedOnStyle: LLVM
|
||||||
|
UseTab: Always
|
||||||
|
IndentWidth: 4
|
||||||
|
TabWidth: 4
|
@ -16,9 +16,12 @@ local dapui = require("dapui")
|
|||||||
-- key bindings
|
-- key bindings
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
keymap("<leader>dd", dapui.setup)
|
|
||||||
keymap("<leader>rs", dap.continue)
|
keymap("<leader>rs", dap.continue)
|
||||||
keymap("<leader>rt", dap.restart)
|
keymap("<leader>rt", function()
|
||||||
|
-- hard restart (lldb just stops when restarted)
|
||||||
|
dap.terminate()
|
||||||
|
dap.continue()
|
||||||
|
end)
|
||||||
keymap("<leader>rr", dap.terminate)
|
keymap("<leader>rr", dap.terminate)
|
||||||
keymap("<c-p>", dap.step_into)
|
keymap("<c-p>", dap.step_into)
|
||||||
keymap("<c-n>", dap.step_over)
|
keymap("<c-n>", dap.step_over)
|
||||||
@ -90,10 +93,10 @@ end
|
|||||||
dap.listeners.after.attach.dapui_config = function()
|
dap.listeners.after.attach.dapui_config = function()
|
||||||
dapui.open()
|
dapui.open()
|
||||||
end
|
end
|
||||||
dap.listeners.after.event_terminated.dapui_config = function()
|
dap.listeners.before.event_terminated.dapui_config = function()
|
||||||
dapui.close()
|
dapui.close()
|
||||||
end
|
end
|
||||||
dap.listeners.after.event_exited.dapui_config = function()
|
dap.listeners.before.event_exited.dapui_config = function()
|
||||||
dapui.close()
|
dapui.close()
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -140,3 +143,24 @@ dap.configurations.python = {
|
|||||||
console = "integratedTerminal";
|
console = "integratedTerminal";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- https://github.com/mfussenegger/nvim-dap/wiki/Debug-Adapter-installation#ccrust-via-gdb
|
||||||
|
dap.adapters.lldb = {
|
||||||
|
type = "executable",
|
||||||
|
command = "/usr/bin/lldb-vscode",
|
||||||
|
name = "lldb"
|
||||||
|
}
|
||||||
|
|
||||||
|
dap.configurations.cpp = {
|
||||||
|
{
|
||||||
|
name = "launch binary",
|
||||||
|
type = "lldb",
|
||||||
|
request = "launch",
|
||||||
|
program = function()
|
||||||
|
return vim.fn.input("binary: ", vim.fn.getcwd() .. "/", "file")
|
||||||
|
end,
|
||||||
|
cwd = "${workspaceFolder}",
|
||||||
|
stopOnEntry = false,
|
||||||
|
runInTerminal = true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user