add debugging config

This commit is contained in:
vladstojna 2023-04-22 19:50:41 +01:00 committed by vladstojna
parent 7419bd147e
commit dd144abebf
8 changed files with 40 additions and 1 deletions

View File

@ -213,7 +213,7 @@ require('lazy').setup({
-- These are some example plugins that I've included in the kickstart repository.
-- Uncomment any of the lines below to enable them.
-- require 'kickstart.plugins.autoformat',
-- require 'kickstart.plugins.debug',
require 'kickstart.plugins.debug',
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
-- You can use this folder to prevent any conflicts with this init.lua if you're interested in keeping

View File

@ -0,0 +1,10 @@
local dap = require('dap')
dap.adapters.codelldb = {
type = 'server',
port = "${port}",
executable = {
command = vim.fn.stdpath('data') .. '/mason/bin/codelldb',
args = { "--port", "${port}" },
}
}

View File

@ -0,0 +1,7 @@
local dap = require('dap')
dap.adapters.cppdbg = {
id = 'cppdbg',
type = 'executable',
command = vim.fn.stdpath('data') .. '/mason/bin/OpenDebugAD7'
}

View File

@ -0,0 +1 @@
require('custom.dap.adapters.cpptools')

View File

@ -0,0 +1,6 @@
local dap = require('dap')
dap.adapters.lldb = {
type = 'executable',
command = 'lldb-vscode'
}

View File

@ -0,0 +1,7 @@
local dap_vscode = require('dap.ext.vscode')
dap_vscode.load_launchjs(nil, {
cppdbg = { 'c', 'cpp', 'rust' },
lldb = { 'c', 'cpp', 'rust' },
codelldb = { 'c', 'cpp', 'rust' },
})

2
lua/custom/dap/init.lua Normal file
View File

@ -0,0 +1,2 @@
require('custom.dap.adapters')
require('custom.dap.config')

View File

@ -13,6 +13,7 @@ return {
dependencies = {
-- Creates a beautiful debugger UI
'rcarriga/nvim-dap-ui',
'theHamsta/nvim-dap-virtual-text',
-- Installs the debug adapters for you
'williamboman/mason.nvim',
@ -20,6 +21,7 @@ return {
-- Add your own debuggers here
'leoluz/nvim-dap-go',
'mfussenegger/nvim-dap-python',
},
config = function()
local dap = require 'dap'
@ -83,5 +85,9 @@ return {
-- Install golang specific config
require('dap-go').setup()
-- Install python specific config
require('dap-python').setup()
-- Setup additional adapter/configuration definitions
require('custom.dap')
end,
}