Skip to content

Commit

Permalink
Use extended symbolization markup on Fuchsia (#559)
Browse files Browse the repository at this point in the history
{{{reset:begin/end}}} pair will allow symbolization to be performed on
the whole stack rather than individual frames.
  • Loading branch information
liudangyi committed Aug 17, 2023
1 parent 0533d47 commit 2efc591
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/print.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ impl<'a, 'b> BacktraceFmt<'a, 'b> {
/// This is currently a no-op but is added for future compatibility with
/// backtrace formats.
pub fn finish(&mut self) -> fmt::Result {
// Currently a no-op-- including this hook to allow for future additions.
#[cfg(target_os = "fuchsia")]
fuchsia::finish_context(self.fmt)?;
Ok(())
}

Expand Down
7 changes: 6 additions & 1 deletion src/print/fuchsia.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ impl DsoPrinter<'_, '_> {

/// This function prints the Fuchsia symbolizer markup for all information contained in a DSO.
pub fn print_dso_context(out: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
out.write_str("{{{reset}}}\n")?;
out.write_str("{{{reset:begin}}}\n")?;
let mut visitor = DsoPrinter {
writer: out,
module_count: 0,
Expand All @@ -434,3 +434,8 @@ pub fn print_dso_context(out: &mut core::fmt::Formatter<'_>) -> core::fmt::Resul
for_each_dso(&mut visitor);
visitor.error
}

/// This function prints the Fuchsia symbolizer markup to end the backtrace.
pub fn finish_context(out: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
out.write_str("{{{reset:end}}}\n")
}

0 comments on commit 2efc591

Please sign in to comment.