diff options
| author | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2024-02-14 21:24:28 -0500 |
|---|---|---|
| committer | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2024-02-14 21:24:28 -0500 |
| commit | 2fba5da98a48fe1d562b6c015dda4a6fb4baccfe (patch) | |
| tree | 1c75a7775b009656cc2d5a10eb8636ae2029f835 /.config/nvim/lua/dap_lldb.lua | |
| parent | bd2185c23d2f79de2ce478d2ab6a30af52748d25 (diff) | |
Integrated dap nvim with lldb
Diffstat (limited to '.config/nvim/lua/dap_lldb.lua')
| -rw-r--r-- | .config/nvim/lua/dap_lldb.lua | 52 |
1 files changed, 20 insertions, 32 deletions
diff --git a/.config/nvim/lua/dap_lldb.lua b/.config/nvim/lua/dap_lldb.lua index 495fb72..40861d0 100644 --- a/.config/nvim/lua/dap_lldb.lua +++ b/.config/nvim/lua/dap_lldb.lua @@ -1,37 +1,25 @@ -local dap = require('dap') +local dap = require'dap' + +require("dapui").setup() + dap.adapters.lldb = { - type = 'executable', - command = '/usr/bin/lldb-vscode', -- adjust as needed, must be absolute path - name = 'lldb' + type = 'executable', + -- absolute path is important here, otherwise the argument in the `runInTerminal` request will default to $CWD/lldb-vscode + command = '/usr/bin/lldb-vscode', + 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, - }, + { + 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 = {}, + runInTerminal = true, + }, } -dap.configurations.cpp = dap.configurations.c -require("nvim-dap-virtual-text").setup() |
