Function backtrace::resolve [] [src]

pub fn resolve<F: FnMut(&Symbol)>(addr: *mut c_void, cb: F)

Resolve an address to a symbol, passing the symbol to the specified closure.

This function will look up the given address in areas such as the local symbol table, dynamic symbol table, or DWARF debug info (depending on the activated implementation) to find symbols to yield.

The closure may not be called if resolution could not be performed, and it also may be called more than once in the case of inlined functions.

Symbols yielded represent the execution at the specified addr, returning file/line pairs for that addres (if available).

Example

extern crate backtrace;

fn main() {
    backtrace::trace(|frame| {
        let ip = frame.ip();

        backtrace::resolve(ip, |symbol| {
            // ...
        });

        false // only look at the top frame
    });
}