unwind 0.1.0

An interface to libunwind
docs.rs failed to build unwind-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: unwind-0.4.2

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};

Cursor::local(|mut cursor| {
    loop {
        let ip = cursor.register(RegNum::IP)?;

        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()? {
            break;
        }
    }

    Ok(())
}).unwrap();