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
4,230 downloads per month
Used in 4 crates
(2 directly)
48KB
1K
SLoC
rstack
Remote stack tracing.
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
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