simrat39 / rust-tools.nvim

Tools for better development in rust using neovim's builtin lsp
MIT License
2.17k stars 159 forks source link

Codelldb - Couldn't connect to 127.0.0.1:${port}: ECONNREFUSED #330

Closed dgriffith0 closed 1 year ago

dgriffith0 commented 1 year ago

I have working debug in VSCode. Decided to try to get debugging setup in neovim 0.8.2 with latest rust tools / dap. I keep getting error, Couldn't connect to 127.0.0.1:${port}: ECONNREFUSED when calling RustDebuggables and selecting one of the options. On windows 11.

Ive tried running codelldb --port 9999 and the command is valid (ive added it to path) and it at least looks like its working as I can generate some output in the terminal if i try to nav to 127.0.0.1:9999 in my browser.

I went thru the dap settings for rust w/ codelldb and have the following:

In rust tools I have:

local extension_path = 'C:/Users/dgrif/.vscode/extensions/vadimcn.vscode-lldb-1.8.1/'
local codelldb_path = extension_path .. 'adapter/codelldb'
local liblldb_path = extension_path .. 'lldb/bin/liblldb.dll' -- liblldb.so'  -- MacOS: This may be .dylib

local opts = {
  dap = {
    adapter = require('rust-tools.dap').get_codelldb_adapter(codelldb_path, liblldb_path)
  },
}
dgriffith0 commented 1 year ago

If anyone runs into this, i changed my extension path to the codelldb I installed via Mason instead of the codelldb installed via the vscode plugin. I have no idea why this works.

DieracDelta commented 1 year ago

~~I'm also running into this, and unsure of how to fix it. Could you elaborate a bit on what you mean by changing the path? What was the codelldb path before and after? ~~

EDIT: Nevermind! I had the library path wrong. Was pointing to libcodelldb.dylib not liblldb.dylib. Thanks for your example code in the above issue. It works now!

hawkinchina commented 1 year ago

thanks. i changed my extension path to the codelldb I installed via Mason. it works. and you can start codelldb automatically, not by manually.

ICE-BREAKER2353 commented 1 year ago

I have the same issue but changing the extension path doesnt change anything.