VSCode + CodeLLDB + Rust-Analyzer = Hung Debugger?

Hi,

I'm seeing fairly odd behavior when trying to do a basic debugging scenario. I can't seem to get it to work, at all, in VSCode. I have been successful at getting basic debugging working in Helix, and I've definitely used this setup with VSCode in the past successfully.

I'm seeing a couple odd things:

  1. When I start a run from the Debugger panel, I get a "in progress" status bar, but no instance shows up under the Call Stack pane.
  2. If I then hit "Debug" in the code view, I see the first, and the new instance in the Call Stack, but it similarly doesn't actually start debugging.
  3. At this point, everything seems jammed. I can't stop the debugging sessions, and they never start actually debugging.

I have rust-analyzer and CodeLLDB installed, and the required tools are on my PATH (again, more or less confirmed by this scenario working inside Helix.)

I have recorded a video demonstrating this behavior, in case the description is not clear.

I'm pretty stumped. I'm not seeing much helpful output anywhere, in any of the Terminal/Console/extension panes. I'm pretty desperate for any suggestions of what to try or look into.

Thanks very much!

I now tried a matrix of things:

  1. Various versions of Rust, stable and nightly.
  2. Various versions of LLVM packages (LLDB), including LLVM 15.
  3. With and without using the bundled rust-analyzer binary.

All exhibit the same behavior, unfortunately. All working with helix but not code.

Weird, I think I've never encountered this. Have you tried using "bin" : "path/to/binary" config directly in launch.json instead of using "cargo": ...? Or try read LLVM plugin output?

And rust-analyzer almost surely have no effect on this.

I have just commented out the cargo section and tried with:

"program": "target/debug/cfdyndns"

and it exhibits the same behavior. The LLDB plugin window shows this:

Initial debug configuration: {
  type: 'lldb',
  request: 'launch',
  name: "Debug executable 'cfdyndns'",
  program: 'target/debug/cfdyndns',
  args: [],
  cwd: '${workspaceFolder}',
  __configurationTarget: 6
}
Resolved debug configuration: {
  type: 'lldb',
  request: 'launch',
  name: "Debug executable 'cfdyndns'",
  program: 'target/debug/cfdyndns',
  args: [],
  cwd: '${workspaceFolder}',
  __configurationTarget: 6,
  relativePathBase: '/home/cole/code-tmp/cfdyndns',
  _adapterSettings: {
    displayFormat: 'auto',
    showDisassembly: 'auto',
    dereferencePointers: true,
    suppressMissingSourceFiles: true,
    evaluationTimeout: 5,
    consoleMode: 'commands',
    sourceLanguages: null,
    terminalPromptClear: null,
    evaluateForHovers: true,
    commandCompletions: true,
    reproducer: false
  }
}

and then nothing else.

To clarify, I'm re-running cargo build frequently, too, so the binary is there and up-to-date.

I think this is a NixOS thing, using home-manager to install VSCode/VSCodium with the FHS package mostly unblocked me. For whatever reason the built-in rust-analyzer binary still doesn't work, but when I instruct that plugin to use the PATH's rust-analyzer, I'm seeing the debugger startup and hit my breakpoint.

Going to call this is a NixOS quirk and move on. Thanks for the help and anyone else who took a look.

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.