fix(ftplugin/c): Setup debugger only if the executable exists
Removed redundant `load_launchjs` as the plugin loads it automatically
This commit is contained in:
parent
b09c001954
commit
b2f592d529
@ -28,23 +28,28 @@ local conf = require("telescope.config").values
|
|||||||
local actions = require("telescope.actions")
|
local actions = require("telescope.actions")
|
||||||
local action_state = require("telescope.actions.state")
|
local action_state = require("telescope.actions.state")
|
||||||
|
|
||||||
if require('user.file_exists').file_exists(vim.fs.dirname(vim.fs.find(root_files, { upward = true })[1]) .. "/.vscode/launch.json") then
|
if vim.fn.executable('gdb') == 1 then
|
||||||
require("dap.ext.vscode").load_launchjs(nil, { cppdbg = { "c", "cpp", "asm" } })
|
dap.adapters.gdb = {
|
||||||
end
|
|
||||||
|
|
||||||
dap.adapters.gdb = {
|
|
||||||
type = "executable",
|
type = "executable",
|
||||||
command = "gdb",
|
command = "gdb",
|
||||||
args = { "-i", "dap" }
|
args = { "-i", "dap" }
|
||||||
}
|
}
|
||||||
|
end
|
||||||
|
|
||||||
dap.adapters.cppdbg = {
|
-- DAP loads this automatically as of now. May be needed to load the debugger for asm?
|
||||||
|
-- if require('user.file_exists').file_exists(vim.fs.dirname(vim.fs.find(root_files, { upward = true })[1]) .. "/.vscode/launch.json") then
|
||||||
|
-- require("dap.ext.vscode").load_launchjs(nil, { cppdbg = { "c", "cpp", "asm" } })
|
||||||
|
-- require("dap.ext.vscode").load_launchjs(nil, { gdb = { "c", "cpp", "asm" } })
|
||||||
|
-- end
|
||||||
|
|
||||||
|
if vim.fn.executable('OpenDebugAD7') == 1 then
|
||||||
|
dap.adapters.cppdbg = {
|
||||||
id = 'cppdbg',
|
id = 'cppdbg',
|
||||||
type = 'executable',
|
type = 'executable',
|
||||||
command = 'OpenDebugAD7',
|
command = 'OpenDebugAD7',
|
||||||
}
|
}
|
||||||
|
|
||||||
dap.configurations.c = {
|
dap.configurations.c = {
|
||||||
{
|
{
|
||||||
name = "Launch an executable",
|
name = "Launch an executable",
|
||||||
type = "cppdbg",
|
type = "cppdbg",
|
||||||
@ -71,4 +76,5 @@ dap.configurations.c = {
|
|||||||
end,
|
end,
|
||||||
stopAtBeginningOfMainSubprogram = true,
|
stopAtBeginningOfMainSubprogram = true,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user