From bd2185c23d2f79de2ce478d2ab6a30af52748d25 Mon Sep 17 00:00:00 2001 From: Jacob McDonnell Date: Wed, 14 Feb 2024 20:13:49 -0500 Subject: Configuring lldb dap integration --- .config/nvim/lua/dap_lldb.lua | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .config/nvim/lua/dap_lldb.lua (limited to '.config/nvim/lua') 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() -- cgit v1.2.3