3 [![Build Status](https://travis-ci.org/alexcrichton/backtrace-rs.svg?branch=master)](https://travis-ci.org/alexcrichton/backtrace-rs)
4 [![Build status](https://ci.appveyor.com/api/projects/status/v4l9oj4aqbbgyx44?svg=true)](https://ci.appveyor.com/project/alexcrichton/backtrace-rs)
6 [Documentation](https://docs.rs/backtrace)
8 A library for acquiring backtraces at runtime for Rust. This library aims to
9 enhance the support given by the standard library at `std::rt` by providing a
10 more stable and programmatic interface.
20 extern crate backtrace;
23 Note that this crate requires `make`, `objcopy`, and `ar` to be present on Linux
28 To simply capture a backtrace and defer dealing with it until a later time,
29 you can use the top-level `Backtrace` type.
32 extern crate backtrace;
34 use backtrace::Backtrace;
37 let bt = Backtrace::new();
45 If, however, you'd like more raw access to the actual tracing functionality, you
46 can use the `trace` and `resolve` functions directly.
49 extern crate backtrace;
52 backtrace::trace(|frame| {
54 let symbol_address = frame.symbol_address();
56 // Resolve this instruction pointer to a symbol name
57 backtrace::resolve(ip, |symbol| {
58 if let Some(name) = symbol.name() {
61 if let Some(filename) = symbol.filename() {
66 true // keep going to the next frame
73 This library currently supports OSX, Linux, and Windows. Support for other
74 platforms is always welcome!
78 This project is licensed under either of
80 * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
81 http://www.apache.org/licenses/LICENSE-2.0)
82 * MIT license ([LICENSE-MIT](LICENSE-MIT) or
83 http://opensource.org/licenses/MIT)
89 Unless you explicitly state otherwise, any contribution intentionally submitted
90 for inclusion in backtrace-rs by you, as defined in the Apache-2.0 license, shall be
91 dual licensed as above, without any additional terms or conditions.