Crashpad
 
Loading...
Searching...
No Matches
crashpad::internal::IOSIntermediateDumpWriter Class Referencefinal

Wrapper class for writing intermediate dump file. More...

#include "util/ios/ios_intermediate_dump_writer.h"

Classes

class  ScopedArray
 A scoped wrapper for calls to ArrayStart and ArrayEnd. More...
 
class  ScopedArrayMap
 A scoped wrapper for calls to ArrayMapStart and MapEnd. More...
 
class  ScopedMap
 A scoped wrapper for calls to MapStart and MapEnd. More...
 
class  ScopedRootMap
 A scoped wrapper for calls to RootMapStart and RootMapEnd. More...
 

Public Types

enum class  CommandType : uint8_t
 Command instructions for the intermediate dump reader. More...
 

Public Member Functions

 IOSIntermediateDumpWriter (const IOSIntermediateDumpWriter &)=delete
 
IOSIntermediateDumpWriteroperator= (const IOSIntermediateDumpWriter &)=delete
 
bool Open (const base::FilePath &path)
 Open and lock an intermediate dump file. This is the only method in the writer class that is generally run outside of a crash.
 
bool Close ()
 Completes writing the intermediate dump file and releases the file handle.
 
template<typename T>
bool AddProperty (IntermediateDumpKey key, const T *value, size_t count=1)
 
bool AddPropertyBytes (IntermediateDumpKey key, const void *value, size_t value_length)
 
bool AddPropertyCString (IntermediateDumpKey key, size_t max_length, const char *value)
 

Detailed Description

Wrapper class for writing intermediate dump file.

Due to the limitations of in-process handling, an intermediate dump file is written during exceptions. The data is streamed to a file using only in-process safe methods.

The file format is similar to binary JSON, supporting keyed properties, maps and arrays.

  • Property [key:int, length:int, value:intarray]
  • StartMap [key:int], followed by repeating Properties until EndMap
  • StartArray [key:int], followed by repeating Maps until EndArray
  • EndMap, EndArray, EndDocument

Similar to JSON, maps can contain other maps, arrays and properties.

Note: All methods are RUNS-DURING-CRASH.

Member Enumeration Documentation

◆ CommandType

Command instructions for the intermediate dump reader.

Enumerator
kMapStart 

Indicates a new map, followed by associated key.

kMapEnd 

Indicates map is complete.

kArrayStart 

Indicates a new array, followed by associated key.

kArrayEnd 

Indicates array is complete.

kProperty 

Indicates a new property, followed by a key, length and value.

kRootMapStart 

Indicates the start of the root map.

kRootMapEnd 

Indicates the end of the root map, and that there is nothing left to parse.

Member Function Documentation

◆ AddProperty()

template<typename T>
bool crashpad::internal::IOSIntermediateDumpWriter::AddProperty ( IntermediateDumpKey key,
const T * value,
size_t count = 1 )
inline
Returns
The true if able to AddPropertyInternal the key value count tuple.

◆ AddPropertyBytes()

bool crashpad::internal::IOSIntermediateDumpWriter::AddPropertyBytes ( IntermediateDumpKey key,
const void * value,
size_t value_length )
inline
Returns
The true if able to AddPropertyInternal the key value count tuple.

◆ AddPropertyCString()

bool crashpad::internal::IOSIntermediateDumpWriter::AddPropertyCString ( IntermediateDumpKey key,
size_t max_length,
const char * value )
Returns
true if able to vm_read a string of value and write a kProperty command with the key value up to a NUL byte. The string cannot be longer than max_length with a maximum string length of 1024.

◆ Close()

bool crashpad::internal::IOSIntermediateDumpWriter::Close ( )

Completes writing the intermediate dump file and releases the file handle.

Returns
On success, returns true, otherwise returns false.

◆ Open()

bool crashpad::internal::IOSIntermediateDumpWriter::Open ( const base::FilePath & path)

Open and lock an intermediate dump file. This is the only method in the writer class that is generally run outside of a crash.

The client must invoke Close() before this object is destroyed.

Parameters
[in]pathThe path to the intermediate dump.
Returns
On success, returns true, otherwise returns false.

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