Crashpad

Public Member Functions | Protected Member Functions | List of all members
crashpad::MinidumpSystemInfoWriter Class Referencefinal

The writer for a MINIDUMP_SYSTEM_INFO stream in a minidump file. More...

`#include "minidump/minidump_system_info_writer.h"`

Inheritance diagram for crashpad::MinidumpSystemInfoWriter:

## Public Member Functions
void | InitializeFromSnapshot (const SystemSnapshot *system_snapshot)
| Initializes MINIDUMP_SYSTEM_INFO based on system_snapshot. More...
void | SetCPUArchitecture (MinidumpCPUArchitecture processor_architecture)
| Sets MINIDUMP_SYSTEM_INFO::ProcessorArchitecture.
void | SetCPULevelAndRevision (uint16_t processor_level, uint16_t processor_revision)
| Sets MINIDUMP_SYSTEM_INFO::ProcessorLevel and MINIDUMP_SYSTEM_INFO::ProcessorRevision.
void | SetCPUCount (uint8_t number_of_processors)
| Sets MINIDUMP_SYSTEM_INFO::NumberOfProcessors.
void | SetOS (MinidumpOS platform_id)
| Sets MINIDUMP_SYSTEM_INFO::PlatformId.
void | SetOSType (MinidumpOSType product_type)
| Sets MINIDUMP_SYSTEM_INFO::ProductType.
void | SetOSVersion (uint32_t major_version, uint32_t minor_version, uint32_t build_number)
| Sets MINIDUMP_SYSTEM_INFO::MajorVersion, MINIDUMP_SYSTEM_INFO::MinorVersion, and MINIDUMP_SYSTEM_INFO::BuildNumber.
void | SetCSDVersion (const std::string &csd_version)
| Arranges for MINIDUMP_SYSTEM_INFO::CSDVersionRva to point to a MINIDUMP_STRING containing the supplied string. More...
void | SetSuiteMask (uint16_t suite_mask)
| Sets MINIDUMP_SYSTEM_INFO::SuiteMask.
void | SetCPUX86Vendor (uint32_t ebx, uint32_t edx, uint32_t ecx)
| Sets MINIDUMP_SYSTEM_INFO::Cpu::X86CpuInfo::VendorId. More...
void | SetCPUX86VendorString (const std::string &vendor)
| Sets MINIDUMP_SYSTEM_INFO::Cpu::X86CpuInfo::VendorId. More...
void | SetCPUX86VersionAndFeatures (uint32_t version, uint32_t features)
| Sets MINIDUMP_SYSTEM_INFO::Cpu::X86CpuInfo::VersionInformation and MINIDUMP_SYSTEM_INFO::Cpu::X86CpuInfo::FeatureInformation. More...
void | SetCPUX86AMDExtendedFeatures (uint32_t extended_features)
| Sets MINIDUMP_SYSTEM_INFO::Cpu::X86CpuInfo::AMDExtendedCPUFeatures. More...
void | SetCPUOtherFeatures (uint64_t features_0, uint64_t features_1)
| Sets MINIDUMP_SYSTEM_INFO::Cpu::OtherCpuInfo::ProcessorFeatures. More...
Public Member Functions inherited from crashpad::internal::MinidumpStreamWriter
const MINIDUMP_DIRECTORY * | DirectoryListEntry () const
| Returns a MINIDUMP_DIRECTORY entry that serves as a pointer to this stream. More...
Public Member Functions inherited from crashpad::internal::MinidumpWritable
virtual bool | WriteEverything (FileWriterInterface *file_writer)
| Writes an object and all of its children to a minidump file. More...
void | RegisterRVA (RVA *rva)
| Registers a file offset pointer as one that should point to the object on which this method is called. More...
void | RegisterLocationDescriptor (MINIDUMP_LOCATION_DESCRIPTOR *location_descriptor)
| Registers a location descriptor as one that should point to the object on which this method is called. More...

## Protected Member Functions
bool | Freeze () override
| Transitions the object from kStateMutable to kStateFrozen. More...
size_t | SizeOfObject () override
| Returns the amount of space that this object will consume when written to a minidump file, in bytes, not including any leading or trailing padding necessary to maintain proper alignment. More...
std::vector< MinidumpWritable * > | Children () override
| Returns the object’s children. More...
bool | WriteObject (FileWriterInterface *file_writer) override
| Writes the object’s content. More...
MinidumpStreamType | StreamType () const override
| Returns an object’s stream type. More...
Protected Member Functions inherited from crashpad::internal::MinidumpWritable
State | state () const
| The state of the object.
virtual size_t | Alignment ()
| Returns the object’s desired byte-boundary alignment. More...
virtual Phase | WritePhase ()
| Returns the object’s desired write phase. More...
size_t | WillWriteAtOffset (Phase phase, FileOffset *offset, std::vector< MinidumpWritable *> *write_sequence)
| Prepares the object to be written at a known file offset, transitioning it from kStateFrozen to kStateWritable. More...
virtual bool | WillWriteAtOffsetImpl (FileOffset offset)
| Called once an object’s writable file offset is determined, as it transitions into kStateWritable. More...
bool | WritePaddingAndObject (FileWriterInterface *file_writer)
| Writes the object, transitioning it from kStateWritable to kStateWritten. More...

## Additional Inherited Members
Protected Types inherited from crashpad::internal::MinidumpWritable
enum | State
| Identifies the state of an object. More...
enum | Phase
| Identifies the phase during which an object will be written to a minidump file. More...
Static Protected Attributes inherited from crashpad::internal::MinidumpWritable
static const size_t | kInvalidSize
| A size value used to signal failure by methods that return `size_t`. More...

## Detailed Description

The writer for a MINIDUMP_SYSTEM_INFO stream in a minidump file.

## Member Function Documentation

## ◆ Children()

std::vector< internal::MinidumpWritable * > crashpad::MinidumpSystemInfoWriter::Children | ( |  | ) |
| override protected virtual

Returns the object’s children.

Note
  Valid in kStateFrozen or any subsequent state.

Reimplemented from crashpad::internal::MinidumpWritable.

## ◆ Freeze()

bool crashpad::MinidumpSystemInfoWriter::Freeze | ( |  | ) |
| override protected virtual

Transitions the object from kStateMutable to kStateFrozen.

The default implementation marks the object as frozen and recursively calls Freeze() on all of its children. Subclasses may override this method to perform processing that should only be done once callers have finished populating an object with data. Typically, a subclass implementation would call RegisterRVA() or RegisterLocationDescriptor() on other objects as appropriate, because at the time Freeze() runs, the in-memory locations of RVAs and location descriptors are known and will not change for the remaining duration of an object’s lifetime.

Returns
  `true` on success. `false` on failure, with an appropriate message logged.

Reimplemented from crashpad::internal::MinidumpStreamWriter.

## ◆ InitializeFromSnapshot()

void crashpad::MinidumpSystemInfoWriter::InitializeFromSnapshot | ( | const SystemSnapshot * | system_snapshot | ) |

Initializes MINIDUMP_SYSTEM_INFO based on system_snapshot.

Parameters

  [in] | system_snapshot | The system snapshot to use as source data.

Note
  Valid in kStateMutable. No mutator methods may be called before this method, and it is not normally necessary to call any mutator methods after this method.

## ◆ SetCPUOtherFeatures()

void crashpad::MinidumpSystemInfoWriter::SetCPUOtherFeatures | ( | uint64_t | features_0,
|  | uint64_t | features_1
| ) |  |

Sets MINIDUMP_SYSTEM_INFO::Cpu::OtherCpuInfo::ProcessorFeatures.

This is only valid if SetCPUArchitecture() has been used to set the CPU architecture to an architecture other than kMinidumpCPUArchitectureX86 or kMinidumpCPUArchitectureX86Win64.

Note
  This method may be called if SetCPUArchitecture() has been used to set the CPU architecture to kMinidumpCPUArchitectureAMD64.

## ◆ SetCPUX86AMDExtendedFeatures()

void crashpad::MinidumpSystemInfoWriter::SetCPUX86AMDExtendedFeatures | ( | uint32_t | extended_features | ) |

Sets MINIDUMP_SYSTEM_INFO::Cpu::X86CpuInfo::AMDExtendedCPUFeatures.

This is only valid if SetCPUArchitecture() has been used to set the CPU architecture to kMinidumpCPUArchitectureX86 or kMinidumpCPUArchitectureX86Win64, and if SetCPUX86Vendor() or SetCPUX86VendorString() has been used to set the CPU vendor to “AuthenticAMD”.

Note
  Do not call this method if SetCPUArchitecture() has been used to set the CPU architecture to kMinidumpCPUArchitectureAMD64.

## ◆ SetCPUX86Vendor()

void crashpad::MinidumpSystemInfoWriter::SetCPUX86Vendor | ( | uint32_t | ebx,
|  | uint32_t | edx,
|  | uint32_t | ecx
| ) |  |

Sets MINIDUMP_SYSTEM_INFO::Cpu::X86CpuInfo::VendorId.

This is only valid if SetCPUArchitecture() has been used to set the CPU architecture to kMinidumpCPUArchitectureX86 or kMinidumpCPUArchitectureX86Win64.

Parameters

  [in] | ebx | The first 4 bytes of the CPU vendor string, the value reported in `cpuid 0` `ebx`.
  [in] | edx | The middle 4 bytes of the CPU vendor string, the value reported in `cpuid 0` `edx`.
  [in] | ecx | The last 4 bytes of the CPU vendor string, the value reported by `cpuid 0` `ecx`.

Note
  Do not call this method if SetCPUArchitecture() has been used to set the CPU architecture to kMinidumpCPUArchitectureAMD64.

See also
  SetCPUX86VendorString()

## ◆ SetCPUX86VendorString()

void crashpad::MinidumpSystemInfoWriter::SetCPUX86VendorString | ( | const std::string & | vendor | ) |

Sets MINIDUMP_SYSTEM_INFO::Cpu::X86CpuInfo::VendorId.

This is only valid if SetCPUArchitecture() has been used to set the CPU architecture to kMinidumpCPUArchitectureX86 or kMinidumpCPUArchitectureX86Win64.

Parameters

  [in] | vendor | The entire CPU vendor string, which must be exactly 12 bytes long.

Note
  Do not call this method if SetCPUArchitecture() has been used to set the CPU architecture to kMinidumpCPUArchitectureAMD64.

See also
  SetCPUX86Vendor()

## ◆ SetCPUX86VersionAndFeatures()

void crashpad::MinidumpSystemInfoWriter::SetCPUX86VersionAndFeatures | ( | uint32_t | version,
|  | uint32_t | features
| ) |  |

Sets MINIDUMP_SYSTEM_INFO::Cpu::X86CpuInfo::VersionInformation and MINIDUMP_SYSTEM_INFO::Cpu::X86CpuInfo::FeatureInformation.

This is only valid if SetCPUArchitecture() has been used to set the CPU architecture to kMinidumpCPUArchitectureX86 or kMinidumpCPUArchitectureX86Win64.

Note
  Do not call this method if SetCPUArchitecture() has been used to set the CPU architecture to kMinidumpCPUArchitectureAMD64.

## ◆ SetCSDVersion()

void crashpad::MinidumpSystemInfoWriter::SetCSDVersion | ( | const std::string & | csd_version | ) |

Arranges for MINIDUMP_SYSTEM_INFO::CSDVersionRva to point to a MINIDUMP_STRING containing the supplied string.

This method must be called prior to Freeze(). A CSD version is required in all MINIDUMP_SYSTEM_INFO streams. An empty string is an acceptable value.

## ◆ SizeOfObject()

size_t crashpad::MinidumpSystemInfoWriter::SizeOfObject | ( |  | ) |
| override protected virtual

Returns the amount of space that this object will consume when written to a minidump file, in bytes, not including any leading or trailing padding necessary to maintain proper alignment.

Note
  Valid in kStateFrozen or any subsequent state.

Implements crashpad::internal::MinidumpWritable.

## ◆ StreamType()

MinidumpStreamType crashpad::MinidumpSystemInfoWriter::StreamType | ( |  | ) | const
| override protected virtual

Returns an object’s stream type.

Note
  Valid in any state.

Implements crashpad::internal::MinidumpStreamWriter.

## ◆ WriteObject()

bool crashpad::MinidumpSystemInfoWriter::WriteObject | ( | FileWriterInterface * | file_writer | ) |
| override protected virtual

Writes the object’s content.

Parameters

  [in] | file_writer | The file writer to receive the object’s content.

Returns
  `true` on success. `false` on error, indicating that the content could not be written to the minidump file.

Note
  Valid in kStateWritable. The object will transition to kStateWritten after this method returns.

Implements crashpad::internal::MinidumpWritable.

The documentation for this class was generated from the following files:

- minidump/minidump_system_info_writer.h
- minidump/minidump_system_info_writer.cc