summaryrefslogtreecommitdiffstats
path: root/third_party/rust/minidump-writer/src/minidump_format.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /third_party/rust/minidump-writer/src/minidump_format.rs
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/minidump-writer/src/minidump_format.rs')
-rw-r--r--third_party/rust/minidump-writer/src/minidump_format.rs40
1 files changed, 40 insertions, 0 deletions
diff --git a/third_party/rust/minidump-writer/src/minidump_format.rs b/third_party/rust/minidump-writer/src/minidump_format.rs
new file mode 100644
index 0000000000..8ffa40fc42
--- /dev/null
+++ b/third_party/rust/minidump-writer/src/minidump_format.rs
@@ -0,0 +1,40 @@
+pub use minidump_common::format::{
+ self, ArmElfHwCaps as MDCPUInformationARMElfHwCaps, PlatformId,
+ ProcessorArchitecture as MDCPUArchitecture, GUID, MINIDUMP_DIRECTORY as MDRawDirectory,
+ MINIDUMP_EXCEPTION as MDException, MINIDUMP_EXCEPTION_STREAM as MDRawExceptionStream,
+ MINIDUMP_HEADER as MDRawHeader, MINIDUMP_LOCATION_DESCRIPTOR as MDLocationDescriptor,
+ MINIDUMP_MEMORY_DESCRIPTOR as MDMemoryDescriptor, MINIDUMP_MODULE as MDRawModule,
+ MINIDUMP_SIGNATURE as MD_HEADER_SIGNATURE, MINIDUMP_STREAM_TYPE as MDStreamType,
+ MINIDUMP_SYSTEM_INFO as MDRawSystemInfo, MINIDUMP_THREAD as MDRawThread,
+ MINIDUMP_THREAD_NAME as MDRawThreadName, MINIDUMP_VERSION as MD_HEADER_VERSION,
+ VS_FIXEDFILEINFO as MDVSFixedFileInfo,
+};
+
+/* An MDRVA is an offset into the minidump file. The beginning of the
+ * MDRawHeader is at offset 0. */
+pub type MDRVA = u32;
+
+pub type MDRawThreadList = Vec<MDRawThread>;
+
+cfg_if::cfg_if! {
+ if #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] {
+ pub use format::X86CpuInfo as MDCPUInformation;
+ } else if #[cfg(any(target_arch = "arm", target_arch = "aarch64"))] {
+ pub use format::ARMCpuInfo as MDCPUInformation;
+ } else if #[cfg(target_arch = "mips")] {
+ pub struct MDCPUInformation {
+ pub cpuid: [u64; 2],
+ _padding: [u32; 2],
+ }
+ }
+}
+
+cfg_if::cfg_if! {
+ if #[cfg(target_pointer_width = "64")] {
+ pub use format::LINK_MAP_64 as MDRawLinkMap;
+ pub use format::DSO_DEBUG_64 as MDRawDebug;
+ } else if #[cfg(target_pointer_width = "32")] {
+ pub use format::LINK_MAP_32 as MDRawLinkMap;
+ pub use format::DSO_DEBUG_32 as MDRawDebug;
+ }
+}