Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Is it possible to use this in vim/neovim with nvim-dap #386

Open
hiberabyss opened this issue Nov 17, 2022 · 1 comment

Comments

@hiberabyss
Copy link

Hi, I'm looking for a gdb adapter supporting running gdb via ssh. This plugin could achieve this.

How to make this work with neovim dap client?

Seems need to know how to start the adapter with a command.

Thanks!

@brownts
Copy link
Collaborator

brownts commented Nov 20, 2022

Hi @hiberabyss:

I'm not a Neovim user, but I did take a look at the example configurations on the link you provided and the following is what I believe you'd need to do to use this extension:

  • Download and unzip the .vsix file from the releases page
  • Install node if it isn't already installed.

I haven't tested the following configuration, but this is what I'd think would be appropriate based on the examples. This configures this extension to be used as the debug adapter for GDB to debug a C application. Change this based on whatever language you are trying to debug. Additionally, you may want different SSH parameters, based on how you plan to authenticate (password vs keyfile) or additional SSH options.

local dap = require("dap")
dap.adapters.gdb = {
  type = "executable",
  command = "node",
  args = {"./out/src/gdb.js"},
  cwd = "/path/to/unzipped/vsix"
}

dap.configurations.c = {
  {
    type = "gdb", -- Must match name of DAP adapter defined above
    request = "launch",
    name = "GDB: Launch over SSH",
    target = "<application name>",
    cwd = "${workspaceFolder}",
    ssh = {
      host = "<remote host>",
      user = "<user name>",
      cwd = "<cwd on remote machine>",
      keyfile = "<location of keyfile>",
      forwardX11 = false
    }
  }
}

Let us know if this works or if you had to make changes from this. It would be good to have this extension added to the documentation for the Neovim DAP client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants