Skip to content

Commit

Permalink
format symbols under shared frames
Browse files Browse the repository at this point in the history
  • Loading branch information
KodrAus authored and JDuchniewicz committed Jun 7, 2021
1 parent e4a6032 commit 5fb2986
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions library/std/src/sys_common/backtrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ unsafe fn _print_fmt(fmt: &mut fmt::Formatter<'_>, print_fmt: PrintFmt) -> fmt::

let mut hit = false;
let mut stop = false;
let mut frame_fmt = bt_fmt.frame();
backtrace_rs::resolve_frame_unsynchronized(frame, |symbol| {
hit = true;
if print_fmt == PrintFmt::Short {
Expand All @@ -87,15 +88,15 @@ unsafe fn _print_fmt(fmt: &mut fmt::Formatter<'_>, print_fmt: PrintFmt) -> fmt::
}

if start {
res = bt_fmt.frame().symbol(frame, symbol);
res = frame_fmt.symbol(frame, symbol);
}
});
if stop {
return false;
}
if !hit {
if start {
res = bt_fmt.frame().print_raw(frame.ip(), None, None, None);
res = frame_fmt.print_raw(frame.ip(), None, None, None);
}
}

Expand Down

0 comments on commit 5fb2986

Please sign in to comment.