Crashpad
Classes | Public Member Functions | List of all members
crashpad::MemoryMap Class Reference

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 MappingFindMapping (LinuxVMAddress address) const
 
const MappingFindMappingWithName (const std::string &name) const
 
const MappingFindFileMmapStart (const Mapping &mapping) const
 Find the first Mapping in a series of mappings for the same file. More...
 

Detailed Description

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.

Member Function Documentation

◆ FindFileMmapStart()

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.

Parameters
[in]mappingA Mapping whose series to find the start of.
Returns
The first Mapping in the series or nullptr on failure with a message logged.

◆ FindMapping()

const MemoryMap::Mapping * crashpad::MemoryMap::FindMapping ( LinuxVMAddress  address) const
Returns
The Mapping containing address or nullptr if no match is found. The caller does not take ownership of this object. It is scoped to the lifetime of the MemoryMap object that it was obtained from.

◆ FindMappingWithName()

const MemoryMap::Mapping * crashpad::MemoryMap::FindMappingWithName ( const std::string &  name) const
Returns
The Mapping with the lowest base address whose name is name or nullptr if no match is found. The caller does not take ownership of this object. It is scoped to the lifetime of the MemoryMap object that it was obtained from.

◆ Initialize()

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.

Parameters
[in]pidThe process ID to obtain information for.
Returns
true on success, false on failure with a message logged.

The documentation for this class was generated from the following files: