The internal namespace, not for public use. More...
Classes | |
class | CaptureMemory |
class | CaptureMemoryDelegateLinux |
class | CaptureMemoryDelegateWin |
class | CheckedAddressRangeGeneric |
Ensures that a range, composed of a base and a size, does not overflow the pointer type of the process it describes a range in. More... | |
class | ClientData |
The context data for registered threadpool waits. More... | |
union | CPUContextUnion |
class | ExceptionSnapshotFuchsia |
An ExceptionSnapshot of an exception sustained by a process on a Fuchsia system. More... | |
class | ExceptionSnapshotIOSIntermediateDump |
An ExceptionSnapshot of an exception sustained by a running (or crashed) process on an iOS system. More... | |
class | ExceptionSnapshotLinux |
An ExceptionSnapshot of an signal received by a running (or crashed) process on a Linux system. More... | |
class | ExceptionSnapshotMac |
An ExceptionSnapshot of an exception sustained by a running (or crashed) process on a macOS system. More... | |
class | ExceptionSnapshotMinidump |
An ExceptionSnapshot based on a minidump file. More... | |
class | ExceptionSnapshotWin |
class | InProcessHandler |
Manage intermediate minidump generation, and own the crash report upload thread and database. More... | |
class | InProcessIntermediateDumpHandler |
Dump all in-process data to iOS intermediate dump. Note: All methods are RUNS-DURING-CRASH . More... | |
class | IOSIntermediateDumpByteArray |
An intermediate dump backed by a byte array. More... | |
class | IOSIntermediateDumpData |
A data object, consisting of a std::vector<uint8_t>. More... | |
class | IOSIntermediateDumpFilePath |
An intermediate dump backed by a FilePath. FilePath is unlinked immediately upon initialization to ensure files are only processed once in the event a crash is introduced by this intermediate dump. More... | |
class | IOSIntermediateDumpInterface |
The base class for reading data into an IOSIntermediateDumpReader. More... | |
class | IOSIntermediateDumpList |
A list object, consisting of a vector of IOSIntermediateDumpMap. More... | |
class | IOSIntermediateDumpMap |
A map object containing a IntermediateDump Key-Object pair. More... | |
class | IOSIntermediateDumpObject |
Base class for intermediate dump object types. More... | |
class | IOSIntermediateDumpReader |
Open and parse iOS intermediate dumps. More... | |
class | IOSIntermediateDumpWriter |
Wrapper class for writing intermediate dump file. More... | |
class | IOSSystemDataCollector |
Used to collect system level data before a crash occurs. More... | |
struct | LocalAllocTraits |
class | MachOImageSymbolTableReaderInitializer |
The internal implementation for MachOImageSymbolTableReader. More... | |
struct | MakeScopedLockedFileHandleOptions |
class | MemoryMapRegionSnapshotFuchsia |
class | MemoryMapRegionSnapshotMinidump |
class | MemoryMapRegionSnapshotWin |
class | MemorySnapshotGeneric |
A MemorySnapshot of a memory region in a process on the running system. Works on multiple platforms by using a platform-specific ProcessMemory object. More... | |
class | MemorySnapshotIOSIntermediateDump |
A MemorySnapshot of a memory region. More... | |
class | MemorySnapshotMinidump |
class | MemorySnapshotSanitized |
A MemorySnapshot which wraps and filters sensitive information from another MemorySnapshot. More... | |
class | MinidumpContextConverter |
class | MinidumpModuleCodeViewRecordPDBLinkWriter |
The base class for writers of CodeView records that serve as links to .pdb (program database) files. More... | |
class | MinidumpRVAListWriter |
The writer for a MinidumpRVAList object in a minidump file, containing a list of RVA pointers. More... | |
class | MinidumpStreamWriter |
The base class for all second-level objects (“streams”) in a minidump file. More... | |
class | MinidumpStringListWriter |
The writer for a MinidumpRVAList object in a minidump file, containing a list of MinidumpStringWriterType objects. More... | |
class | MinidumpStringWriter |
Writes a variable-length string to a minidump file in accordance with the string type’s characteristics. More... | |
class | MinidumpUTF16StringWriter |
Writes a variable-length UTF-16-encoded MINIDUMP_STRING to a minidump file. More... | |
class | MinidumpUTF8StringWriter |
Writes a variable-length UTF-8-encoded MinidumpUTF8String to a minidump file. More... | |
class | MinidumpWritable |
The base class for all content that might be written to a minidump file. More... | |
class | MinidumpWriterUtil |
A collection of utility functions used by the MinidumpWritable family of classes. More... | |
class | ModuleSnapshotElf |
A ModuleSnapshot of a code module (binary image) loaded into a running (or crashed) process on a system that uses ELF modules. More... | |
class | ModuleSnapshotIOSIntermediateDump |
A ModuleSnapshot of a code module (binary image) loaded into a running (or crashed) process on an iOS system. More... | |
class | ModuleSnapshotMac |
A ModuleSnapshot of a code module (binary image) loaded into a running (or crashed) process on a macOS system. More... | |
class | ModuleSnapshotMinidump |
A ModuleSnapshot based on a module in a minidump file. More... | |
class | ModuleSnapshotSanitized |
A ModuleSnapshot which wraps and filters sensitive information from another ModuleSnapshot. More... | |
class | ModuleSnapshotWin |
A ModuleSnapshot of a code module (binary image) loaded into a running (or crashed) process on a Windows system. More... | |
class | PipeServiceContext |
Context information for the named pipe handler threads. More... | |
class | ProcessSnapshotIOSIntermediateDump |
A ProcessSnapshot of a running (or crashed) process running on a iphoneOS system. More... | |
struct | Range |
A tuple holding the current range of bytes which can be read from or have been written to. More... | |
class | ScopedBackgroundTask |
Marks the start of a task that should continue if the application enters the background. More... | |
struct | ScopedDIRCloseTraits |
struct | ScopedFileHANDLECloseTraits |
struct | ScopedKernelHANDLECloseTraits |
struct | ScopedLockedFileHandleTraits |
struct | ScopedSearchHANDLECloseTraits |
struct | ScopedVectoredExceptionRegistrationCloseTraits |
class | ScopedVMMap |
A scoped wrapper for calls to vm_remap and vm_deallocate . Allows in-process handler to safely read and write memory (modulo its protection level) for the intermediate dump. More... | |
class | ScopedVMMapInternal |
Non-templated internal class to be used by ScopedVMMap. More... | |
class | ScopedVMRead |
A scoped wrapper for calls to vm_read and vm_deallocate . Allows in-process handler to safely read memory for the intermediate dump. More... | |
class | ScopedVMReadInternal |
Non-templated internal class to be used by ScopedVMRead. More... | |
struct | Siginfo |
struct | SignalStack |
struct | Sigset |
struct | Sigset< Traits, typename std::enable_if< std::is_base_of< Traits32, Traits >::value >::type > |
struct | Sigset< Traits, typename std::enable_if< std::is_base_of< Traits64, Traits >::value >::type > |
union | Sigval |
class | SystemSnapshotFuchsia |
A SystemSnapshot of the running system, when the system runs Fuchsia. More... | |
class | SystemSnapshotIOSIntermediateDump |
A SystemSnapshot of the running system, when the system runs iOS. More... | |
class | SystemSnapshotLinux |
A SystemSnapshot of the running system, when the system runs Linux. More... | |
class | SystemSnapshotMac |
A SystemSnapshot of the running system, when the system runs macOS. More... | |
class | SystemSnapshotMinidump |
A SystemSnapshot based on a minidump file. More... | |
class | SystemSnapshotWin |
A SystemSnapshot of the running system, when the system runs Windows. More... | |
class | ThreadSnapshotFuchsia |
A ThreadSnapshot of a thread on a Fuchsia system. More... | |
class | ThreadSnapshotIOSIntermediateDump |
A ThreadSnapshot of a thread on an iOS system. More... | |
class | ThreadSnapshotLinux |
A ThreadSnapshot of a thread on a Linux system. More... | |
class | ThreadSnapshotMac |
A ThreadSnapshot of a thread in a running (or crashed) process on a macOS system. More... | |
class | ThreadSnapshotMinidump |
A ThreadSnapshot based on a thread in a minidump file. More... | |
class | ThreadSnapshotSanitized |
A ThreadSnapshot which wraps and filters sensitive information from another ThreadSnapshot. More... | |
class | ThreadSnapshotWin |
A ThreadSnapshot of a thread in a running (or crashed) process on a Windows system. More... | |
class | UniversalMachExcServerImpl |
struct | UserDataMinidumpStreamListEntry |
A linked list of blocks representing custom streams in the minidump, with addresses (and size) stored as uint64_t to simplify reading from the handler process. More... | |
class | WorkerThreadImpl |
class | WriteAllInternal |
The internal implementation of WriteFile() and its wrappers. More... | |
Typedefs | |
template<size_t ArrayCapacity> | |
using | RingBufferArray = std::array<uint8_t, ArrayCapacity> |
using | Key = IntermediateDumpKey |
Enumerations | |
enum class | FileOpenFunction |
enum class | LogMissingDataValueFromMap : bool |
Determine if GetDataFromMap will log and report missing keys. More... | |
enum class | IntermediateDumpKey : uint16_t |
They key for items in the intermediate dump file. More... | |
enum class | IOSIntermediateDumpReaderInitializeResult : int |
The return value for IOSIntermediateDumpReader::Initialize. More... | |
Functions | |
template<typename IntegerType> | |
constexpr Range::Length | Base128VarintEncodedLength (IntegerType value) |
template<size_t ArrayCapacity> | |
constexpr Range::Length | RingBufferArraySize (const RingBufferArray< ArrayCapacity > &ring_buffer_data) |
template<typename RingBufferArrayType> | |
bool | ReadBytesFromRingBuffer (const RingBufferArrayType &ring_buffer_data, internal::Range &ring_buffer_read_range, uint8_t *target_buffer, Range::Length target_buffer_length) |
Reads data from the ring buffer into a target buffer. | |
template<typename RingBufferArrayType, typename IntegerType> | |
std::optional< Range::Length > | ReadBase128VarintFromRingBuffer (const RingBufferArrayType &ring_buffer_data, internal::Range &ring_buffer_read_range, IntegerType &result) |
Reads a single little-endian Base 128 varint-encoded integer from the ring buffer. | |
template<typename RingBufferArrayType> | |
bool | WriteBytesToRingBuffer (const uint8_t *const source_buffer, Range::Length source_buffer_length, RingBufferArrayType &ring_buffer_data, internal::Range &ring_buffer_write_range) |
Writes data from the source buffer into the ring buffer. | |
template<typename RingBufferArrayType, typename IntegerType> | |
std::optional< int > | WriteBase128VarintToRingBuffer (IntegerType value, RingBufferArrayType &ring_buffer_data, internal::Range &ring_buffer_write_range) |
Writes a single Base 128 varint-encoded little-endian unsigned integer into the ring buffer. | |
std::string | MinidumpMiscInfoDebugBuildString () |
Returns the string to set in MINIDUMP_MISC_INFO_4::DbgBldStr. | |
void | InitializeCPUContextX86_64 (const zx_thread_state_general_regs_t &thread_context, const zx_thread_state_fp_regs_t &float_context, CPUContextX86_64 *context) |
Initializes a CPUContextX86_64 structure from native context structures on Fuchsia. | |
void | InitializeCPUContextARM64 (const zx_thread_state_general_regs_t &thread_context, const zx_thread_state_vector_regs_t &vector_context, CPUContextARM64 *context) |
Initializes a CPUContextARM64 structure from native context structures on Fuchsia. | |
void | InitializeCPUContextRISCV64 (const zx_thread_state_general_regs_t &thread_context, const zx_thread_state_fp_regs_t &float_context, CPUContextRISCV64 *context) |
Initializes a CPUContextRISCV64 structure from native context structures on Fuchsia. | |
size_t | ThreadStateLengthForFlavor (thread_state_flavor_t flavor) |
std::ostream & | operator<< (std::ostream &os, const IntermediateDumpKey &t) |
Overload the ostream output operator to make logged keys readable. | |
const IOSIntermediateDumpData * | GetDataFromMap (const IOSIntermediateDumpMap *map, const IntermediateDumpKey &key, LogMissingDataValueFromMap logging=LogMissingDataValueFromMap::kLogIfMissing) |
Call GetAsData with error and UMA logging. | |
const IOSIntermediateDumpMap * | GetMapFromMap (const IOSIntermediateDumpMap *map, const IntermediateDumpKey &key) |
Call GetAsMap with error and UMA logging. | |
const IOSIntermediateDumpList * | GetListFromMap (const IOSIntermediateDumpMap *map, const IntermediateDumpKey &key) |
Call GetAsList with error and UMA logging. | |
bool | GetDataStringFromMap (const IOSIntermediateDumpMap *map, const IntermediateDumpKey &key, std::string *value) |
Call GetAsList with error and UMA logging. | |
void | GetDataValueFromMapErrorInternal (const IntermediateDumpKey &key) |
Log key size error and record error with UMA.␐␐␐␐␐. | |
template<typename T> | |
bool | GetDataValueFromMap (const IOSIntermediateDumpMap *map, const IntermediateDumpKey &key, T *value, LogMissingDataValueFromMap logging=LogMissingDataValueFromMap::kLogIfMissing) |
Call GetAsData and GetValue with error and UMA logging. | |
void | InitializeCPUContextX86_NoFloatingPoint (const SignalThreadContext32 &thread_context, CPUContextX86 *context) |
Initializes GPR and debug state in a CPUContextX86 from a native signal context structure on Linux. | |
void | InitializeCPUContextX86_64_NoFloatingPoint (const SignalThreadContext64 &thread_context, CPUContextX86_64 *context) |
Initializes GPR and debug state in a CPUContextX86_64 from a native signal context structure on Linux. | |
void | InitializeCPUContextARM (const ThreadContext::t32_t &thread_context, const FloatContext::f32_t &float_context, CPUContextARM *context) |
Initializes a CPUContextARM structure from native context structures on Linux. | |
void | InitializeCPUContextARM_NoFloatingPoint (const SignalThreadContext32 &thread_context, CPUContextARM *context) |
Initializes GPR state in a CPUContextARM from a native signal context structure on Linux. | |
void | InitializeCPUContextARM64 (const ThreadContext::t64_t &thread_context, const FloatContext::f64_t &float_context, CPUContextARM64 *context) |
Initializes a CPUContextARM64 structure from native context structures on Linux. | |
void | InitializeCPUContextARM64_NoFloatingPoint (const ThreadContext::t64_t &thread_context, CPUContextARM64 *context) |
Initializes GPR state in a CPUContextARM64 from a native context structure on Linux. | |
void | InitializeCPUContextARM64_OnlyFPSIMD (const SignalFPSIMDContext &float_context, CPUContextARM64 *context) |
Initializes FPSIMD state in a CPUContextARM64 from a native fpsimd signal context structure on Linux. | |
template<typename Traits> | |
void | InitializeCPUContextMIPS (const typename Traits::SignalThreadContext &thread_context, const typename Traits::SignalFloatContext &float_context, typename Traits::CPUContext *context) |
Initializes a CPUContextMIPS structure from native context structures on Linux. | |
void | InitializeCPUContextRISCV64 (const ThreadContext::t64_t &thread_context, const FloatContext::f64_t &float_context, CPUContextRISCV64 *context) |
Initializes a CPUContextRISCV64 structure from native context structures on Linux. | |
void | InitializeCPUContextX86 (CPUContextX86 *context, thread_state_flavor_t flavor, ConstThreadState state, mach_msg_type_number_t state_count, const x86_thread_state32_t *x86_thread_state32, const x86_float_state32_t *x86_float_state32, const x86_debug_state32_t *x86_debug_state32) |
Initializes a CPUContextX86 structure from native context structures on macOS. | |
void | InitializeCPUContextX86_64 (CPUContextX86_64 *context, thread_state_flavor_t flavor, ConstThreadState state, mach_msg_type_number_t state_count, const x86_thread_state64_t *x86_thread_state64, const x86_float_state64_t *x86_float_state64, const x86_debug_state64_t *x86_debug_state64) |
Initializes a CPUContextX86_64 structure from native context structures on macOS. | |
bool | ReadMinidumpAnnotationList (FileReaderInterface *file_reader, const MINIDUMP_LOCATION_DESCRIPTOR &location, std::vector< AnnotationSnapshot > *list) |
Reads a MinidumpAnnotationList from a minidump file at location in file_reader, and returns it in list. | |
bool | ReadMinidumpSimpleStringDictionary (FileReaderInterface *file_reader, const MINIDUMP_LOCATION_DESCRIPTOR &location, std::map< std::string, std::string > *dictionary) |
Reads a MinidumpSimpleStringDictionary from a minidump file location in file_reader, and returns it in dictionary. | |
bool | ReadMinidumpStringList (FileReaderInterface *file_reader, const MINIDUMP_LOCATION_DESCRIPTOR &location, std::vector< std::string > *list) |
Reads a list of MinidumpUTF8String objects in a MinidumpRVAList from a minidump file location in file_reader, and returns it in list. | |
bool | ReadMinidumpUTF8String (FileReaderInterface *file_reader, RVA rva, std::string *string) |
Reads a MinidumpUTF8String from a minidump file at offset rva in file_reader, and returns it in string. | |
bool | ReadMinidumpUTF8String (FileReaderInterface *file_reader, RVA64 rva, std::string *string) |
64-bit specialization of ReadMinidumpUTF8String. | |
bool | ReadMinidumpUTF16String (FileReaderInterface *file_reader, RVA rva, std::u16string *string) |
Reads a MinidumpUTF16String from a minidump file at offset rva in file_reader, and returns it in string. | |
bool | ReadMinidumpUTF16String (FileReaderInterface *file_reader, RVA64 rva, std::u16string *string) |
64-bit specialization of ReadMinidumpUTF16String. | |
bool | ReadMinidumpUTF16String (FileReaderInterface *file_reader, RVA rva, std::string *string) |
Reads a MinidumpUTF16String from a minidump file at offset rva in file_reader, and returns it in string. | |
bool | ReadMinidumpUTF16String (FileReaderInterface *file_reader, RVA64 rva, std::string *string) |
64-bit specialization of ReadMinidumpUTF16String. | |
void | TimeZone (const timeval &snapshot_time, SystemSnapshot::DaylightSavingTimeStatus *dst_status, int *standard_offset_seconds, int *daylight_offset_seconds, std::string *standard_name, std::string *daylight_name) |
Returns time zone information from the snapshot system, based on its locale configuration and snapshot_time. | |
bool | ReadExactly (std::function< FileOperationResult(bool, void *, size_t)> read_function, bool can_log, void *buffer, size_t size) |
The internal implementation of ReadFileExactly() and its wrappers. | |
FileOperationResult | NativeWriteFile (FileHandle file, const void *buffer, size_t size) |
Writes to a file, retrying when interrupted on POSIX. | |
bool | RawLoggingWriteFile (int fd, const void *data, size_t size) |
bool | RawLoggingCloseFile (int fd) |
void | SetFileHandleForTesting (FileHandle file_handle) |
Direct RawLog to log to file_handle instead of stderr, so tests can confirm certain error conditions during in-process crashes. Call before before any Crashpad is run. | |
void | RawLogString (const char *message) |
void | RawLogInt (unsigned int number) |
void | RawLog (const char *file, int line, const char *message, int error) |
Log message to stderr in a way that is safe to run during an in-process crash. Also prints the given file, line number and an optional error code. | |
template<typename ArrayType> | |
constexpr size_t | ArraySizeHelper () noexcept |
A helper to implement ArraySize. | |
bool | ReinterpretBytesImpl (const char *data, size_t data_size, char *dest, size_t dest_size) |
FARPROC | GetFunctionInternal (const wchar_t *library, const char *function, bool required) |
Returns a function pointer to a named function in a library. | |
template<typename FunctionType> | |
FunctionType * | GetFunction (const wchar_t *library, const char *function, bool required) |
Returns a function pointer to a named function in a library. | |
void | InitializeCPUContextX86 (const ThreadContext::t32_t &thread_context, const FloatContext::f32_t &float_context, CPUContextX86 *context) |
Initializes a CPUContextX86 structure from native context structures on Linux. | |
void | InitializeCPUContextX86 (const SignalThreadContext32 &thread_context, const SignalFloatContext32 &float_context, CPUContextX86 *context) |
Initializes a CPUContextX86 structure from native context structures on Linux. | |
void | InitializeCPUContextX86_64 (const ThreadContext::t64_t &thread_context, const FloatContext::f64_t &float_context, CPUContextX86_64 *context) |
Initializes a CPUContextX86_64 structure from native context structures on Linux. | |
void | InitializeCPUContextX86_64 (const SignalThreadContext64 &thread_context, const SignalFloatContext64 &float_context, CPUContextX86_64 *context) |
Initializes a CPUContextX86_64 structure from native context structures on Linux. | |
Variables | |
constexpr RingBufferCapacity | kDefaultRingBufferDataCapacity = 8192 |
Default capacity of RingBufferData , in bytes. | |
constexpr int | kBase128ByteValueBits = 7 |
The number of bits encoded in each byte of a Base 128-encoded varint. | |
constexpr RingBufferAnnotationCapacity | kDefaultRingBufferAnnotationCapacity = 8192 |
Default capacity of RingBufferAnnotation , in bytes. | |
constexpr double | kUploadReportTimeoutSeconds = 60 |
constexpr char | kNativeReadFunctionName [] = "read" |
The name of the native read function used by ReadFile(). | |
constexpr char | kNativeWriteFunctionName [] = "write" |
The name of the native write function used by WriteFile(). | |
The internal namespace, not for public use.
|
strong |
They key for items in the intermediate dump file.
These values are persisted to the intermediate crash dump file. Entries should not be renumbered and numeric values should never be reused.
|
strong |
The return value for IOSIntermediateDumpReader::Initialize.
|
strong |
|
constexpr |
!brief Calculates the length in bytes of value
encoded using little-endian Base 128 varint encoding.
LengthDelimitedRingBufferWriter
uses varint-encoded delimiters to enable zero-copy deserialization of the ringbuffer's contents when storing protobufs inside the ringbuffer, e.g. via google::protobuf::util::ParseDelimitedFromZeroCopyStream()
or similar.
!param[in] value Value to be encoded in Base 128 varint encoding. !return The length in bytes of value
in Base 128 varint encoding.
const IOSIntermediateDumpData * crashpad::internal::GetDataFromMap | ( | const IOSIntermediateDumpMap * | map, |
const IntermediateDumpKey & | key, | ||
LogMissingDataValueFromMap | logging = LogMissingDataValueFromMap::kLogIfMissing ) |
Call GetAsData with error and UMA logging.
[in] | map | The map to load from. |
[in] | key | The key to load from map. |
[in] | logging | This call will log missing keys unless logging is LogDataValueFromMap::kDontLogIfMissing |
bool crashpad::internal::GetDataStringFromMap | ( | const IOSIntermediateDumpMap * | map, |
const IntermediateDumpKey & | key, | ||
std::string * | value ) |
Call GetAsList with error and UMA logging.
[in] | map | The map to load from. |
[in] | key | The key to load from map. |
[out] | value | The loaded string. |
true
with value set accordingly if the string could be loaded, otherwise returns false
and logs an error. bool crashpad::internal::GetDataValueFromMap | ( | const IOSIntermediateDumpMap * | map, |
const IntermediateDumpKey & | key, | ||
T * | value, | ||
LogMissingDataValueFromMap | logging = LogMissingDataValueFromMap::kLogIfMissing ) |
Call GetAsData and GetValue with error and UMA logging.
[in] | map | The map to load from. |
[in] | key | The key to load from map. |
[out] | value | The data to populate. |
[in] | logging | This call will log missing keys unless logging is LogDataValueFromMap::kDontLogIfMissing. This call will always log keys with an invalid size. |
true
, otherwise returns false
. FunctionType * crashpad::internal::GetFunction | ( | const wchar_t * | library, |
const char * | function, | ||
bool | required ) |
Returns a function pointer to a named function in a library.
Do not call this directly, use the GET_FUNCTION() or GET_FUNCTION_REQUIRED() macros instead.
This accesses library by calling LoadLibrary()
and is subject to the same restrictions as that function. Notably, it can’t be used from a DllMain()
entry point.
[in] | library | The library to search in. |
[in] | function | The function to search for. If a leading :: is present, it will be stripped. |
[in] | required | If true , require the function to resolve by DCHECK . |
true
, triggers a DCHECK
assertion on failure, otherwise, nullptr
on failure. FARPROC crashpad::internal::GetFunctionInternal | ( | const wchar_t * | library, |
const char * | function, | ||
bool | required ) |
Returns a function pointer to a named function in a library.
Do not call this directly, use the GET_FUNCTION() or GET_FUNCTION_REQUIRED() macros instead.
This accesses library by calling LoadLibrary()
and is subject to the same restrictions as that function. Notably, it can’t be used from a DllMain()
entry point.
[in] | library | The library to search in. |
[in] | function | The function to search for. If a leading :: is present, it will be stripped. |
[in] | required | If true , require the function to resolve by DCHECK . |
true
, triggers a DCHECK
assertion on failure, otherwise, nullptr
on failure. const IOSIntermediateDumpList * crashpad::internal::GetListFromMap | ( | const IOSIntermediateDumpMap * | map, |
const IntermediateDumpKey & | key ) |
Call GetAsList with error and UMA logging.
[in] | map | The map to load from. |
[in] | key | The key to load from map. |
const IOSIntermediateDumpMap * crashpad::internal::GetMapFromMap | ( | const IOSIntermediateDumpMap * | map, |
const IntermediateDumpKey & | key ) |
Call GetAsMap with error and UMA logging.
[in] | map | The map to load from. |
[in] | key | The key to load from map. |
void crashpad::internal::InitializeCPUContextARM | ( | const ThreadContext::t32_t & | thread_context, |
const FloatContext::f32_t & | float_context, | ||
CPUContextARM * | context ) |
Initializes a CPUContextARM structure from native context structures on Linux.
[in] | thread_context | The native thread context. |
[in] | float_context | The native float context. |
[out] | context | The CPUContextARM structure to initialize. |
void crashpad::internal::InitializeCPUContextARM64 | ( | const ThreadContext::t64_t & | thread_context, |
const FloatContext::f64_t & | float_context, | ||
CPUContextARM64 * | context ) |
Initializes a CPUContextARM64 structure from native context structures on Linux.
[in] | thread_context | The native thread context. |
[in] | float_context | The native float context. |
[out] | context | The CPUContextARM64 structure to initialize. |
void crashpad::internal::InitializeCPUContextARM64 | ( | const zx_thread_state_general_regs_t & | thread_context, |
const zx_thread_state_vector_regs_t & | vector_context, | ||
CPUContextARM64 * | context ) |
Initializes a CPUContextARM64 structure from native context structures on Fuchsia.
[in] | thread_context | The native thread context. |
[in] | vector_context | The native vector context that also contains the floating point registers. |
[out] | context | The CPUContextARM64 structure to initialize. |
void crashpad::internal::InitializeCPUContextARM64_NoFloatingPoint | ( | const ThreadContext::t64_t & | thread_context, |
CPUContextARM64 * | context ) |
Initializes GPR state in a CPUContextARM64 from a native context structure on Linux.
Floating point state is initialized to zero.
[in] | thread_context | The native thread context. |
[out] | context | The CPUContextARM64 structure to initialize. |
void crashpad::internal::InitializeCPUContextARM64_OnlyFPSIMD | ( | const SignalFPSIMDContext & | float_context, |
CPUContextARM64 * | context ) |
Initializes FPSIMD state in a CPUContextARM64 from a native fpsimd signal context structure on Linux.
General purpose registers are not initialized.
[in] | float_context | The native fpsimd context. |
[out] | context | The CPUContextARM64 structure to initialize. |
void crashpad::internal::InitializeCPUContextARM_NoFloatingPoint | ( | const SignalThreadContext32 & | thread_context, |
CPUContextARM * | context ) |
Initializes GPR state in a CPUContextARM from a native signal context structure on Linux.
Floating point state is initialized to zero.
[in] | thread_context | The native thread context. |
[out] | context | The CPUContextARM structure to initialize. |
void crashpad::internal::InitializeCPUContextMIPS | ( | const typename Traits::SignalThreadContext & | thread_context, |
const typename Traits::SignalFloatContext & | float_context, | ||
typename Traits::CPUContext * | context ) |
Initializes a CPUContextMIPS structure from native context structures on Linux.
This function has template specializations for MIPSEL and MIPS64EL architecture contexts, using ContextTraits32 or ContextTraits64 as template parameter, respectively.
[in] | thread_context | The native thread context. |
[in] | float_context | The native float context. |
[out] | context | The CPUContextMIPS structure to initialize. |
void crashpad::internal::InitializeCPUContextRISCV64 | ( | const ThreadContext::t64_t & | thread_context, |
const FloatContext::f64_t & | float_context, | ||
CPUContextRISCV64 * | context ) |
Initializes a CPUContextRISCV64 structure from native context structures on Linux.
[in] | thread_context | The native thread context. |
[in] | float_context | The native float context. |
[out] | context | The CPUContextRISCV64 structure to initialize. |
void crashpad::internal::InitializeCPUContextRISCV64 | ( | const zx_thread_state_general_regs_t & | thread_context, |
const zx_thread_state_fp_regs_t & | float_context, | ||
CPUContextRISCV64 * | context ) |
Initializes a CPUContextRISCV64 structure from native context structures on Fuchsia.
[in] | thread_context | The native thread context. |
[in] | float_context | The native floating point context. |
[out] | context | The CPUContextRISCV64 structure to initialize. |
void crashpad::internal::InitializeCPUContextX86 | ( | const SignalThreadContext32 & | thread_context, |
const SignalFloatContext32 & | float_context, | ||
CPUContextX86 * | context ) |
Initializes a CPUContextX86 structure from native context structures on Linux.
[in] | thread_context | The native thread context. |
[in] | float_context | The native float context. |
[out] | context | The CPUContextX86 structure to initialize. |
void crashpad::internal::InitializeCPUContextX86 | ( | const ThreadContext::t32_t & | thread_context, |
const FloatContext::f32_t & | float_context, | ||
CPUContextX86 * | context ) |
Initializes a CPUContextX86 structure from native context structures on Linux.
[in] | thread_context | The native thread context. |
[in] | float_context | The native float context. |
[out] | context | The CPUContextX86 structure to initialize. |
void crashpad::internal::InitializeCPUContextX86 | ( | CPUContextX86 * | context, |
thread_state_flavor_t | flavor, | ||
ConstThreadState | state, | ||
mach_msg_type_number_t | state_count, | ||
const x86_thread_state32_t * | x86_thread_state32, | ||
const x86_float_state32_t * | x86_float_state32, | ||
const x86_debug_state32_t * | x86_debug_state32 ) |
Initializes a CPUContextX86 structure from native context structures on macOS.
flavor, state, and state_count may be supplied by exception handlers in order for the context parameter to be initialized by the thread state received by the exception handler to the extent possible. In that case, whatever thread state specified by these three parameters will supersede x86_thread_state32, x86_float_state32, or x86_debug_state32. If thread state in this format is not available, flavor may be set to THREAD_STATE_NONE
, and all of x86_thread_state32, x86_float_state32, and x86_debug_state32 will be honored.
If flavor, state, and state_count are provided but do not contain valid values, a message will be logged and their values will be ignored as though flavor were specified as THREAD_STATE_NONE
.
[out] | context | The CPUContextX86 structure to initialize. |
[in] | flavor | The native thread state flavor of state. This may be x86_THREAD_STATE32 , x86_FLOAT_STATE32 , x86_DEBUG_STATE32 , x86_THREAD_STATE , x86_FLOAT_STATE , or x86_DEBUG_STATE . It may also be THREAD_STATE_NONE if state is not supplied (and is nullptr ). |
[in] | state | The native thread state, which may be a casted pointer to x86_thread_state32_t , x86_float_state32_t , x86_debug_state32_t , x86_thread_state , x86_float_state , or x86_debug_state . This parameter may be nullptr to not supply this data, in which case flavor must be THREAD_STATE_NONE . If a “universal” structure is used, it must carry 32-bit state data of the correct type. |
[in] | state_count | The number of natural_t -sized (int -sized) units in state. This may be 0 if state is nullptr . |
[in] | x86_thread_state32 | The state of the thread’s integer registers. |
[in] | x86_float_state32 | The state of the thread’s floating-point registers. |
[in] | x86_debug_state32 | The state of the thread’s debug registers. |
void crashpad::internal::InitializeCPUContextX86_64 | ( | const SignalThreadContext64 & | thread_context, |
const SignalFloatContext64 & | float_context, | ||
CPUContextX86_64 * | context ) |
Initializes a CPUContextX86_64 structure from native context structures on Linux.
[in] | thread_context | The native thread context. |
[in] | float_context | The native float context. |
[out] | context | The CPUContextX86_64 structure to initialize. |
void crashpad::internal::InitializeCPUContextX86_64 | ( | const ThreadContext::t64_t & | thread_context, |
const FloatContext::f64_t & | float_context, | ||
CPUContextX86_64 * | context ) |
Initializes a CPUContextX86_64 structure from native context structures on Linux.
[in] | thread_context | The native thread context. |
[in] | float_context | The native float context. |
[out] | context | The CPUContextX86_64 structure to initialize. |
void crashpad::internal::InitializeCPUContextX86_64 | ( | const zx_thread_state_general_regs_t & | thread_context, |
const zx_thread_state_fp_regs_t & | float_context, | ||
CPUContextX86_64 * | context ) |
Initializes a CPUContextX86_64 structure from native context structures on Fuchsia.
Segment registers are currently initialized to zero.
[in] | thread_context | The native thread context. |
[in] | float_context | The native floating point context. |
[out] | context | The CPUContextX86_64 structure to initialize. |
void crashpad::internal::InitializeCPUContextX86_64 | ( | CPUContextX86_64 * | context, |
thread_state_flavor_t | flavor, | ||
ConstThreadState | state, | ||
mach_msg_type_number_t | state_count, | ||
const x86_thread_state64_t * | x86_thread_state64, | ||
const x86_float_state64_t * | x86_float_state64, | ||
const x86_debug_state64_t * | x86_debug_state64 ) |
Initializes a CPUContextX86_64 structure from native context structures on macOS.
flavor, state, and state_count may be supplied by exception handlers in order for the context parameter to be initialized by the thread state received by the exception handler to the extent possible. In that case, whatever thread state specified by these three parameters will supersede x86_thread_state64, x86_float_state64, or x86_debug_state64. If thread state in this format is not available, flavor may be set to THREAD_STATE_NONE
, and all of x86_thread_state64, x86_float_state64, and x86_debug_state64 will be honored.
If flavor, state, and state_count are provided but do not contain valid values, a message will be logged and their values will be ignored as though flavor were specified as THREAD_STATE_NONE
.
[out] | context | The CPUContextX86_64 structure to initialize. |
[in] | flavor | The native thread state flavor of state. This may be x86_THREAD_STATE64 , x86_FLOAT_STATE64 , x86_DEBUG_STATE64 , x86_THREAD_STATE , x86_FLOAT_STATE , or x86_DEBUG_STATE . It may also be THREAD_STATE_NONE if state is not supplied (and is nullptr ). |
[in] | state | The native thread state, which may be a casted pointer to x86_thread_state64_t , x86_float_state64_t , x86_debug_state64_t , x86_thread_state , x86_float_state , or x86_debug_state . This parameter may be nullptr to not supply this data, in which case flavor must be THREAD_STATE_NONE . If a “universal” structure is used, it must carry 64-bit state data of the correct type. |
[in] | state_count | The number of int -sized units in state. This may be 0 if state is nullptr . |
[in] | x86_thread_state64 | The state of the thread’s integer registers. |
[in] | x86_float_state64 | The state of the thread’s floating-point registers. |
[in] | x86_debug_state64 | The state of the thread’s debug registers. |
void crashpad::internal::InitializeCPUContextX86_64_NoFloatingPoint | ( | const SignalThreadContext64 & | thread_context, |
CPUContextX86_64 * | context ) |
Initializes GPR and debug state in a CPUContextX86_64 from a native signal context structure on Linux.
Floating point state and debug registers are initialized to zero.
[in] | thread_context | The native thread context. |
[out] | context | The CPUContextX86_64 structure to initialize. |
void crashpad::internal::InitializeCPUContextX86_NoFloatingPoint | ( | const SignalThreadContext32 & | thread_context, |
CPUContextX86 * | context ) |
Initializes GPR and debug state in a CPUContextX86 from a native signal context structure on Linux.
Floating point state and debug registers are initialized to zero.
[in] | thread_context | The native thread context. |
[out] | context | The CPUContextX86 structure to initialize. |
std::string crashpad::internal::MinidumpMiscInfoDebugBuildString | ( | ) |
Returns the string to set in MINIDUMP_MISC_INFO_4::DbgBldStr.
dbghelp produces strings like "dbghelp.i386,6.3.9600.16520"
and "dbghelp.amd64,6.3.9600.16520"
. This function mimics that format, and adds the OS that wrote the minidump along with any relevant platform-specific data describing the compilation environment.
This function is an implementation detail of MinidumpMiscInfoWriter::InitializeFromSnapshot() and is only exposed for testing purposes.
FileOperationResult crashpad::internal::NativeWriteFile | ( | FileHandle | file, |
const void * | buffer, | ||
size_t | size ) |
Writes to a file, retrying when interrupted on POSIX.
Fewer than size bytes may be written to file. This can happen if the underlying write operation returns before writing the entire buffer, or if the buffer is too large to write in a single operation, possibly due to a limitation of a data type used to express the number of bytes written.
This function adapts native write operations for uniform use by WriteFile(). This function should only be called by WriteFile(). Other code should call WriteFile() or another function that wraps WriteFile().
[in] | file | The file to write to. |
[in] | buffer | A buffer containing data to be written. |
[in] | size | The number of bytes from buffer to write. |
-1
on error, with errno
or GetLastError()
set appropriately. void crashpad::internal::RawLog | ( | const char * | file, |
int | line, | ||
const char * | message, | ||
int | error ) |
Log message to stderr in a way that is safe to run during an in-process crash. Also prints the given file, line number and an optional error code.
Note: RUNS-DURING-CRASH.
std::optional< Range::Length > crashpad::internal::ReadBase128VarintFromRingBuffer | ( | const RingBufferArrayType & | ring_buffer_data, |
internal::Range & | ring_buffer_read_range, | ||
IntegerType & | result ) |
Reads a single little-endian Base 128 varint-encoded integer from the ring buffer.
[in] | ring_buffer_data | The ring buffer to read. |
[in,out] | ring_buffer_read_range | The range of the data available to read. Upon return, set to the remaining range of data available to read, if any. |
[out] | result | Upon success, set to the decoded value read from the buffer. |
std::nullopt
otherwise. On success, updates ring_buffer_read_range
to reflect the bytes available to read.The varint can wrap around the end of the ring buffer, in which case the read continues at the beginning of the ring buffer (if the ring buffer is long enough).
bool crashpad::internal::ReadBytesFromRingBuffer | ( | const RingBufferArrayType & | ring_buffer_data, |
internal::Range & | ring_buffer_read_range, | ||
uint8_t * | target_buffer, | ||
Range::Length | target_buffer_length ) |
Reads data from the ring buffer into a target buffer.
[in] | ring_buffer_data | The ring buffer to read. |
[in,out] | ring_buffer_read_range | The range of the data available to read. Upon return, set to the remaining range of data available to read, if any. |
[in] | target_buffer | Buffer into which data will be written. |
[in] | target_buffer_length | Number of bytes to write into target_buffer . |
true
if the read succeeded, false
otherwise. On success, updates ring_buffer_read_range
to reflect the bytes consumed.The bytes can wrap around the end of the ring buffer, in which case the read continues at the beginning of the ring buffer (if the ring buffer is long enough).
bool crashpad::internal::ReadExactly | ( | std::function< FileOperationResult(bool, void *, size_t)> | read_function, |
bool | can_log, | ||
void * | buffer, | ||
size_t | size ) |
The internal implementation of ReadFileExactly() and its wrappers.
The logic is exposed so that it may be reused by FileReaderInterface, and so that it may be tested without requiring large files to be read. It is not intended to be used more generally. Use ReadFileExactly(), LoggingReadFileExactly(), CheckedReadFileExactly(), or FileReaderInterface::ReadExactly() instead.
bool crashpad::internal::ReadMinidumpAnnotationList | ( | FileReaderInterface * | file_reader, |
const MINIDUMP_LOCATION_DESCRIPTOR & | location, | ||
std::vector< AnnotationSnapshot > * | list ) |
Reads a MinidumpAnnotationList from a minidump file at location in file_reader, and returns it in list.
true
on success, with list set by replacing its contents. false
on failure, with a message logged. bool crashpad::internal::ReadMinidumpSimpleStringDictionary | ( | FileReaderInterface * | file_reader, |
const MINIDUMP_LOCATION_DESCRIPTOR & | location, | ||
std::map< std::string, std::string > * | dictionary ) |
Reads a MinidumpSimpleStringDictionary from a minidump file location in file_reader, and returns it in dictionary.
true
on success, with dictionary set by replacing its contents. false
on failure, with a message logged. bool crashpad::internal::ReadMinidumpStringList | ( | FileReaderInterface * | file_reader, |
const MINIDUMP_LOCATION_DESCRIPTOR & | location, | ||
std::vector< std::string > * | list ) |
Reads a list of MinidumpUTF8String objects in a MinidumpRVAList from a minidump file location in file_reader, and returns it in list.
true
on success, with list set by replacing its contents. false
on failure, with a message logged. bool crashpad::internal::ReadMinidumpUTF16String | ( | FileReaderInterface * | file_reader, |
RVA | rva, | ||
std::string * | string ) |
Reads a MinidumpUTF16String from a minidump file at offset rva in file_reader, and returns it in string.
true
on success, with string set. false
on failure, with a message logged. bool crashpad::internal::ReadMinidumpUTF16String | ( | FileReaderInterface * | file_reader, |
RVA | rva, | ||
std::u16string * | string ) |
Reads a MinidumpUTF16String from a minidump file at offset rva in file_reader, and returns it in string.
true
on success, with string set. false
on failure, with a message logged. bool crashpad::internal::ReadMinidumpUTF8String | ( | FileReaderInterface * | file_reader, |
RVA | rva, | ||
std::string * | string ) |
Reads a MinidumpUTF8String from a minidump file at offset rva in file_reader, and returns it in string.
true
on success, with string set. false
on failure, with a message logged.
|
constexpr |
RingBufferArray
as a Range::Length
. void crashpad::internal::TimeZone | ( | const timeval & | snapshot_time, |
SystemSnapshot::DaylightSavingTimeStatus * | dst_status, | ||
int * | standard_offset_seconds, | ||
int * | daylight_offset_seconds, | ||
std::string * | standard_name, | ||
std::string * | daylight_name ) |
Returns time zone information from the snapshot system, based on its locale configuration and snapshot_time.
[in] | snapshot_time | The time to use collect daylight saving time status for, given in time since Epoch. |
[out] | dst_status | Whether the location observes daylight saving time, and if so, whether it or standard time is currently being observed. |
[out] | standard_offset_seconds | The number of seconds that the location’s time zone is east (ahead) of UTC during standard time. |
[out] | daylight_offset_seconds | The number of seconds that the location’s time zone is east (ahead) of UTC during daylight saving. time. |
[out] | standard_name | The name of the time zone while standard time is being observed. |
[out] | daylight_name | The name of the time zone while daylight saving time is being observed. |
std::optional< int > crashpad::internal::WriteBase128VarintToRingBuffer | ( | IntegerType | value, |
RingBufferArrayType & | ring_buffer_data, | ||
internal::Range & | ring_buffer_write_range ) |
Writes a single Base 128 varint-encoded little-endian unsigned integer into the ring buffer.
[in] | value | The value to encode and write into the ring buffer. |
[in] | ring_buffer_data | The ring buffer into which to write. |
[in,out] | ring_buffer_write_range | The range of the data available to write. Upon return, set to the remaining range of data available to write, if any. |
std::nullopt
otherwise. On success, updates write_buffer_read_range
to reflect the range available to write, if any.The varint can wrap around the end of the ring buffer, in which case the write continues at the beginning of the ring buffer (if the ring buffer is long enough).
bool crashpad::internal::WriteBytesToRingBuffer | ( | const uint8_t *const | source_buffer, |
Range::Length | source_buffer_length, | ||
RingBufferArrayType & | ring_buffer_data, | ||
internal::Range & | ring_buffer_write_range ) |
Writes data from the source buffer into the ring buffer.
[in] | source_buffer | Buffer from which data will be read. |
[in] | source_buffer_length | The length in bytes of source_buffer . |
[in] | ring_buffer_data | The ring buffer into which data will be read. |
[in,out] | ring_buffer_write_range | The range of the data available to write. Upon return, set to the remaining range of data available to write, if any. |
true
if write read succeeded, false
otherwise. On success, updates ring_buffer_write_range
to reflect the bytes written.The bytes can wrap around the end of the ring buffer, in which case the write continues at the beginning of the ring buffer (if the ring buffer is long enough).
|
constexpr |
The name of the native read function used by ReadFile().
This value may be useful for logging.
|
constexpr |
The name of the native write function used by WriteFile().
This value may be useful for logging.