July 9, 2025 (1mo ago):
rudy
is Rust-specific debuginfo tooling. By default,cargo build
invokesrustc
with-g
and outputs debug info with the binary. On MacOS and Linux,rustc
emits DWARF debugging info.rudy
consists ofrudy-dwarf
for directly interacting with DWARF info andrudy-db
for a higher-level interface. Its two main goals are to improve Rust debugging withlldb
viarudy-lldb
and build foundational tooling.
Rudy LLDB:
rudy-lldb
is a small application usingrudy-db
to provide an extension forlldb
. It works by adding the Python client to~/.lldbinit
, connecting to a locally-running server over TCP, and usingrudy-db
to query and forward information.- It extends
lldb
with Rust-specific functionality, understands Rust types and their memory layouts, and differentiates between functions, methods, and trait implementations.
Rudy Dwarf:
rudy-dwarf
is a "medium-level" library for interacting with DWARF info, sitting abovegimli
. It provides indexes for fast lookups, parser combinators for extracting data, and a visitor trait.- The parser is based on the
Parser
trait, which takes asalsa
database and aDie
(an opaque wrapper around an offset) and parses the DWARF info. Parser combinators likeall
are used to combine multiple parsers. - For example, complex Rust types like enums can be parsed using reusable components, and parser combinators make it easy to build custom functionality.
Using Salsa:
- The project initially aimed to build a Rust-specific debugger but was split into
rudy
.salsa
is used for incremental computation and caching inrudy-dwarf
andrudy-db
. - On MacOS,
rudy-db
computes indexes quickly for small projects (20-30ms) and larger projects (1-2s). Individual operations are fast after indexing (around 1ms for small, 10ms for large). - There are improvements to be made, especially on Linux where indexing the entire binary upfront is expensive. A follow-up post is planned to discuss the use of
salsa
in more detail.
- The project initially aimed to build a Rust-specific debugger but was split into
Digression: Why do we need better debugging tooling for Rust?:
- The author has used Rust for over 10 years and only used interactive debuggers for stack overflows. Print debugging can be a trap, and it would be helpful to have an interactive debugger to query the system state.
rudy
aims to makelldb
debugging a viable option and provide foundational tooling for the next generation of debug tooling.
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。