diff options
| author | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2024-02-14 20:13:49 -0500 |
|---|---|---|
| committer | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2024-02-14 20:13:49 -0500 |
| commit | bd2185c23d2f79de2ce478d2ab6a30af52748d25 (patch) | |
| tree | f03a6eec682320136910b7f89416de72d07b23c0 | |
| parent | f676cc983cc89e3a3dd3ec5b18c6a2675c10a4ee (diff) | |
Configuring lldb dap integration
| -rw-r--r-- | .config/macosProfile | 2 | ||||
| -rw-r--r-- | .config/nvim/init.vim | 5 | ||||
| -rw-r--r-- | .config/nvim/lua/dap_lldb.lua | 37 |
3 files changed, 43 insertions, 1 deletions
diff --git a/.config/macosProfile b/.config/macosProfile index d088a6d..7f955ce 100644 --- a/.config/macosProfile +++ b/.config/macosProfile @@ -1,7 +1,7 @@ eval "$(/opt/homebrew/bin/brew shellenv)" export CEDEV=/opt/CEdev export ProMust=/opt/ProjectMustang -export PATH=$ProMust/bin:~/.codon/bin:~/.local/bin:$CEDEV/bin:$PATH:$HOME/Library/Python/3.9/bin:$HOME/go/bin +export PATH=/opt/homebrew/opt/llvm/bin:$ProMust/bin:~/.codon/bin:~/.local/bin:$CEDEV/bin:$PATH:$HOME/Library/Python/3.9/bin:$HOME/go/bin export EDITOR=nvim export HOMEBREW_EDITOR=nvim diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index cbca761..3503890 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -66,6 +66,9 @@ Plug 'nvim-lua/plenary.nvim' Plug 'nvim-telescope/telescope.nvim', { 'tag': '0.1.x' } Plug 'ThePrimeagen/harpoon', { 'branch': 'harpoon2' } Plug 'neovim/nvim-lspconfig' +Plug 'mfussenegger/nvim-dap' +Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} +Plug 'theHamsta/nvim-dap-virtual-text' call plug#end() let g:coc_global_extensions = [ @@ -82,6 +85,8 @@ let g:coc_global_extensions = [ lua vim.g.coq_settings = {auto_start = 'shut-up',} +lua require("dap_lldb") + " Goyo plugin makes text more readable when writing prose: map <leader>f :Goyo \| set linebreak<CR> 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() |
