Accesses the memory of another Mach task. More...
#include "util/process/process_memory_mac.h"
Classes | |
| class | MappedMemory |
| A memory region mapped from another Mach task. More... | |
Public Member Functions | |
| ProcessMemoryMac (const ProcessMemoryMac &)=delete | |
| ProcessMemoryMac & | operator= (const ProcessMemoryMac &)=delete |
| bool | Initialize (task_t task) |
| Initializes this object to read the memory of a task with the provided task port. | |
| std::unique_ptr< MappedMemory > | ReadMapped (mach_vm_address_t address, size_t size) const |
| Maps memory from the target task into the current task. | |
Public Member Functions inherited from crashpad::ProcessMemory | |
| bool | Read (VMAddress address, VMSize size, void *buffer) const |
| Copies memory from the target process into a caller-provided buffer in the current process. | |
| bool | ReadCString (VMAddress address, std::string *string) const |
Reads a NUL-terminated C string from the target process into a string in the current process. | |
| bool | ReadCStringSizeLimited (VMAddress address, VMSize size, std::string *string) const |
Reads a NUL-terminated C string from the target process into a string in the current process. | |
Accesses the memory of another Mach task.
| bool crashpad::ProcessMemoryMac::Initialize | ( | task_t | task | ) |
Initializes this object to read the memory of a task with the provided task port.
This method must be called successfully prior to calling any other method in this class.
| [in] | task | A send right to the target task's task port. This object does not take ownership of the send right. |
true on success, false on failure with a message logged. | std::unique_ptr< ProcessMemoryMac::MappedMemory > crashpad::ProcessMemoryMac::ReadMapped | ( | mach_vm_address_t | address, |
| size_t | size ) const |
Maps memory from the target task into the current task.
This interface is an alternative to Read() that does not require the caller to provide a buffer to fill. This avoids copying memory, which can offer a performance improvement.
| [in] | address | The address, in the target task’s address space, of the memory region to map. |
| [in] | size | The size, in bytes, of the memory region to map. |
nullptr, with a warning logged. Failures can occur, for example, when encountering unmapped or unreadable pages.