Update the debugging config

Add a debug mode with <leader>g
This commit is contained in:
ant 2024-06-12 21:13:56 +02:00
parent 2821a9a153
commit 619c9e8195
6 changed files with 109 additions and 30 deletions

View file

@ -1,18 +1,34 @@
local dap = require("dap")
dap.adapters.gdb = {
-- dap.configurations.c = {
-- {
-- name = "Launch",
-- type = "gdb",
-- request = "launch",
-- program = function()
-- return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
-- end,
-- cwd = "${workspaceFolder}",
-- },
-- }
dap.adapters.cppdbg = {
type = "executable",
command = "gdb",
args = { "-i", "dap" }
args = { "-i", "dap" },
console = 'externalTerminal',
-- terminal_win_cmd = "tabnew",
}
dap.configurations.c = {
{
name = "Launch",
type = "gdb",
request = "launch",
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end,
cwd = "${workspaceFolder}",
},
dap.adapters.lldb = {
type = 'executable',
command = 'lldb-vscode', -- adjust as needed, must be absolute path
name = 'lldb'
}
require('dap.ext.vscode').load_launchjs("dap_config.json", {
cppdbg = { 'c', 'cpp' },
lldb = { 'c', 'cpp' }
})
dap.set_log_level("TRACE")

View file

@ -78,7 +78,7 @@ end
vim.diagnostic.config({
virtual_text = false,
-- virtual_text = false,
-- signs = true,
-- underline = true,
-- update_in_insert = false,

View file

@ -1,3 +1,4 @@
local hydra = require("hydra.statusline")
local opts = {
options = {
icons_enabled = true,
@ -18,7 +19,7 @@ local opts = {
}
},
sections = {
lualine_a = { 'mode' },
lualine_a = { 'mode', {hydra.get_name, cond = hydra.is_active}},
lualine_b = { 'branch', 'diff' },
lualine_c = {
'filename',