Module minidump_common::format
source · Expand description
Minidump structure definitions.
Types defined here should match those defined in Microsoft’s headers. Additionally some Breakpad and Crashpad extension types are defined here and should match the definitions from those projects.
Type Layouts
This library isn’t a “proper” minidump-sys library because it doesn’t use repr attributes to force Rust to layout these structs identically to how they’re laid out in memory.
The reasons for this are 3-fold:
-
It isn’t necessary because we specify how to serialize/deserialize things with
scrollviaderive(Pread, Pwrite)which uses the declared field order and not the in-memory layout, and assumes everything is packed anyway, which as a rule, minidump types are. Specifically they’re packed to align 4, but Microsoft is mercifully very attentive to its type layouts so we’re not aware of anywhere where packing to align 1 would change offsets. Packing is mostly just there so 32-bit and 64-bit definitely agree on offsets. -
We would have to mark several types as
repr(packed(4)), making them dangerous to use as several of the fields would become misaligned. This would create a bunch of unnecessary and brittleunsafe. -
It’s not actually that useful to have structs with precise in-memory layouts since a minidump parser needs to accept both little-endian and big-endian minidumps, and is therefore swizzling the bytes of all the values anyway. Also it’s dangerous to reinterpret a pile of memory as arbitrary types without validation!
Structs
ARMCpuInfo::elf_hwcapsMINIDUMP_BREAKPAD_INFO::validityMINIDUMP_SYSTEM_INFO structCONTEXT_AMD64.context_flags]CONTEXT_ARM.context_flags]CONTEXT_ARM64.context_flags]CONTEXT_ARM64_OLD.context_flags]context_flags member of CONTEXT_ structsCONTEXT_X86.context_flags]<CrashReporterClient.h>’s crashreporter_annotations_t,
but with the by-reference C-strings hoisted out to the end of the struct
and inlined (so this is a variable-length struct).<CrashReporterClient.h>’s crashreporter_annotations_t,
but with the by-reference C-strings hoisted out to the end of the struct
and inlined (so this is a variable-length struct).<CrashReporterClient.h>’s crashreporter_annotations_t,
but with the by-reference C-strings hoisted out to the end of the struct
and inlined (so this is a variable-length struct).MINIDUMP_MAC_CRASH_INFO_RECORD.MINIDUMP_MAC_CRASH_INFO_RECORD_4.MINIDUMP_MAC_CRASH_INFO_RECORD_5.MINIDUMP_MODULE structure and additional Crashpad-specific information about a
module carried within a minidump file.MINIDUMP_MEMORY_INFO::protection and allocation_protectionMINIDUMP_MEMORY_INFO::stateMINIDUMP_MEMORY_INFO::_typeMINIDUMP_MISC_INFO*.flags1CONTEXT_AMD64::float_save.cpuid instructionCONTEXT_AMD64::float_save.Enums
CONTEXT_ARM64::iregs for registers with a dedicated or conventional purposeCONTEXT_ARM::iregs for registers with a dedicated or conventional purposeMINIDUMP_ASSERTION_INFO::_type
Taken from the definition in Breakpad’s minidump_format.h.signature field of CodeView recordsCONTEXT_MIPS::iregs for registers with a dedicated or conventional purposeMINIDUMP_SYSTEM_INFO::platform_idCONTEXT_PPC64::gpr for registers with a dedicated or conventional purposeCONTEXT_PPC::gpr for registers with a dedicated or conventional purposeCONTEXT_SPARC::g_r for registers with a dedicated or conventional purposeXSTATE_CONFIG_FEATURE_MSC_INFO.features.Constants
context_flags for ContextFlagsCpucontext_flags when they have
extra XSTATE beyond the traditional context definition.MINIDUMP_MAC_CRASH_INFO_RECORDs.MINIDUMP_MAC_CRASH_INFO_RECORD.VS_FIXEDFILEINFO.signatureVS_FIXEDFILEINFO.struct_version