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

Enums§

Constants§

Type Aliases§

  • An offset from the start of the minidump file.