pub(crate) fn print(
    core: &mut Core,
    elf: &Elf,
    active_ram_region: &Option<RamRegion>,
    settings: &Settings,
) -> anyhow::Result<Outcome> {
    let unwind = unwind::target(core, elf, active_ram_region);

    let frames = symbolicate::frames(&unwind.raw_frames, settings.current_dir, elf);

    let contains_exception = unwind
        .raw_frames
        .iter()
        .any(|raw_frame| raw_frame.is_exception());

    let print_backtrace = settings.force_backtrace
        || unwind.outcome == Outcome::StackOverflow
        || unwind.corrupted
        || contains_exception;

    if print_backtrace && settings.max_backtrace_len > 0 {
        pp::backtrace(&frames, &settings);

        if unwind.corrupted {
            log::warn!("call stack was corrupted; unwinding could not be completed");
        }
        if let Some(err) = unwind.processing_error {
            log::error!(
                "error occurred during backtrace creation: {:?}\n               \
                         the backtrace may be incomplete.",
                err
            );
        }
    }

    Ok(unwind.outcome)
}
/// (virtually) unwinds the target's program and prints its backtrace
(virtually) unwinds the target's program and prints its backtrace
( virtually ) unwinds the target ' s program and prints its backtrace
pub(crate) fn print(
    core: &mut Core,
    elf: &Elf,
    active_ram_region: &Option<RamRegion>,
    settings: &Settings,
) -> anyhow::Result<Outcome> {
    let unwind = unwind::target(core, elf, active_ram_region);
    let frames = symbolicate::frames(&unwind.raw_frames, settings.current_dir, elf);
    let contains_exception = unwind
        .raw_frames
        .iter()
        .any(|raw_frame| raw_frame.is_exception());
    let print_backtrace = settings.force_backtrace
        || unwind.outcome == Outcome::StackOverflow
        || unwind.corrupted
        || contains_exception;
    if print_backtrace && settings.max_backtrace_len > 0 {
        pp::backtrace(&frames, &settings);
        if unwind.corrupted {
            log::warn!("call stack was corrupted; unwinding could not be completed");
        }
        if let Some(err) = unwind.processing_error {
            log::error!(
                "error occurred during backtrace creation: {:?}\n               \
                         the backtrace may be incomplete.",
                err
            );
        }
    }
    Ok(unwind.outcome)
}
pub ( crate ) fn print ( core : & mut Core , elf : & Elf , active_ram_region : & Option < RamRegion > , settings : & Settings , ) -> anyhow :: Result < Outcome > { let unwind = unwind :: target ( core , elf , active_ram_region ) ; let frames = symbolicate :: frames ( & unwind . raw_frames , settings . current_dir , elf ) ; let contains_exception = unwind . raw_frames . iter ( ) . any ( | raw_frame | raw_frame . is_exception ( ) ) ; let print_backtrace = settings . force_backtrace || unwind . outcome == Outcome :: StackOverflow || unwind . corrupted || contains_exception ; if print_backtrace && settings . max_backtrace_len > 0 { pp :: backtrace ( & frames , & settings ) ; if unwind . corrupted { log :: warn ! ( " " ) ; } if let Some ( err ) = unwind . processing_error { log :: error ! ( " \n \
 " err ) ; } } Ok ( unwind . outcome ) }
(virtually) unwinds the target's program and prints its backtrace
( virtually ) unwinds the target ' s program and prints its backtrace
core
&mut Core
elf
&Elf
active_ram_region
&Option<RamRegion>
settings
&Settings
core
&mut Core
elf
&Elf
active_ram_region
&Option<RamRegion>
settings
&Settings