Skip to content
New issue

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

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

Already on GitHub? # to your account

Bash debugger implementation discussion #67

Open
MuhammadSawalhy opened this issue Feb 20, 2022 · 0 comments
Open

Bash debugger implementation discussion #67

MuhammadSawalhy opened this issue Feb 20, 2022 · 0 comments

Comments

@MuhammadSawalhy
Copy link

I have used rogalmic/vscode-bash-debug with nvim-dap to debug bash scripts. it seems that it is no longer maintained, but an unmaintained debugger is better than nothing.

Plug 'rogalmic/vscode-bash-debug', { 'do': 'npm install && npm run compile' }
dap.adapters = {
  bashdb = {
    type = "executable",
    command = "node",
    args = {vim.g.plug_home .. "/vscode-bash-debug/out/bashDebug.js"}
  },
}

local config = {
  bash = {
    {
      type = 'bashdb',
      request = 'launch',
      name = 'Launch file',
      program = '${file}',
      cwd = vim.fn.getcwd(),
      args = function()
        local args_string = vim.fn.input('Arguments: ')
        return vim.split(args_string, " +")
      end,
      env = {
        BASHDB_HOME = vim.g.plug_home .. '/vscode-bash-debug/bashdb_dir',
      },
      protocol = 'inspector',
      console = 'integratedTerminal',
      pathBashdb = vim.g.plug_home .. '/vscode-bash-debug/bashdb_dir/bashdb',
      pathBashdbLib = vim.g.plug_home .. '/vscode-bash-debug/bashdb_dir',
      pathMkfifo = 'mkfifo',
      pathPkill = 'pkill',
      pathBash = 'bash',
      pathCat = 'cat',
    },
  },
}

dap.configurations = {
  bash = config.bash,
  sh = config.bash,
}
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant