Skip to content

Commit 2efc591

Browse files
authored
Use extended symbolization markup on Fuchsia (#559)
{{{reset:begin/end}}} pair will allow symbolization to be performed on the whole stack rather than individual frames.
1 parent 0533d47 commit 2efc591

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/print.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ impl<'a, 'b> BacktraceFmt<'a, 'b> {
8383
/// This is currently a no-op but is added for future compatibility with
8484
/// backtrace formats.
8585
pub fn finish(&mut self) -> fmt::Result {
86-
// Currently a no-op-- including this hook to allow for future additions.
86+
#[cfg(target_os = "fuchsia")]
87+
fuchsia::finish_context(self.fmt)?;
8788
Ok(())
8889
}
8990

src/print/fuchsia.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ impl DsoPrinter<'_, '_> {
425425

426426
/// This function prints the Fuchsia symbolizer markup for all information contained in a DSO.
427427
pub fn print_dso_context(out: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
428-
out.write_str("{{{reset}}}\n")?;
428+
out.write_str("{{{reset:begin}}}\n")?;
429429
let mut visitor = DsoPrinter {
430430
writer: out,
431431
module_count: 0,
@@ -434,3 +434,8 @@ pub fn print_dso_context(out: &mut core::fmt::Formatter<'_>) -> core::fmt::Resul
434434
for_each_dso(&mut visitor);
435435
visitor.error
436436
}
437+
438+
/// This function prints the Fuchsia symbolizer markup to end the backtrace.
439+
pub fn finish_context(out: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
440+
out.write_str("{{{reset:end}}}\n")
441+
}

0 commit comments

Comments
 (0)