5 releases (3 breaking)
Uses new Rust 2024
new 0.4.0 | Jul 7, 2025 |
---|---|
0.3.0 | Jul 4, 2025 |
0.2.1 | Jul 1, 2025 |
0.2.0 | Jun 29, 2025 |
0.1.0 | Jun 27, 2025 |
#55 in Caching
575 downloads per month
Used in 3 crates
105KB
2.5K
SLoC
Rudy
A user-friendly library for interacting with debugging information of Rust compiled artifacts using DWARF.
⚠️ Experimental Status: This library is in early development (0.0.x). The API is unstable and subject to breaking changes. We welcome early adopters who are willing to provide feedback!
Features
- 🚀 Lazy evaluation - Parse only what you need, when you need it
- ♻️ Incremental recomputation - Powered by salsa for efficient caching
- 🔍 Type resolution - Resolve types from memory addresses
- 📊 Structured output - Walk fields and pretty-print complex data structures
- 🦀 Rust-focused - Optimized for Rust's specific debug information patterns
Installation
Add this to your Cargo.toml
:
[dependencies]
rudy-db = "0.0.1"
Basic Usage
Here's a simple example of loading a binary and resolving type information from a memory address:
use rudy_db::{DebugDatabase, TypeInfo};
use anyhow::Result;
fn main() -> Result<()> {
// Create a new database
let mut db = DebugDatabase::new()?;
// Load a Rust binary with debug information
let binary = db.analyze_file("path/to/your/rust/binary")?;
// Resolve type information at a specific address
let address = 0x12345678;
if let Some(type_info) = db.resolve_type_at_address(binary, address)? {
println!("Type at {:#x}: {}", address, type_info.name());
// Walk through fields for structured types
for field in type_info.fields() {
println!(" Field '{}': {}", field.name, field.type_name);
}
}
Ok(())
}
Memory Address Pretty-Printer Example
For a more complete example showing how to build a memory address pretty-printer, see the examples/pretty_printer.rs file.
Architecture
This library is designed for use in long-running processes like debuggers:
- Efficient caching: Parse debug information once and reuse it across multiple queries
- Lazy parsing: Only parse the compilation units and DIEs you actually need
- Incremental updates: When binaries change, only recompute affected queries
Supported Platforms
- Architectures: x86_64, aarch64
- Operating Systems: macOS, Linux
- Debug Formats: DWARF (primary focus)
Contributing
Contributions are welcome! Please feel free to submit issues and pull requests.
Development Setup
# Clone the repository
git clone https://github.com/samscott89/rudy
cd rudy
# Run tests
cargo test
# Run with examples
cargo run --example pretty_printer
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
- Inspired by the needs of Rust debugging tools
Note: This is an experimental project. Please report any issues or feature requests on our GitHub issue tracker.
lib.rs
:
Shared parsing utilities for types and expressions
This module provides common parsing functionality using the unsynn
crate
for both type parsing (used in DWARF name resolution) and expression parsing
(used in LLDB integration).
Dependencies
~7–13MB
~126K SLoC