Crashpad
|
Accesses information about mapped memory in another process. More...
#include "util/linux/memory_map.h"
Classes | |
struct | Mapping |
Information about a mapped region of memory. More... | |
Public Member Functions | |
bool | Initialize (pid_t pid) |
Initializes this object with information about the mapped memory regions in the process whose ID is pid. More... | |
const Mapping * | FindMapping (LinuxVMAddress address) const |
const Mapping * | FindMappingWithName (const std::string &name) const |
const Mapping * | FindFileMmapStart (const Mapping &mapping) const |
Find the first Mapping in a series of mappings for the same file. More... | |
Accesses information about mapped memory in another process.
The target process must be stopped to guarantee correct mappings. If the target process is not stopped, mappings may be invalid after the return from Initialize(), and even mappings existing at the time Initialize() was called may not be found.
const MemoryMap::Mapping * crashpad::MemoryMap::FindFileMmapStart | ( | const Mapping & | mapping | ) | const |
Find the first Mapping in a series of mappings for the same file.
Executables and libaries are typically loaded into several mappings with varying permissions for different segments. This method searches for the mapping with the highest address at or below mapping, which maps the same file as mapping from file offset 0.
If mapping is not found, nullptr
is returned. If mapping is found but does not map a file, mapping is returned.
[in] | mapping | A Mapping whose series to find the start of. |
nullptr
on failure with a message logged. const MemoryMap::Mapping * crashpad::MemoryMap::FindMapping | ( | LinuxVMAddress | address | ) | const |
const MemoryMap::Mapping * crashpad::MemoryMap::FindMappingWithName | ( | const std::string & | name | ) | const |
bool crashpad::MemoryMap::Initialize | ( | pid_t | pid | ) |
Initializes this object with information about the mapped memory regions in the process whose ID is pid.
This method must be called successfully prior to calling any other method in this class. This method may only be called once.
[in] | pid | The process ID to obtain information for. |
true
on success, false
on failure with a message logged.