<!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.13"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>Crashpad: crashpad::MachOImageSymbolTableReader 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.13 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> $(function() { initMenu('',true,false,'search.php','Search'); $(document).ready(function() { init_search(); }); }); </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_1MachOImageSymbolTableReader.html">MachOImageSymbolTableReader</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#nested-classes">Classes</a> | <a href="#pub-types">Public Types</a> | <a href="#pub-methods">Public Member Functions</a> | <a href="classcrashpad_1_1MachOImageSymbolTableReader-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">crashpad::MachOImageSymbolTableReader Class Reference</div> </div> </div><!--header--> <div class="contents"> <p>A reader for symbol tables in Mach-O images mapped into another process. <a href="classcrashpad_1_1MachOImageSymbolTableReader.html#details">More...</a></p> <p><code>#include "snapshot/mac/mach_o_image_symbol_table_reader.h"</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  </td><td class="memItemRight" valign="bottom"><a class="el" href="structcrashpad_1_1MachOImageSymbolTableReader_1_1SymbolInformation.html">SymbolInformation</a></td></tr> <tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Information about a symbol in a module’s symbol table. <a href="structcrashpad_1_1MachOImageSymbolTableReader_1_1SymbolInformation.html#details">More...</a><br /></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a> Public Types</h2></td></tr> <tr class="memitem:a7388a26dbecb47589fc7d291f61d66d8"><td class="memItemLeft" align="right" valign="top"><a id="a7388a26dbecb47589fc7d291f61d66d8"></a> using </td><td class="memItemRight" valign="bottom"><b>SymbolInformationMap</b> = std::map< std::string, <a class="el" href="structcrashpad_1_1MachOImageSymbolTableReader_1_1SymbolInformation.html">SymbolInformation</a> ></td></tr> <tr class="separator:a7388a26dbecb47589fc7d291f61d66d8"><td class="memSeparator" colspan="2"> </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:a2393f96ffcde38cb54752b1d75ed5f7b"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1MachOImageSymbolTableReader.html#a2393f96ffcde38cb54752b1d75ed5f7b">Initialize</a> (<a class="el" href="classcrashpad_1_1ProcessReaderMac.html">ProcessReaderMac</a> *process_reader, const process_types::symtab_command *symtab_command, const process_types::dysymtab_command *dysymtab_command, const <a class="el" href="classcrashpad_1_1MachOImageSegmentReader.html">MachOImageSegmentReader</a> *linkedit_segment, const std::string &module_info)</td></tr> <tr class="memdesc:a2393f96ffcde38cb54752b1d75ed5f7b"><td class="mdescLeft"> </td><td class="mdescRight">Reads the symbol table from another process. <a href="#a2393f96ffcde38cb54752b1d75ed5f7b">More...</a><br /></td></tr> <tr class="separator:a2393f96ffcde38cb54752b1d75ed5f7b"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ac85da22c3a7915bb5869a77765c9ffbc"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structcrashpad_1_1MachOImageSymbolTableReader_1_1SymbolInformation.html">SymbolInformation</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1MachOImageSymbolTableReader.html#ac85da22c3a7915bb5869a77765c9ffbc">LookUpExternalDefinedSymbol</a> (const std::string &name) const</td></tr> <tr class="memdesc:ac85da22c3a7915bb5869a77765c9ffbc"><td class="mdescLeft"> </td><td class="mdescRight">Looks up a symbol in the image’s symbol table. <a href="#ac85da22c3a7915bb5869a77765c9ffbc">More...</a><br /></td></tr> <tr class="separator:ac85da22c3a7915bb5869a77765c9ffbc"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>A reader for symbol tables in Mach-O images mapped into another process. </p> </div><h2 class="groupheader">Member Function Documentation</h2> <a id="a2393f96ffcde38cb54752b1d75ed5f7b"></a> <h2 class="memtitle"><span class="permalink"><a href="#a2393f96ffcde38cb54752b1d75ed5f7b">◆ </a></span>Initialize()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool crashpad::MachOImageSymbolTableReader::Initialize </td> <td>(</td> <td class="paramtype"><a class="el" href="classcrashpad_1_1ProcessReaderMac.html">ProcessReaderMac</a> * </td> <td class="paramname"><em>process_reader</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const process_types::symtab_command * </td> <td class="paramname"><em>symtab_command</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const process_types::dysymtab_command * </td> <td class="paramname"><em>dysymtab_command</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classcrashpad_1_1MachOImageSegmentReader.html">MachOImageSegmentReader</a> * </td> <td class="paramname"><em>linkedit_segment</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>module_info</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Reads the symbol table from another process. </p> <p>This method must only be called once on an object. This method must be called successfully before any other method in this class may be called.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">process_reader</td><td>The reader for the remote process. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">symtab_command</td><td>The <code>LC_SYMTAB</code> load command that identifies the symbol table. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">dysymtab_command</td><td>The <code>LC_DYSYMTAB</code> load command that identifies dynamic symbol information within the symbol table. This load command is not present in all modules, and this parameter may be <code>nullptr</code> for modules that do not have this information. When present, <em>dysymtab_command</em> is an optimization that allows the symbol table reader to only examine symbol table entries known to be relevant for its purposes. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">linkedit_segment</td><td>The <code>__LINKEDIT</code> segment. This segment should contain the data referenced by <em>symtab_command</em> and <em>dysymtab_command</em>. This may be any segment in the module, but by convention, the name <code>__LINKEDIT</code> is used for this purpose. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">module_info</td><td>A string to be used in logged messages. This string is for diagnostic purposes only, and may be empty.</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd><code>true</code> if the symbol table was read successfully. <code>false</code> otherwise, with an appropriate message logged. </dd></dl> </div> </div> <a id="ac85da22c3a7915bb5869a77765c9ffbc"></a> <h2 class="memtitle"><span class="permalink"><a href="#ac85da22c3a7915bb5869a77765c9ffbc">◆ </a></span>LookUpExternalDefinedSymbol()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const <a class="el" href="structcrashpad_1_1MachOImageSymbolTableReader_1_1SymbolInformation.html">MachOImageSymbolTableReader::SymbolInformation</a> * crashpad::MachOImageSymbolTableReader::LookUpExternalDefinedSymbol </td> <td>(</td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>name</em></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Looks up a symbol in the image’s symbol table. </p> <p>The returned information captures the symbol as it exists in the image’s symbol table, not adjusted for any “slide.”</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">name</td><td>The name of the symbol to look up, “mangled” or “decorated” appropriately. For example, use <code>"_main"</code> to look up the symbol for the C <code>main()</code> function, and use <code>"__Z4Funcv"</code> to look up the symbol for the C++ <code>Func()</code> function.</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>A SymbolInformation* object with information about the symbol if it was found, or <code>nullptr</code> if the symbol was not found or if an error occurred. On error, a warning message will also be logged. The caller does not take ownership; the lifetime of the returned object is scoped to the lifetime of this <a class="el" href="classcrashpad_1_1MachOImageSymbolTableReader.html" title="A reader for symbol tables in Mach-O images mapped into another process. ">MachOImageSymbolTableReader</a> object.</dd></dl> <dl class="section note"><dt>Note</dt><dd>Symbol values returned via this interface are not adjusted for “slide.” For slide-adjusted values, use the higher-level <a class="el" href="classcrashpad_1_1MachOImageReader.html#adbaaf5a08d6e67fe7128d171cd11b176" title="Looks up a symbol in the image’s symbol table. ">MachOImageReader::LookUpExternalDefinedSymbol()</a> interface. </dd></dl> </div> </div> <hr/>The documentation for this class was generated from the following files:<ul> <li>snapshot/mac/mach_o_image_symbol_table_reader.h</li> <li>snapshot/mac/mach_o_image_symbol_table_reader.cc</li> </ul> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.13 </small></address> </body> </html>