6 releases (3 breaking)

0.4.2 Dec 22, 2023
0.4.1 Feb 26, 2022
0.4.0 Nov 4, 2020
0.3.0 Oct 13, 2019
0.1.0 Nov 7, 2017

#685 in Debugging

Download history 3097/week @ 2024-01-01 3648/week @ 2024-01-08 3879/week @ 2024-01-15 3956/week @ 2024-01-22 4601/week @ 2024-01-29 4764/week @ 2024-02-05 5014/week @ 2024-02-12 5364/week @ 2024-02-19 4076/week @ 2024-02-26 4673/week @ 2024-03-04 4802/week @ 2024-03-11 5156/week @ 2024-03-18 3748/week @ 2024-03-25 4276/week @ 2024-04-01 3959/week @ 2024-04-08 4264/week @ 2024-04-15

16,447 downloads per month
Used in 4 crates (2 directly)

MIT/Apache

48KB
1K SLoC

rstack

Documentation

Remote stack tracing.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


lib.rs:

An interface to libunwind.

libunwind provides access to the call chain of a process. It supports both local and remote processes.

Examples

Printing a backtrace of the current thread:

use unwind::{Cursor, RegNum, get_context};

get_context!(context);
let mut cursor = Cursor::local(context).unwrap();

loop {
    let ip = cursor.register(RegNum::IP).unwrap();

    match (cursor.procedure_info(), cursor.procedure_name()) {
        (Ok(ref info), Ok(ref name)) if ip == info.start_ip() + name.offset() => {
            println!(
                "{:#016x} - {} ({:#016x}) + {:#x}",
                ip,
                name.name(),
                info.start_ip(),
                name.offset()
            );
        }
        _ => println!("{:#016x} - ????", ip),
    }

    if !cursor.step().unwrap() {
        break;
    }
}

Dependencies

~0.3–0.8MB
~20K SLoC