format symbols under shared frames

This commit is contained in:
Ashley Mannix 2020-12-04 15:43:42 +10:00 committed by Jakub Duchniewicz
parent e4a6032706
commit 5fb298664c

View File

@ -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 {
@ -87,7 +88,7 @@ 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 {
@ -95,7 +96,7 @@ unsafe fn _print_fmt(fmt: &mut fmt::Formatter<'_>, print_fmt: PrintFmt) -> fmt::
}
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);
}
}