diff --git a/programs b/programs index 7e80b69..422e2e7 100644 --- a/programs +++ b/programs @@ -131,10 +131,12 @@ python-black bash-language-server vscode-css-languageserver rust-analyzer +gdb +lldb +python-debugpy arc-gtk-theme lxappearance-gtk3 radare2 -gdb typst # .local/bin/pyinstantref script diff --git a/src/.clang-format b/src/.clang-format new file mode 100644 index 0000000..f53616d --- /dev/null +++ b/src/.clang-format @@ -0,0 +1,5 @@ +--- +BasedOnStyle: LLVM +UseTab: Always +IndentWidth: 4 +TabWidth: 4 diff --git a/src/.config/nvim/lua/debugging.lua b/src/.config/nvim/lua/debugging.lua index 5a2fa53..5bd7a2f 100644 --- a/src/.config/nvim/lua/debugging.lua +++ b/src/.config/nvim/lua/debugging.lua @@ -16,9 +16,12 @@ local dapui = require("dapui") -- key bindings ---------------- -keymap("dd", dapui.setup) keymap("rs", dap.continue) -keymap("rt", dap.restart) +keymap("rt", function() + -- hard restart (lldb just stops when restarted) + dap.terminate() + dap.continue() +end) keymap("rr", dap.terminate) keymap("", dap.step_into) keymap("", dap.step_over) @@ -90,10 +93,10 @@ end dap.listeners.after.attach.dapui_config = function() dapui.open() end -dap.listeners.after.event_terminated.dapui_config = function() +dap.listeners.before.event_terminated.dapui_config = function() dapui.close() end -dap.listeners.after.event_exited.dapui_config = function() +dap.listeners.before.event_exited.dapui_config = function() dapui.close() end @@ -140,3 +143,24 @@ dap.configurations.python = { 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, + } +}