nvim-dap - C++ - cpptools - gcc gdb

https://github.com/microsoft/vscode-cpptools

msys mingw64 gcc gdb


local dap = require("dap")

dap.adapters.cppdbg = {
  id = 'cppdbg',
  type = 'executable',
  command = 'c:\\gnu\\tool\\cpptools\\extension\\debugAdapters\\bin\\OpenDebugAD7.exe',
  options = {
    detached = false
  }
}


local dap = require('dap')
dap.configurations.cpp = {
  {
    name = "Launch file",
    type = "cppdbg",
    request = "launch",
    program = function()
      return vim.fn.input('', vim.fn.getcwd() .. '/bin', 'file')
    end,
    cwd = '${workspaceFolder}/bin',
    stopAtEntry = false,
  }
}

dap.configurations.c = dap.configurations.cpp
dap.configurations.rust = dap.configurations.cpp

dapui = require("dapui")
dap.listeners.after.event_initialized["dapui_config"] = function()
  dapui.open()
end
dap.listeners.before.event_terminated["dapui_config"] = function()
  dapui.close()
end
dap.listeners.before.event_exited["dapui_config"] = function()
  dapui.close()
end
posted @ 2023-04-15 11:21  fndefbwefsowpvqfx  阅读(256)  评论(0编辑  收藏  举报