summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/dap_lldb.lua
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@jacobmcdonnell.com>2024-02-14 20:13:49 -0500
committerJacob McDonnell <jacob@jacobmcdonnell.com>2024-02-14 20:13:49 -0500
commitbd2185c23d2f79de2ce478d2ab6a30af52748d25 (patch)
treef03a6eec682320136910b7f89416de72d07b23c0 /.config/nvim/lua/dap_lldb.lua
parentf676cc983cc89e3a3dd3ec5b18c6a2675c10a4ee (diff)
Configuring lldb dap integration
Diffstat (limited to '.config/nvim/lua/dap_lldb.lua')
-rw-r--r--.config/nvim/lua/dap_lldb.lua37
1 files changed, 37 insertions, 0 deletions
diff --git a/.config/nvim/lua/dap_lldb.lua b/.config/nvim/lua/dap_lldb.lua
new file mode 100644
index 0000000..495fb72
--- /dev/null
+++ b/.config/nvim/lua/dap_lldb.lua
@@ -0,0 +1,37 @@
+local dap = require('dap')
+dap.adapters.lldb = {
+ type = 'executable',
+ command = '/usr/bin/lldb-vscode', -- adjust as needed, must be absolute path
+ name = 'lldb'
+}
+
+local dap = require('dap')
+dap.configurations.c = {
+ {
+ name = 'Launch',
+ type = 'lldb',
+ request = 'launch',
+ program = function()
+ return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
+ end,
+ cwd = '${workspaceFolder}',
+ stopOnEntry = false,
+ args = {},
+
+ -- 💀
+ -- if you change `runInTerminal` to true, you might need to change the yama/ptrace_scope setting:
+ --
+ -- echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
+ --
+ -- Otherwise you might get the following error:
+ --
+ -- Error on launch: Failed to attach to the target process
+ --
+ -- But you should be aware of the implications:
+ -- https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html
+ -- runInTerminal = false,
+ },
+}
+
+dap.configurations.cpp = dap.configurations.c
+require("nvim-dap-virtual-text").setup()