"Life is all about sharing. If we are good at something, pass it on." - Mary Berry

Debug Rust in Helix using lldb-vscode: display the contents of local string variables


In a previous post titled debugging Rust in Helix, I introduced a workaround using codelldb to address the visualization issue related to string variables within lldb-vscode.

However, the usage of codelldb presents some challenges:

codelldb breaks helix theme

In my quest for an improved debugging experience, I found rust-lldb, which impressively manages to display the contents of string variables:


How to debug Rust in Helix?


Helix supports debugging Rust by default using lldb-vscode. However, there is an issue where string variables are displayed as memory addresses instead of their actual values:

lldb-vscode - string variables memory addresses

Noticing that CodeLLDB natively supports visualization of most common Rust data types, I would like to give it a try.

Here’s the step-by-step process:

Download the CodeLLDB extension:

1$ cd ~/Downloads/
2$ wget https://github.com/vadimcn/codelldb/releases/download/v1.9.2/codelldb-aarch64-darwin.vsix

Setup the extension:

1$ mkdir -p ~/.local
2$ set fish_user_paths /Users/quantong/.local/extension/adapter $fish_user_paths
3$ codelldb

If you encountered this error: