A memory region mapped from another Mach task. More...
#include "util/process/process_memory_mac.h"
Public Member Functions | |
| MappedMemory (const MappedMemory &)=delete | |
| MappedMemory & | operator= (const MappedMemory &)=delete |
| const void * | data () const |
| Returns a pointer to the data requested by the user. | |
| bool | ReadCString (size_t offset, std::string *string) const |
Reads a NUL-terminated C string from the mapped region. | |
Friends | |
| class | ProcessMemoryMac |
A memory region mapped from another Mach task.
The mapping is maintained until this object is destroyed.
|
inline |
Returns a pointer to the data requested by the user.
This is the value of the vm_address + user_offset parameters passed to the constructor, casted to const void*.
| bool crashpad::ProcessMemoryMac::MappedMemory::ReadCString | ( | size_t | offset, |
| std::string * | string ) const |
Reads a NUL-terminated C string from the mapped region.
This method will read contiguous memory until a NUL terminator is found.
| [in] | offset | The offset into data() of the string to be read. |
| [out] | string | The string, whose contents begin at data() and continue up to a NUL terminator. |
true on success, with string set appropriately. If offset is greater than or equal to the user_size constructor parameter, or if no NUL terminator was found in data() after offset, returns false with an appropriate warning logged.