Crashpad
|
A structure that can be used by a Crashpad-enabled program to provide information to the Crashpad crash handler. More...
#include "client/crashpad_info.h"
Public Types | |
enum | : uint32_t |
Public Member Functions | |
void | set_extra_memory_ranges (SimpleAddressRangeBag *address_range_bag) |
Sets the bag of extra memory ranges to be included in the snapshot. More... | |
void | set_simple_annotations (SimpleStringDictionary *simple_annotations) |
Sets the simple annotations dictionary. More... | |
SimpleStringDictionary * | simple_annotations () const |
void | set_annotations_list (AnnotationList *list) |
Sets the annotations list. More... | |
AnnotationList * | annotations_list () const |
void | set_crashpad_handler_behavior (TriState crashpad_handler_behavior) |
Enables or disables Crashpad handler processing. More... | |
void | set_system_crash_reporter_forwarding (TriState system_crash_reporter_forwarding) |
Enables or disables Crashpad forwarding of exceptions to the system’s crash reporter. More... | |
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. More... | |
void | AddUserDataMinidumpStream (uint32_t stream_type, const void *data, size_t size) |
Adds a custom stream to the minidump. More... | |
Static Public Member Functions | |
static CrashpadInfo * | GetCrashpadInfo () |
Returns the global CrashpadInfo structure. | |
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.
void crashpad::CrashpadInfo::AddUserDataMinidumpStream | ( | uint32_t | stream_type, |
const void * | data, | ||
size_t | size | ||
) |
Adds a custom stream to the minidump.
The memory block referenced by data and size will added to the minidump as separate stream with type stream_type. The memory referred to by data and size 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.
[in] | stream_type | The stream type identifier to use. This should be normally be larger than MINIDUMP_STREAM_TYPE::LastReservedStream which is 0xffff . |
[in] | data | The base pointer of the stream data. |
[in] | size | The size of the stream data. |
|
inline |
|
inline |
Sets the annotations list.
Unlike the simple_annotations structure, the annotations 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 list at the time that this method is called, or they may be added, removed, or modified in list after this method is called.
[in] | list | 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. |
|
inline |
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().
|
inline |
Sets the bag of extra memory ranges to be included in the snapshot.
Extra memory ranges may exist in address_range_bag at the time that this method is called, or they may be added, removed, or modified in address_range_bag after this method is called.
TODO(scottmg) This is currently only supported on Windows.
[in] | address_range_bag | 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. |
|
inline |
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.
[in] | gather_indirectly_referenced_memory | Whether extra memory should be gathered. |
[in] | limit | The amount of memory in bytes after which no more indirectly gathered memory should be captured. This value is only used when gather_indirectly_referenced_memory is TriState::kEnabled. |
|
inline |
Sets the simple annotations dictionary.
Simple annotations set on a CrashpadInfo structure are interpreted by Crashpad as module-level annotations.
Annotations may exist in simple_annotations at the time that this method is called, or they may be added, removed, or modified in simple_annotations after this method is called.
[in] | simple_annotations | 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. |
|
inline |
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.
|
inline |