blob: ef141b8edf6567acc09a2e22fb5654fbbb469bb3 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Crashpad: crashpad::MemoryMap Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="crashpad_doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Crashpad
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacecrashpad.html">crashpad</a></li><li class="navelem"><a class="el" href="classcrashpad_1_1MemoryMap.html">MemoryMap</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classcrashpad_1_1MemoryMap-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">crashpad::MemoryMap Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Accesses information about mapped memory in another process.
<a href="classcrashpad_1_1MemoryMap.html#details">More...</a></p>
<p><code>#include &quot;util/linux/memory_map.h&quot;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structcrashpad_1_1MemoryMap_1_1Mapping.html">Mapping</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Information about a mapped region of memory. <a href="structcrashpad_1_1MemoryMap_1_1Mapping.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a6c08c18f41b08ed7ee26e7634c72abf6"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1MemoryMap.html#a6c08c18f41b08ed7ee26e7634c72abf6">Initialize</a> (<a class="el" href="classcrashpad_1_1PtraceConnection.html">PtraceConnection</a> *connection)</td></tr>
<tr class="memdesc:a6c08c18f41b08ed7ee26e7634c72abf6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes this object with information about the mapped memory regions in the process connected via <em>connection</em>. <a href="#a6c08c18f41b08ed7ee26e7634c72abf6">More...</a><br /></td></tr>
<tr class="separator:a6c08c18f41b08ed7ee26e7634c72abf6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac765748bcf0835bc2268e5884724f4ed"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structcrashpad_1_1MemoryMap_1_1Mapping.html">Mapping</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1MemoryMap.html#ac765748bcf0835bc2268e5884724f4ed">FindMapping</a> (<a class="el" href="namespacecrashpad.html#acb197256391fbfca91f9a7e5c911db45">LinuxVMAddress</a> address) const</td></tr>
<tr class="separator:ac765748bcf0835bc2268e5884724f4ed"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0a28378e3ad216fc1bf175ac3a434c72"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structcrashpad_1_1MemoryMap_1_1Mapping.html">Mapping</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1MemoryMap.html#a0a28378e3ad216fc1bf175ac3a434c72">FindMappingWithName</a> (const std::string &amp;name) const</td></tr>
<tr class="separator:a0a28378e3ad216fc1bf175ac3a434c72"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a71734fd96aa2b54cd25ba72d1d3655f3"><td class="memItemLeft" align="right" valign="top">std::vector&lt; const <a class="el" href="structcrashpad_1_1MemoryMap_1_1Mapping.html">Mapping</a> * &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1MemoryMap.html#a71734fd96aa2b54cd25ba72d1d3655f3">FindFilePossibleMmapStarts</a> (const <a class="el" href="structcrashpad_1_1MemoryMap_1_1Mapping.html">Mapping</a> &amp;mapping) const</td></tr>
<tr class="memdesc:a71734fd96aa2b54cd25ba72d1d3655f3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Find Mappings that share a <a class="el" href="structcrashpad_1_1MemoryMap_1_1Mapping.html" title="Information about a mapped region of memory. ">Mapping</a>'s file, mapped from offset 0. <a href="#a71734fd96aa2b54cd25ba72d1d3655f3">More...</a><br /></td></tr>
<tr class="separator:a71734fd96aa2b54cd25ba72d1d3655f3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Accesses information about mapped memory in another process. </p>
<p>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 <a class="el" href="classcrashpad_1_1MemoryMap.html#a6c08c18f41b08ed7ee26e7634c72abf6" title="Initializes this object with information about the mapped memory regions in the process connected via...">Initialize()</a>, and even mappings existing at the time <a class="el" href="classcrashpad_1_1MemoryMap.html#a6c08c18f41b08ed7ee26e7634c72abf6" title="Initializes this object with information about the mapped memory regions in the process connected via...">Initialize()</a> was called may not be found. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a71734fd96aa2b54cd25ba72d1d3655f3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a71734fd96aa2b54cd25ba72d1d3655f3">&#9670;&nbsp;</a></span>FindFilePossibleMmapStarts()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::vector&lt; const <a class="el" href="structcrashpad_1_1MemoryMap_1_1Mapping.html">MemoryMap::Mapping</a> * &gt; crashpad::MemoryMap::FindFilePossibleMmapStarts </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="structcrashpad_1_1MemoryMap_1_1Mapping.html">Mapping</a> &amp;&#160;</td>
<td class="paramname"><em>mapping</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Find Mappings that share a <a class="el" href="structcrashpad_1_1MemoryMap_1_1Mapping.html" title="Information about a mapped region of memory. ">Mapping</a>'s file, mapped from offset 0. </p>
<p>Executables and libaries are typically loaded into several mappings with varying permissions for different segments. Portions of an ELF file may be mapped multiple times as part of loading the file, for example, when initializing GNU_RELRO segments. This method searches for mappings at or below <em>mapping</em> in memory that are mapped from the same file as <em>mapping</em> from offset 0.</p>
<p>This method is intended to help identify the possible base address for loaded modules, but it is the caller's responsibility to determine which returned mapping is correct.</p>
<p>If <em>mapping</em> does not refer to a valid mapping, an empty vector will be returned and a message will be logged. If <em>mapping</em> is found but does not map a file, <em>mapping</em> is returned in <em>possible_starts</em>.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">mapping</td><td>A <a class="el" href="structcrashpad_1_1MemoryMap_1_1Mapping.html" title="Information about a mapped region of memory. ">Mapping</a> whose series to find the start of. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a vector of the possible mapping starts. </dd></dl>
</div>
</div>
<a id="ac765748bcf0835bc2268e5884724f4ed"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac765748bcf0835bc2268e5884724f4ed">&#9670;&nbsp;</a></span>FindMapping()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="structcrashpad_1_1MemoryMap_1_1Mapping.html">MemoryMap::Mapping</a> * crashpad::MemoryMap::FindMapping </td>
<td>(</td>
<td class="paramtype"><a class="el" href="namespacecrashpad.html#acb197256391fbfca91f9a7e5c911db45">LinuxVMAddress</a>&#160;</td>
<td class="paramname"><em>address</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>The <a class="el" href="structcrashpad_1_1MemoryMap_1_1Mapping.html" title="Information about a mapped region of memory. ">Mapping</a> containing <em>address</em> or <code>nullptr</code> if no match is found. The caller does not take ownership of this object. It is scoped to the lifetime of the <a class="el" href="classcrashpad_1_1MemoryMap.html" title="Accesses information about mapped memory in another process. ">MemoryMap</a> object that it was obtained from. </dd></dl>
</div>
</div>
<a id="a0a28378e3ad216fc1bf175ac3a434c72"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0a28378e3ad216fc1bf175ac3a434c72">&#9670;&nbsp;</a></span>FindMappingWithName()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="structcrashpad_1_1MemoryMap_1_1Mapping.html">MemoryMap::Mapping</a> * crashpad::MemoryMap::FindMappingWithName </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>name</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>The <a class="el" href="structcrashpad_1_1MemoryMap_1_1Mapping.html" title="Information about a mapped region of memory. ">Mapping</a> with the lowest base address whose name is <em>name</em> or <code>nullptr</code> if no match is found. The caller does not take ownership of this object. It is scoped to the lifetime of the <a class="el" href="classcrashpad_1_1MemoryMap.html" title="Accesses information about mapped memory in another process. ">MemoryMap</a> object that it was obtained from. </dd></dl>
</div>
</div>
<a id="a6c08c18f41b08ed7ee26e7634c72abf6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6c08c18f41b08ed7ee26e7634c72abf6">&#9670;&nbsp;</a></span>Initialize()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool crashpad::MemoryMap::Initialize </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classcrashpad_1_1PtraceConnection.html">PtraceConnection</a> *&#160;</td>
<td class="paramname"><em>connection</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Initializes this object with information about the mapped memory regions in the process connected via <em>connection</em>. </p>
<p>This method must be called successfully prior to calling any other method in this class. This method may only be called once.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">connection</td><td>A connection to the process create a map for.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> on success, <code>false</code> on failure with a message logged. </dd></dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>util/linux/memory_map.h</li>
<li>util/linux/memory_map.cc</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.14
</small></address>
</body>
</html>