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

#830 in Debugging

Download history 3866/week @ 2024-07-22 3756/week @ 2024-07-29 3755/week @ 2024-08-05 3784/week @ 2024-08-12 2686/week @ 2024-08-19 1372/week @ 2024-08-26 1211/week @ 2024-09-02 1121/week @ 2024-09-09 791/week @ 2024-09-16 977/week @ 2024-09-23 1337/week @ 2024-09-30 1086/week @ 2024-10-07 861/week @ 2024-10-14 1239/week @ 2024-10-21 761/week @ 2024-10-28 1326/week @ 2024-11-04

4,230 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

~250–750KB
~18K SLoC