// Copyright 2015 Ted Mielczarek. See the COPYRIGHT // file at the top-level directory of this distribution.
//! Information about the system that produced a `Minidump`.
use num_traits::FromPrimitive; use std::borrow::Cow; use std::fmt;
use minidump_common::format as md; use minidump_common::format::PlatformId; use minidump_common::format::ProcessorArchitecture::*;
/// Known operating systems /// /// This is a slightly nicer layer over the `PlatformId` enum defined in the minidump-common crate. #[derive(Copy, Clone, Debug, PartialEq, Eq)] pubenum Os {
Windows,
MacOs,
Ios,
Linux,
Solaris,
Android,
Ps3,
NaCl,
Unknown(u32),
}
impl Os { /// Get an `Os` value matching the `platform_id` value from `MINIDUMP_SYSTEM_INFO` pubfn from_platform_id(id: u32) -> Os { match PlatformId::from_u32(id) {
Some(PlatformId::VER_PLATFORM_WIN32_WINDOWS)
| Some(PlatformId::VER_PLATFORM_WIN32_NT) => Os::Windows,
Some(PlatformId::MacOs) => Os::MacOs,
Some(PlatformId::Ios) => Os::Ios,
Some(PlatformId::Linux) => Os::Linux,
Some(PlatformId::Solaris) => Os::Solaris,
Some(PlatformId::Android) => Os::Android,
Some(PlatformId::Ps3) => Os::Ps3,
Some(PlatformId::NaCl) => Os::NaCl,
_ => Os::Unknown(id),
}
}
/// Get a human-readable friendly name for an `Os` pubfn long_name(&self) -> Cow<'_, str> { match *self {
Os::Windows => Cow::Borrowed("Windows NT"),
Os::MacOs => Cow::Borrowed("Mac OS X"),
Os::Ios => Cow::Borrowed("iOS"),
Os::Linux => Cow::Borrowed("Linux"),
Os::Solaris => Cow::Borrowed("Solaris"),
Os::Android => Cow::Borrowed("Android"),
Os::Ps3 => Cow::Borrowed("PS3"),
Os::NaCl => Cow::Borrowed("NaCl"),
Os::Unknown(val) => Cow::Owned(format!("0x{val:#08x}")),
}
}
}
/// Known CPU types /// /// This is a slightly nicer layer over the `ProcessorArchitecture` enum defined in /// the minidump-common crate. #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[non_exhaustive] pubenum Cpu {
X86,
X86_64,
Ppc,
Ppc64,
Sparc,
Arm,
Arm64,
Mips,
Mips64,
Unknown(u16),
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.