Crashpad
|
The writer for a MINIDUMP_SYSTEM_INFO stream in a minidump file. More...
#include "minidump/minidump_system_info_writer.h"
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 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.