1
Fork 0

move default backtrace setting to sys

This commit is contained in:
Gus Caplan 2023-03-05 18:55:30 -08:00
parent 13afbdaa06
commit d1712f49d7
3 changed files with 10 additions and 3 deletions

View file

@ -308,8 +308,7 @@ pub fn get_backtrace_style() -> Option<BacktraceStyle> {
BacktraceStyle::Short
}
})
.unwrap_or(if cfg!(target_os = "fuchsia") {
// Fuchsia components default to full backtrace.
.unwrap_or(if crate::sys::BACKTRACE_DEFAULT {
BacktraceStyle::Full
} else {
BacktraceStyle::Off

View file

@ -76,3 +76,12 @@ cfg_if::cfg_if! {
pub mod c;
}
}
cfg_if::cfg_if! {
// Fuchsia components default to full backtrace.
if #[cfg(target_os = "fuchsia")] {
pub const BACKTRACE_DEFAULT: bool = true;
} else {
pub const BACKTRACE_DEFAULT: bool = false;
}
}

View file

@ -59,7 +59,6 @@ const EXCEPTION_PATHS: &[&str] = &[
"library/std/src/path.rs",
"library/std/src/sys_common", // Should only contain abstractions over platforms
"library/std/src/net/test.rs", // Utility helpers for tests
"library/std/src/panic.rs", // fuchsia-specific panic backtrace handling
"library/std/src/personality.rs",
"library/std/src/personality/",
];