class MinidumpFileWriter
Defined at line 40 of file ../../third_party/crashpad/src/minidump/minidump_file_writer.h
The root-level object in a minidump file.
This object writes a MINIDUMP_HEADER and list of MINIDUMP_DIRECTORY entries
to a minidump file.
Public Methods
void MinidumpFileWriter ()
void MinidumpFileWriter (const MinidumpFileWriter & )
Defined at line 44 of file ../../third_party/crashpad/src/minidump/minidump_file_writer.h
MinidumpFileWriter & operator= (const MinidumpFileWriter & )
Defined at line 45 of file ../../third_party/crashpad/src/minidump/minidump_file_writer.h
void ~MinidumpFileWriter ()
void InitializeFromSnapshot (const ProcessSnapshot * process_snapshot)
Initializes the MinidumpFileWriter and populates it with
appropriate child streams based on
This method will add additional streams to the minidump file as children
of the MinidumpFileWriter object and as pointees of the top-level
MINIDUMP_DIRECTORY. To do so, it will obtain other snapshot information
from
such as a SystemSnapshot, lists of
ThreadSnapshot and ModuleSnapshot objects, and, if available, an
ExceptionSnapshot.
The streams are added in the order that they are expected to be most
useful to minidump readers, to improve data locality and minimize seeking.
The streams are added in this order:
- kMinidumpStreamTypeSystemInfo
- kMinidumpStreamTypeMiscInfo
- kMinidumpStreamTypeThreadList
- kMinidumpStreamTypeException (if present)
- kMinidumpStreamTypeModuleList
- kMinidumpStreamTypeUnloadedModuleList (if present)
- kMinidumpStreamTypeCrashpadInfo (if present)
- kMinidumpStreamTypeMemoryInfoList (if present)
- kMinidumpStreamTypeHandleData (if present)
- User streams (if present)
- kMinidumpStreamTypeMemoryList
Parameters
void SetTimestamp (time_t timestamp)
Sets MINIDUMP_HEADER::Timestamp.
bool AddStream (std::unique_ptr<internal::MinidumpStreamWriter> stream)
Adds a stream to the minidump file and arranges for a
MINIDUMP_DIRECTORY entry to point to it.
This object takes ownership of
and becomes its parent in the
overall tree of internal::MinidumpWritable objects.
At most one object of each stream type (as obtained from
internal::MinidumpStreamWriter::StreamType()) may be added to a
MinidumpFileWriter object. If an attempt is made to add a stream whose
type matches an existing stream’s type, this method discards the new
stream.
Returns
`true` on success. `false` on failure, as occurs when an attempt
is made to add a stream whose type matches an existing stream’s type,
with a message logged.
bool AddUserExtensionStream (std::unique_ptr<MinidumpUserExtensionStreamDataSource> user_extension_stream_data)
Adds a user extension stream to the minidump file and arranges for
a MINIDUMP_DIRECTORY entry to point to it.
This object takes ownership of
At most one object of each stream type (as obtained from
internal::MinidumpStreamWriter::StreamType()) may be added to a
MinidumpFileWriter object. If an attempt is made to add a stream whose
type matches an existing stream’s type, this method discards the new
stream.
Parameters
Returns
`true` on success. `false` on failure, as occurs when an attempt
is made to add a stream whose type matches an existing stream’s type,
with a message logged.
bool WriteEverything (FileWriterInterface * file_writer)
This method does not initially write the final value for
MINIDUMP_HEADER::Signature. After all child objects have been written, it
rewinds to the beginning of the file and writes the correct value for this
field. This prevents incompletely-written minidump files from being
mistaken for valid ones.
bool WriteMinidump (FileWriterInterface * file_writer, bool allow_seek)
Writes this object to a minidump file.
Same as
but give the option to disable the seek. It
is typically used to write to stream backed
which
doesn't support seek.
Parameters
Returns
`true` on success. `false` on failure, with an appropriate message
logged.
Protected Methods
bool Freeze ()
MinidumpWritable:
size_t SizeOfObject ()
std::vector<MinidumpWritable *> Children ()
bool WillWriteAtOffsetImpl (FileOffset offset)
bool WriteObject (FileWriterInterface * file_writer)