#dwarf #debug-info

bin+lib rudy-db

A user-friendly library for interacting with debugging information of Rust compiled artifacts using DWARF

10 releases

Uses new Rust 2024

0.0.10 Aug 9, 2025
0.0.9 Jul 26, 2025
0.0.2 Jun 29, 2025

#613 in Debugging


Used in rudy-lldb

MIT license

1MB
11K SLoC

Rudy Logo Rudy


Crates.io Documentation License: MIT

A Rust library for interacting with debugging information of compiled artifacts using DWARF format. Provides lazy evaluation and incremental computation for long-running processes like debuggers.

⚠️ Experimental Status: This library is in early development (0.0.x). The API is unstable and subject to breaking changes.

[!IMPORTANT] See the announcement post for more on the rationale/design behind Rudy.

LLDB Extension

We also provide an example rudy-lldb extension that brings the capabilities of rudy-db to the lldb debugger.

Here's a short demo:

rudy-lldb demo

Installation (rudy-lldb)

Quick Install:

cargo install rudy-lldb
rudy-lldb-server install

This will download the LLDB client script and configure your ~/.lldbinit automatically.

Manual Install:

  • Install rudy-lldb from source: cargo install rudy-lldb
  • Download the client: curl https://raw.githubusercontent.com/samscott89/rudy/main/rudy-lldb/python/rudy_lldb.py -o ~/.lldb/rudy_lldb.py
  • Add to ~/.lldbinit: echo "command script import ~/.lldb/rudy_lldb.py" >> ~/.lldbinit

Server Management: The rudy-lldb server will automatically start when you run your first rd command in LLDB. You can also manage it manually:

  • rudy-lldb-server start - Start the server
  • rudy-lldb-server stop - Stop the server
  • Set RUDY_AUTOSTART=0 to disable automatic server startup

Architecture

  • Low-level DWARF parsing (rudy-dwarf) - Parser combinators and visitor patterns abstracting gimli
  • High-level API (rudy-db) - DebugInfo wrapper with salsa-based incremental caching
  • LLDB integration (rudy-lldb) - RPC server for interactive debugging

Features

  • Lazy evaluation using salsa for incremental computation
  • Low-level DWARF parser combinators and visitor structs
  • Higher-level DebugInfo wrapper for common debugging operations
  • Cross-platform support (x86_64, aarch64 on macOS, Linux)

Basic Usage (rudy-db)

Here's a simple example of loading a binary and resolving type information from a memory address:

use rudy_db::DebugDb;
use anyhow::Result;

fn main() -> Result<()> {
    // Create a new database
    let mut db = DebugDb::new();

    // Get debug information for a binary
    let debug_info = DebugInfo::new(&db, "/path/to/binary")?;
    
    // Find a function by name
    let function = db.find_function_by_name("my_function")?;

    // get all params:
    for param in &function.params {
        println!("Param: {:?} with type: {}", param.name, param.ty.display_name());
    }
    
    Ok(())
}

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Built on top of gimli for DWARF parsing
  • Uses salsa for incremental computation

Note: This is an experimental project. Please report any issues or feature requests on our GitHub issue tracker.

Dependencies

~18MB
~304K SLoC