std: Fixed backtrace warnings and tests for non-Linux platforms.
- Fixed a couple of dead code warnings in std::sys::backtrace. - Made `backtrace-debuginfo` test a no-op on non-Linux platforms. - `backtrace-debuginfo` is no longer tested on pretty-rpass.
This commit is contained in:
parent
587f10aa36
commit
ff678ea3f4
2 changed files with 28 additions and 5 deletions
|
|
@ -9,6 +9,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
// compile-flags:-g
|
||||
// ignore-pretty as this critically relies on line numbers
|
||||
|
||||
use std::old_io::stderr;
|
||||
use std::env;
|
||||
|
|
@ -19,14 +20,35 @@ macro_rules! pos {
|
|||
() => ((file!(), line!()))
|
||||
}
|
||||
|
||||
#[cfg(all(unix,
|
||||
not(target_os = "macos"),
|
||||
not(target_os = "ios"),
|
||||
not(target_os = "android"),
|
||||
not(all(target_os = "linux", target_arch = "arm"))))]
|
||||
macro_rules! dump_and_die {
|
||||
($($pos:expr),*) => ({
|
||||
// FIXME(#18285): we cannot include the current position because
|
||||
// the macro span takes over the last frame's file/line.
|
||||
dump_filelines(&[$($pos),*]);
|
||||
panic!();
|
||||
})
|
||||
}
|
||||
|
||||
// this does not work on Windows, Android, OSX or iOS
|
||||
#[cfg(any(not(unix),
|
||||
target_os = "macos",
|
||||
target_os = "ios",
|
||||
target_os = "android",
|
||||
all(target_os = "linux", target_arch = "arm")))]
|
||||
macro_rules! dump_and_die {
|
||||
($($pos:expr),*) => ({ let _ = [$($pos),*]; })
|
||||
}
|
||||
|
||||
// we can't use a function as it will alter the backtrace
|
||||
macro_rules! check {
|
||||
($counter:expr; $($pos:expr),*) => ({
|
||||
if *$counter == 0 {
|
||||
// FIXME(#18285): we cannot include the current position because
|
||||
// the macro span takes over the last frame's file/line.
|
||||
dump_filelines(&[$($pos),*]);
|
||||
panic!();
|
||||
dump_and_die!($($pos),*)
|
||||
} else {
|
||||
*$counter -= 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue