jay-babu / mason-nvim-dap.nvim

GNU Affero General Public License v3.0
551 stars 39 forks source link

default config for cppdbg not working #103

Closed Felix-Kyun closed 1 year ago

Felix-Kyun commented 1 year ago

error: Sat_Jul_29_12-18-10_PM_IST_2023

my config:

-- plugin/dap.lua
{

      "mfussenegger/nvim-dap",
      {
        "jay-babu/mason-nvim-dap.nvim",
        config = function()
          require('mason-nvim-dap').setup({
            automatic_setup = true,
            handlers = {
              function(config)
                require('mason-nvim-dap').default_setup(config)
              end,
            },
          })
        end
      },
      {
        'rcarriga/nvim-dap-ui',
        config = function()
          require("dapui").setup()
        end
      }
    }
Felix-Kyun commented 1 year ago

i ended up configuring it manually here's the code

local dap = require 'dap'

-- c/cpp
dap.adapters.cppdbg = {
  id = 'cppdbg',
  type = 'executable',
  -- command = '/home/felix/.config/nvim/dap/gdb/extension/debugAdapters/bin/OpenDebugAD7',
  -- command = vim.fn.exepath('OpenDebugAD7'),
  command = '/home/felix/.local/share/nvim/mason/bin/OpenDebugAD7',
}
dap.configurations.c = {
  {
    name = "Launch file",
    type = "cppdbg",
    request = "launch",
    program = function()
      return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
    end,
    cwd = '${workspaceFolder}',
    stopAtEntry = true,
    setupCommands = {
      {
        text = '-enable-pretty-printing',
        description = 'enable pretty printing',
        ignoreFailures = false
      },
    },
  },
  {
    name = 'Attach to gdbserver :1234',
    type = 'cppdbg',
    request = 'launch',
    MIMode = 'gdb',
    miDebuggerServerAddress = 'localhost:1234',
    miDebuggerPath = '/usr/bin/gdb',
    cwd = '${workspaceFolder}',
    program = function()
      return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
    end,
    setupCommands = {
      {
        text = '-enable-pretty-printing',
        description = 'enable pretty printing',
        ignoreFailures = false
      },
    },
  },
}

nothing special though, it just uses mason to manage adapter instead of doing it manually

jay-babu commented 1 year ago

I am pretty sure this is what this plugin configures the dap with

Felix-Kyun commented 1 year ago

But can't seem to understand why that errors is occurring

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

github-actions[bot] commented 1 year ago

This issue has been closed due to inactivity, and will not be monitored. If this is a bug and you can reproduce this issue on a supported version of Electron please open a new issue and include instructions for reproducing the issue.

Xtscat commented 1 year ago

same error