struct CrashpadInfo

Defined at line 68 of file ../../third_party/crashpad/src/client/crashpad_info.h

A structure that can be used by a Crashpad-enabled program to

provide information to the Crashpad crash handler.

It is possible for one CrashpadInfo structure to appear in each loaded code

module in a process, but from the perspective of the user of the client

interface, there is only one global CrashpadInfo structure, located in the

module that contains the client interface code.

Public Methods

CrashpadInfo * GetCrashpadInfo ()

Returns the global CrashpadInfo structure.

void CrashpadInfo ()
UserDataMinidumpStreamHandle * AddUserDataMinidumpStream (uint32_t stream_type, const void * data, size_t size)

Adds a custom stream to the minidump.

The memory block referenced by

and

will added to the

minidump as separate stream with type

The memory referred

to by

and

is owned by the caller and must remain valid

while it is in effect for the CrashpadInfo object.

Note that streams will appear in the minidump in the reverse order to

which they are added.

TODO(scottmg) This is currently not supported on Mac.

Parameters

stream_type [in] The stream type identifier to use. This should be normally be larger than `MINIDUMP_STREAM_TYPE::LastReservedStream` which is `0xffff`.
data [in] The base pointer of the stream data.
size [in] The size of the stream data.

Returns

A handle to the added stream, for use in calling

UpdateUserDataMinidumpStream() if needed.

void CrashpadInfo (const CrashpadInfo & )

Defined at line 75 of file ../../third_party/crashpad/src/client/crashpad_info.h

UserDataMinidumpStreamHandle * UpdateUserDataMinidumpStream (UserDataMinidumpStreamHandle * stream_to_update, uint32_t stream_type, const void * data, size_t size)

Replaces the given stream with an updated stream.

Creates a new memory block referencing the given

and

with

type

The memory referred to be

and

is

owned by the caller and must remain valid while it is in effect for the

CrashpadInfo object.

Frees

and returns a new handle to the updated stream.

Parameters

stream_to_update [in] A handle to the stream to be updated, received from either AddUserDataMinidumpStream() or previous calls to this function.
stream_type [in] The stream type identifier to use. This should be normally be larger than `MINIDUMP_STREAM_TYPE::LastReservedStream` which is `0xffff`.
data [in] The base pointer of the stream data.
size [in] The size of the stream data.

Returns

A handle to the new memory block that references the updated data,

for use in calling this method again if needed.

CrashpadInfo & operator= (const CrashpadInfo & )

Defined at line 76 of file ../../third_party/crashpad/src/client/crashpad_info.h

void set_extra_memory_ranges (SimpleAddressRangeBag * address_range_bag)

Sets the bag of extra memory ranges to be included in the snapshot.

Extra memory ranges may exist in

at the time that

this method is called, or they may be added, removed, or modified in

after this method is called.

TODO(scottmg) This is currently only supported on Windows and iOS.

Parameters

address_range_bag [in] A bag of address ranges. The CrashpadInfo object does not take ownership of the SimpleAddressRangeBag object. It is the caller’s responsibility to ensure that this pointer remains valid while it is in effect for a CrashpadInfo object.

Defined at line 92 of file ../../third_party/crashpad/src/client/crashpad_info.h

SimpleAddressRangeBag * extra_memory_ranges ()

Returns

The simple extra memory ranges SimpleAddressRangeBag object.

Defined at line 99 of file ../../third_party/crashpad/src/client/crashpad_info.h

void set_simple_annotations (SimpleStringDictionary * simple_annotations)

Sets the simple annotations dictionary.

Simple annotations set on a CrashpadInfo structure are interpreted by

Crashpad as module-level annotations.

Annotations may exist in

at the time that this

method is called, or they may be added, removed, or modified in

after this method is called.

Parameters

simple_annotations [in] A dictionary that maps string keys to string values. The CrashpadInfo object does not take ownership of the SimpleStringDictionary object. It is the caller’s responsibility to ensure that this pointer remains valid while it is in effect for a CrashpadInfo object.

Defined at line 148 of file ../../third_party/crashpad/src/client/crashpad_info.h

SimpleStringDictionary * simple_annotations ()

Returns

The simple annotations dictionary.

Defined at line 155 of file ../../third_party/crashpad/src/client/crashpad_info.h

void set_annotations_list (AnnotationList * list)

Sets the annotations list.

Unlike the

structure, the

can

typed data and it is not limited to a dictionary form. Annotations are

interpreted by Crashpad as module-level annotations.

Annotations may exist in

at the time that this method is called,

or they may be added, removed, or modified in

after this method is

called.

Parameters

list [in] A list of set Annotation objects that maintain arbitrary, typed key-value state. The CrashpadInfo object does not take ownership of the AnnotationsList object. It is the caller’s responsibility to ensure that this pointer remains valid while it is in effect for a CrashpadInfo object.

Defined at line 177 of file ../../third_party/crashpad/src/client/crashpad_info.h

AnnotationList * annotations_list ()

Returns

The annotations list.

Defined at line 184 of file ../../third_party/crashpad/src/client/crashpad_info.h

void set_crashpad_handler_behavior (TriState crashpad_handler_behavior)

Enables or disables Crashpad handler processing.

When handling an exception, the Crashpad handler will scan all modules in

a process. The first one that has a CrashpadInfo structure populated with

a value other than TriState::kUnset for this field will dictate whether

the handler is functional or not. If all modules with a CrashpadInfo

structure specify TriState::kUnset, the handler will be enabled. If

disabled, the Crashpad handler will still run and receive exceptions, but

will not take any action on an exception on its own behalf, except for the

action necessary to determine that it has been disabled.

The Crashpad handler should not normally be disabled. More commonly, it is

appropriate to disable crash report upload by calling

Settings::SetUploadsEnabled().

Defined at line 200 of file ../../third_party/crashpad/src/client/crashpad_info.h

void set_system_crash_reporter_forwarding (TriState system_crash_reporter_forwarding)

Enables or disables Crashpad forwarding of exceptions to the

system’s crash reporter.

When handling an exception, the Crashpad handler will scan all modules in

a process. The first one that has a CrashpadInfo structure populated with

a value other than TriState::kUnset for this field will dictate whether

the exception is forwarded to the system’s crash reporter. If all modules

with a CrashpadInfo structure specify TriState::kUnset, forwarding will be

enabled. Unless disabled, forwarding may still occur if the Crashpad

handler is disabled by SetCrashpadHandlerState(). Even when forwarding is

enabled, the Crashpad handler may choose not to forward all exceptions to

the system’s crash reporter in cases where it has reason to believe that

the system’s crash reporter would not normally have handled the exception

in Crashpad’s absence.

Defined at line 218 of file ../../third_party/crashpad/src/client/crashpad_info.h

void set_gather_indirectly_referenced_memory (TriState gather_indirectly_referenced_memory, uint32_t limit)

Enables or disables Crashpad capturing indirectly referenced memory

in the minidump.

When handling an exception, the Crashpad handler will scan all modules in

a process. The first one that has a CrashpadInfo structure populated with

a value other than TriState::kUnset for this field will dictate whether

the extra memory is captured.

This causes Crashpad to include pages of data referenced by locals or

other stack memory. Turning this on can increase the size of the minidump

significantly.

Parameters

gather_indirectly_referenced_memory [in] Whether extra memory should be gathered.
limit [in] The amount of memory in bytes after which no more indirectly gathered memory should be captured. This value is only used when is TriState::kEnabled.

Defined at line 240 of file ../../third_party/crashpad/src/client/crashpad_info.h

internal::UserDataMinidumpStreamListEntry * GetUserDataMinidumpStreamHeadForTesting ()

Defined at line 295 of file ../../third_party/crashpad/src/client/crashpad_info.h

Protected Methods

uint32_t signature ()

Defined at line 309 of file ../../third_party/crashpad/src/client/crashpad_info.h

uint32_t version ()

Defined at line 310 of file ../../third_party/crashpad/src/client/crashpad_info.h

uint32_t size ()

Defined at line 311 of file ../../third_party/crashpad/src/client/crashpad_info.h

Enumerations

enum 
Name Value
kSignature 'CPad'

Defined at line 300 of file ../../third_party/crashpad/src/client/crashpad_info.h