Skip to content

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

Open

Description

@hiberabyss

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!

Activity

  1. brownts commented on Nov 20, 2022

    @brownts
    Collaborator

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions