The writer for a MINIDUMP_SYSTEM_INFO stream in a minidump file. More...
#include "minidump/minidump_system_info_writer.h"
Public Member Functions | |
MinidumpSystemInfoWriter (const MinidumpSystemInfoWriter &)=delete | |
MinidumpSystemInfoWriter & | operator= (const MinidumpSystemInfoWriter &)=delete |
void | InitializeFromSnapshot (const SystemSnapshot *system_snapshot) |
Initializes MINIDUMP_SYSTEM_INFO based on system_snapshot. | |
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. | |
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. | |
void | SetCPUX86VendorString (const std::string &vendor) |
Sets MINIDUMP_SYSTEM_INFO::Cpu::X86CpuInfo::VendorId. | |
void | SetCPUX86VersionAndFeatures (uint32_t version, uint32_t features) |
Sets MINIDUMP_SYSTEM_INFO::Cpu::X86CpuInfo::VersionInformation and MINIDUMP_SYSTEM_INFO::Cpu::X86CpuInfo::FeatureInformation. | |
void | SetCPUX86AMDExtendedFeatures (uint32_t extended_features) |
Sets MINIDUMP_SYSTEM_INFO::Cpu::X86CpuInfo::AMDExtendedCPUFeatures. | |
void | SetCPUOtherFeatures (uint64_t features_0, uint64_t features_1) |
Sets MINIDUMP_SYSTEM_INFO::Cpu::OtherCpuInfo::ProcessorFeatures. | |
![]() | |
MinidumpStreamWriter (const MinidumpStreamWriter &)=delete | |
MinidumpStreamWriter & | operator= (const MinidumpStreamWriter &)=delete |
const MINIDUMP_DIRECTORY * | DirectoryListEntry () const |
Returns a MINIDUMP_DIRECTORY entry that serves as a pointer to this stream. | |
![]() | |
MinidumpWritable (const MinidumpWritable &)=delete | |
MinidumpWritable & | operator= (const MinidumpWritable &)=delete |
virtual bool | WriteEverything (FileWriterInterface *file_writer) |
Writes an object and all of its children to a minidump file. | |
void | RegisterRVA (RVA *rva) |
Registers a file offset pointer as one that should point to the object on which this method is called. | |
void | RegisterRVA (RVA64 *rva) |
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. | |
void | RegisterLocationDescriptor (MINIDUMP_LOCATION_DESCRIPTOR64 *location_descriptor64) |
Protected Member Functions | |
bool | Freeze () override |
Transitions the object from kStateMutable to kStateFrozen. | |
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. | |
std::vector< MinidumpWritable * > | Children () override |
Returns the object’s children. | |
bool | WriteObject (FileWriterInterface *file_writer) override |
Writes the object’s content. | |
MinidumpStreamType | StreamType () const override |
Returns an object’s stream type. | |
![]() | |
State | state () const |
The state of the object. | |
virtual size_t | Alignment () |
Returns the object’s desired byte-boundary alignment. | |
virtual Phase | WritePhase () |
Returns the object’s desired write phase. | |
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. | |
virtual bool | WillWriteAtOffsetImpl (FileOffset offset) |
Called once an object’s writable file offset is determined, as it transitions into kStateWritable. | |
bool | WritePaddingAndObject (FileWriterInterface *file_writer) |
Writes the object, transitioning it from kStateWritable to kStateWritten. | |
Additional Inherited Members | |
![]() | |
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 constexpr size_t | kInvalidSize = std::numeric_limits<size_t>::max() |
A size value used to signal failure by methods that return size_t . | |
The writer for a MINIDUMP_SYSTEM_INFO stream in a minidump file.
|
overrideprotectedvirtual |
Returns the object’s children.
Reimplemented from crashpad::internal::MinidumpWritable.
|
overrideprotectedvirtual |
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.
true
on success. false
on failure, with an appropriate message logged. Reimplemented from crashpad::internal::MinidumpStreamWriter.
void crashpad::MinidumpSystemInfoWriter::InitializeFromSnapshot | ( | const SystemSnapshot * | system_snapshot | ) |
Initializes MINIDUMP_SYSTEM_INFO based on system_snapshot.
[in] | system_snapshot | The system snapshot to use as source data. |
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.
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”.
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.
[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 . |
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.
[in] | vendor | The entire CPU vendor string, which must be exactly 12 bytes long. |
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.
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.
|
overrideprotectedvirtual |
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.
Implements crashpad::internal::MinidumpWritable.
|
overrideprotectedvirtual |
Returns an object’s stream type.
Implements crashpad::internal::MinidumpStreamWriter.
|
overrideprotectedvirtual |
Writes the object’s content.
[in] | file_writer | The file writer to receive the object’s content. |
true
on success. false
on error, indicating that the content could not be written to the minidump file.Implements crashpad::internal::MinidumpWritable.