Module 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:

  1. It isn’t necessary because we specify how to serialize/deserialize things with scroll via derive(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.

  2. 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 brittle unsafe.

  3. 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
Arm-specific CPU information (Breakpad extension)
ArmElfHwCaps
Possible values of ARMCpuInfo::elf_hwcaps
BreakpadInfoValid
Potential values for MINIDUMP_BREAKPAD_INFO::validity
CONTEXT_AMD64
An x86-64 (amd64) CPU context
CONTEXT_ARM
An ARM CPU context
CONTEXT_ARM64
A (microsoft-style) aarch64 (arm64) CPU context
CONTEXT_ARM64_OLD
An old (breakpad-style) aarch64 (arm64) CPU context.
CONTEXT_MIPS
A MIPS CPU context
CONTEXT_PPC
A PPC CPU context
CONTEXT_PPC64
A PPC64 CPU context
CONTEXT_SPARC
A SPARC CPU context
CONTEXT_X86
An x86 CPU context
CPU_INFORMATION
CPU information contained within the MINIDUMP_SYSTEM_INFO struct
CV_INFO_ELF
An ELF Build ID.
CV_INFO_PDB20
CodeView debug information in the older PDB 2.0 (“NB10”) format.
CV_INFO_PDB70
CodeView debug information in the current PDB 7.0 (“RSDS”) format.
ContextFlagsAmd64
Flags available for use in [CONTEXT_AMD64.context_flags]
ContextFlagsArm
Flags available for use in [CONTEXT_ARM.context_flags]
ContextFlagsArm64
Flags available for use in [CONTEXT_ARM64.context_flags]
ContextFlagsArm64Old
Flags available for use in [CONTEXT_ARM64_OLD.context_flags]
ContextFlagsCpu
CPU type values in the context_flags member of CONTEXT_ structs
ContextFlagsX86
Flags available for use in [CONTEXT_X86.context_flags]
DSO_DEBUG_32
DSO debug data for 32-bit Linux minidumps
DSO_DEBUG_64
DSO debug data for 64-bit Linux minidumps
FLOATING_SAVE_AREA_ARM
ARM floating point state
FLOATING_SAVE_AREA_MIPS
MIPS floating point state
FLOATING_SAVE_AREA_PPC
PPC floating point state
FLOATING_SAVE_AREA_SPARC
SPARC floating point state
FLOATING_SAVE_AREA_X86
x86 floating point state
GUID
A GUID as specified in Rpcdce.h
IMAGE_DEBUG_MISC
Obsolete debug record type defined in WinNT.h.
LINK_MAP_32
Dynamic linker information for a shared library on 32-bit Linux
LINK_MAP_64
Dynamic linker information for a shared library on 64-bit Linux
MINIDUMP_ANNOTATION
A typed annotation object.
MINIDUMP_ASSERTION_INFO
A Breakpad extension containing information about an assertion that terminated the process
MINIDUMP_BREAKPAD_INFO
A Breakpad extension containing some additional process information
MINIDUMP_CRASHPAD_INFO
Additional Crashpad-specific information carried within a minidump file.
MINIDUMP_DIRECTORY
Information about a data stream contained in a minidump file.
MINIDUMP_EXCEPTION
Detailed information about an exception.
MINIDUMP_EXCEPTION_STREAM
Information about the exception that caused the process to terminate.
MINIDUMP_HANDLE_DATA_STREAM
MINIDUMP_HANDLE_DESCRIPTOR
MINIDUMP_HANDLE_DESCRIPTOR_2
MINIDUMP_HANDLE_OBJECT_INFORMATION
OS-specific handle object information. Microsoft headers state that it can change based on the target platform. The object is larger than this structure (as specified by size_of_info) and the remaining data is stored after the size_of_info field. The format of this information is not specified.
MINIDUMP_HEADER
The header at the start of a minidump file.
MINIDUMP_LOCATION_DESCRIPTOR
A location within a minidump file comprised of an offset and a size.
MINIDUMP_MAC_BOOTARGS
MacOS kernel boot args
MINIDUMP_MAC_CRASH_INFO
MacOS __DATA,__crash_info data.
MINIDUMP_MAC_CRASH_INFO_RECORD
Contents of MacOS’s <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_4
Contents of MacOS’s <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_5
Contents of MacOS’s <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_STRINGS
Variable-length data for MINIDUMP_MAC_CRASH_INFO_RECORD.
MINIDUMP_MAC_CRASH_INFO_RECORD_STRINGS_4
Variable-length data for MINIDUMP_MAC_CRASH_INFO_RECORD_4.
MINIDUMP_MAC_CRASH_INFO_RECORD_STRINGS_5
Variable-length data for MINIDUMP_MAC_CRASH_INFO_RECORD_5.
MINIDUMP_MEMORY_DESCRIPTOR
A range of memory contained within a minidump consisting of a base address and a location descriptor.
MINIDUMP_MEMORY_DESCRIPTOR64
A large range of memory contained within a minidump (usually a full dump) consisting of a base address and a size.
MINIDUMP_MEMORY_INFO
Information about a memory region in a minidump
MINIDUMP_MEMORY_INFO_LIST
A list of memory regions in a minidump
MINIDUMP_MISC_INFO
Miscellaneous process information
MINIDUMP_MISC_INFO_2
Miscellaneous process and system information
MINIDUMP_MISC_INFO_3
Miscellaneous process and system information
MINIDUMP_MISC_INFO_4
Miscellaneous process and system information
MINIDUMP_MISC_INFO_5
Miscellaneous process and system information
MINIDUMP_MODULE
Information about a single module (executable or shared library) from a minidump
MINIDUMP_MODULE_CRASHPAD_INFO
Additional Crashpad-specific information about a module carried within a minidump file.
MINIDUMP_MODULE_CRASHPAD_INFO_LINK
A link between a MINIDUMP_MODULE structure and additional Crashpad-specific information about a module carried within a minidump file.
MINIDUMP_MODULE_CRASHPAD_INFO_LIST
Additional Crashpad-specific information about modules carried within a minidump file.
MINIDUMP_RVA_LIST
A list of RVA pointers.
MINIDUMP_SIMPLE_STRING_DICTIONARY
A list of key-value pairs.
MINIDUMP_SIMPLE_STRING_DICTIONARY_ENTRY
A key-value pair.
MINIDUMP_SYSTEM_INFO
Processor and operating system information
MINIDUMP_THREAD
Information about a single thread from a minidump
MINIDUMP_THREAD_INFO
MINIDUMP_THREAD_NAME
The name of a thread, found in the ThreadNamesStream.
MINIDUMP_UNLOADED_MODULE
Information about a single unloaded module (executable or shared library) from a minidump.
MINIDUMP_UTF8_STRING
A variable-length UTF-8-encoded string carried within a minidump file.
MemoryProtection
Potential values for MINIDUMP_MEMORY_INFO::protection and allocation_protection
MemoryState
Potential values for MINIDUMP_MEMORY_INFO::state
MemoryType
Potential values for MINIDUMP_MEMORY_INFO::_type
MiscInfoFlags
Known flags for MINIDUMP_MISC_INFO*.flags1
OtherCpuInfo
CPU information for non-x86 CPUs
SSE_REGISTERS
Possible contents of CONTEXT_AMD64::float_save.
SYSTEMTIME
A date and time
TIME_ZONE_INFORMATION
Settings for a time zone
VECTOR_SAVE_AREA_PPC
PPC vector state
VS_FIXEDFILEINFO
Version information for a file
X86CpuInfo
x86-specific CPU information derived from the cpuid instruction
XMM_SAVE_AREA32
Possible contents of CONTEXT_AMD64::float_save.
XSTATE_CONFIG_FEATURE_MSC_INFO
A descriptor of the XSAVE context, which extends a normal x86/x64 context.
XSTATE_FEATURE
The offset and size of each XSAVE entry inside the XSAVE context.
XstateFeatureIter
An iterator of all the enabled features in an XSTATE_CONFIG_FEATURE_MSC_INFO.

Enums§

Arm64RegisterNumbers
Offsets into CONTEXT_ARM64::iregs for registers with a dedicated or conventional purpose
ArmRegisterNumbers
Offsets into CONTEXT_ARM::iregs for registers with a dedicated or conventional purpose
AssertionType
Known values of MINIDUMP_ASSERTION_INFO::_type Taken from the definition in Breakpad’s minidump_format.h.
CvSignature
Known values for the signature field of CodeView records
MINIDUMP_HANDLE_OBJECT_INFORMATION_TYPE
MINIDUMP_STREAM_TYPE
The types of known minidump data streams.
MipsRegisterNumbers
Offsets into CONTEXT_MIPS::iregs for registers with a dedicated or conventional purpose
PlatformId
Known values of MINIDUMP_SYSTEM_INFO::platform_id
Ppc64RegisterNumbers
Offsets into CONTEXT_PPC64::gpr for registers with a dedicated or conventional purpose
PpcRegisterNumbers
Offsets into CONTEXT_PPC::gpr for registers with a dedicated or conventional purpose
ProcessorArchitecture
Known values of MINIDUMP_SYSTEM_INFO::processor_architecture
SparcRegisterNumbers
Offsets into CONTEXT_SPARC::g_r for registers with a dedicated or conventional purpose
XstateFeatureIndex
Several known entries in XSTATE_CONFIG_FEATURE_MSC_INFO.features.

Constants§

CONTEXT_CPU_MASK
Valid bits in a context_flags for ContextFlagsCpu
CONTEXT_HAS_XSTATE
x86 and x64 contexts have this bit set in their context_flags when they have extra XSTATE beyond the traditional context definition.
MAC_CRASH_INFOS_MAX
The maximum supported count of MINIDUMP_MAC_CRASH_INFO_RECORDs.
MAC_CRASH_INFO_STRING_MAX_SIZE
The maximum supported size of a C-string in MINIDUMP_MAC_CRASH_INFO_RECORD.
MINIDUMP_SIGNATURE
The 4-byte magic number at the start of a minidump file.
MINIDUMP_VERSION
The version of the minidump format.
VS_FFI_SIGNATURE
The expected value of VS_FIXEDFILEINFO.signature
VS_FFI_STRUCVERSION
The expected value of VS_FIXEDFILEINFO.struct_version

Type Aliases§

RVA
An offset from the start of the minidump file.
RVA64