blob: 27d1641238a0981c78b00740ea6238f7fd754e85 [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::ExceptionPorts 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_1ExceptionPorts.html">ExceptionPorts</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classcrashpad_1_1ExceptionPorts-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">crashpad::ExceptionPorts Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>A better interface to <code>*_get_exception_ports()</code> and <code>*_set_exception_ports()</code>.
<a href="classcrashpad_1_1ExceptionPorts.html#details">More...</a></p>
<p><code>#include &quot;util/mach/exception_ports.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_1ExceptionPorts_1_1ExceptionHandler.html">ExceptionHandler</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Information about a registered exception handler. <a href="structcrashpad_1_1ExceptionPorts_1_1ExceptionHandler.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1ExceptionPorts_1_1ExceptionHandlerVector.html">ExceptionHandlerVector</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Wraps <code>std::vector&lt;<a class="el" href="structcrashpad_1_1ExceptionPorts_1_1ExceptionHandler.html" title="Information about a registered exception handler. ">ExceptionHandler</a>&gt;</code>, providing proper cleanup of the send rights contained in each element’s <a class="el" href="structcrashpad_1_1ExceptionPorts_1_1ExceptionHandler.html#a49e5ff609eb445e649fed720978c56d0" title="A send right to a Mach port that will handle exceptions of the types indicated in mask...">ExceptionHandler::port</a>. <a href="classcrashpad_1_1ExceptionPorts_1_1ExceptionHandlerVector.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-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:af3bb7100d4bf2e8ead5115e187434fb0"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1ExceptionPorts.html#af3bb7100d4bf2e8ead5115e187434fb0">TargetType</a> </td></tr>
<tr class="memdesc:af3bb7100d4bf2e8ead5115e187434fb0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Various entities which can have their own exception ports set. <a href="classcrashpad_1_1ExceptionPorts.html#af3bb7100d4bf2e8ead5115e187434fb0">More...</a><br /></td></tr>
<tr class="separator:af3bb7100d4bf2e8ead5115e187434fb0"><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:ae4f91b18d0e8b766acd2077103b1b091"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1ExceptionPorts.html#ae4f91b18d0e8b766acd2077103b1b091">ExceptionPorts</a> (<a class="el" href="classcrashpad_1_1ExceptionPorts.html#af3bb7100d4bf2e8ead5115e187434fb0">TargetType</a> target_type, mach_port_t target_port)</td></tr>
<tr class="memdesc:ae4f91b18d0e8b766acd2077103b1b091"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs an interface object to get or set exception ports on a host, task, or thread port. <a href="#ae4f91b18d0e8b766acd2077103b1b091">More...</a><br /></td></tr>
<tr class="separator:ae4f91b18d0e8b766acd2077103b1b091"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a55ae807d8ed9e37dec1560043ad3ba63"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1ExceptionPorts.html#a55ae807d8ed9e37dec1560043ad3ba63">GetExceptionPorts</a> (exception_mask_t mask, <a class="el" href="classcrashpad_1_1ExceptionPorts_1_1ExceptionHandlerVector.html">ExceptionHandlerVector</a> *handlers) const</td></tr>
<tr class="memdesc:a55ae807d8ed9e37dec1560043ad3ba63"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calls <code>*_get_exception_ports()</code> on the target. <a href="#a55ae807d8ed9e37dec1560043ad3ba63">More...</a><br /></td></tr>
<tr class="separator:a55ae807d8ed9e37dec1560043ad3ba63"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae95003b8bb2c9549f35811d6ef20f24b"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1ExceptionPorts.html#ae95003b8bb2c9549f35811d6ef20f24b">SetExceptionPort</a> (exception_mask_t mask, exception_handler_t port, exception_behavior_t behavior, thread_state_flavor_t flavor) const</td></tr>
<tr class="memdesc:ae95003b8bb2c9549f35811d6ef20f24b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calls <code>*_set_exception_ports()</code> on the target. <a href="#ae95003b8bb2c9549f35811d6ef20f24b">More...</a><br /></td></tr>
<tr class="separator:ae95003b8bb2c9549f35811d6ef20f24b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a17c5eab2e49a44acb936ecb3a1a9f61c"><td class="memItemLeft" align="right" valign="top">const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1ExceptionPorts.html#a17c5eab2e49a44acb936ecb3a1a9f61c">TargetTypeName</a> () const</td></tr>
<tr class="memdesc:a17c5eab2e49a44acb936ecb3a1a9f61c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a string identifying the target type. <a href="#a17c5eab2e49a44acb936ecb3a1a9f61c">More...</a><br /></td></tr>
<tr class="separator:a17c5eab2e49a44acb936ecb3a1a9f61c"><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>A better interface to <code>*_get_exception_ports()</code> and <code>*_set_exception_ports()</code>. </p>
<p>The same generic interface can be used to operate on host, task, and thread exception ports. The “get” interface is superior to the system’s native interface because it keeps related data about a single exception handler together in one struct, rather than separating it into four parallel arrays. </p>
</div><h2 class="groupheader">Member Enumeration Documentation</h2>
<a id="af3bb7100d4bf2e8ead5115e187434fb0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af3bb7100d4bf2e8ead5115e187434fb0">&#9670;&nbsp;</a></span>TargetType</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="classcrashpad_1_1ExceptionPorts.html#af3bb7100d4bf2e8ead5115e187434fb0">crashpad::ExceptionPorts::TargetType</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>Various entities which can have their own exception ports set. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="af3bb7100d4bf2e8ead5115e187434fb0a1fbac1b7493bb39014e3e230710ca8d6"></a>kTargetTypeHost&#160;</td><td class="fielddoc"><p>The host exception target. </p>
<p><code>host_get_exception_ports()</code> and <code>host_set_exception_ports()</code> will be used. If no target port is explicitly provided, <code>mach_host_self()</code> will be used as the target port. <code>mach_host_self()</code> is the only target port for this type that is expected to function properly.</p>
<dl class="section note"><dt>Note</dt><dd>Operations on this target type are not expected to succeed as non-root, because <code>mach_host_self()</code> doesn’t return the privileged <code>host_priv</code> port to non-root users, and this is the target port that’s required for <code>host_get_exception_ports()</code> and <code>host_set_exception_ports()</code>. </dd></dl>
</td></tr>
<tr><td class="fieldname"><a id="af3bb7100d4bf2e8ead5115e187434fb0a09b11dc4afd9c15e3c5aea28a4277837"></a>kTargetTypeTask&#160;</td><td class="fielddoc"><p>A task exception target. </p>
<p><code>task_get_exception_ports()</code> and <code>task_set_exception_ports()</code> will be used. If no target port is explicitly provided, <code>mach_task_self()</code> will be used as the target port. </p>
</td></tr>
<tr><td class="fieldname"><a id="af3bb7100d4bf2e8ead5115e187434fb0a80612d39e0a116cae2104f4f286d3c55"></a>kTargetTypeThread&#160;</td><td class="fielddoc"><p>A thread exception target. </p>
<p><code>thread_get_exception_ports()</code> and <code>thread_set_exception_ports()</code> will be used. If no target port is explicitly provided, <code>mach_thread_self()</code> will be used as the target port. </p>
</td></tr>
</table>
</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="ae4f91b18d0e8b766acd2077103b1b091"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae4f91b18d0e8b766acd2077103b1b091">&#9670;&nbsp;</a></span>ExceptionPorts()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">crashpad::ExceptionPorts::ExceptionPorts </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classcrashpad_1_1ExceptionPorts.html#af3bb7100d4bf2e8ead5115e187434fb0">TargetType</a>&#160;</td>
<td class="paramname"><em>target_type</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">mach_port_t&#160;</td>
<td class="paramname"><em>target_port</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Constructs an interface object to get or set exception ports on a host, task, or thread port. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">target_type</td><td>The type of target on which the exception ports are to be get or set: <a class="el" href="classcrashpad_1_1ExceptionPorts.html#af3bb7100d4bf2e8ead5115e187434fb0a1fbac1b7493bb39014e3e230710ca8d6" title="The host exception target. ">kTargetTypeHost</a>, <a class="el" href="classcrashpad_1_1ExceptionPorts.html#af3bb7100d4bf2e8ead5115e187434fb0a09b11dc4afd9c15e3c5aea28a4277837" title="A task exception target. ">kTargetTypeTask</a>, or or <a class="el" href="classcrashpad_1_1ExceptionPorts.html#af3bb7100d4bf2e8ead5115e187434fb0a80612d39e0a116cae2104f4f286d3c55" title="A thread exception target. ">kTargetTypeThread</a>. The correct functions for <code>*_get_exception_ports()</code> and <code>*_set_exception_ports()</code> will be used. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">target_port</td><td>The target on which to call <code>*_get_exception_ports()</code> or <code>*_set_exception_ports()</code>. The target port must be a send right to a port of the type specified in <em>target_type</em>. In this case, ownership of <em>target_port</em> is not given to the new <a class="el" href="classcrashpad_1_1ExceptionPorts.html" title="A better interface to *_get_exception_ports() and *_set_exception_ports(). ">ExceptionPorts</a> object. <em>target_port</em> may also be <code>HOST_NULL</code>, <code>TASK_NULL</code>, or <code>THREAD_NULL</code>, in which case <code>mach_host_self()</code>, <code>mach_task_self()</code>, or <code>mach_thread_self()</code> will be used as the target port depending on the value of <em>target_type</em>. In this case, ownership of the target port will be managed appropriately for <em>target_type</em>. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a55ae807d8ed9e37dec1560043ad3ba63"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a55ae807d8ed9e37dec1560043ad3ba63">&#9670;&nbsp;</a></span>GetExceptionPorts()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool crashpad::ExceptionPorts::GetExceptionPorts </td>
<td>(</td>
<td class="paramtype">exception_mask_t&#160;</td>
<td class="paramname"><em>mask</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classcrashpad_1_1ExceptionPorts_1_1ExceptionHandlerVector.html">ExceptionHandlerVector</a> *&#160;</td>
<td class="paramname"><em>handlers</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Calls <code>*_get_exception_ports()</code> on the target. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">mask</td><td>The exception mask, containing the <code>EXC_MASK_*</code> values to be looked up and returned in <em>handlers</em>. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">handlers</td><td>The exception handlers registered for <em>target_port</em> to handle exceptions indicated in <em>mask</em>. If no execption port is registered for a bit in <em>mask</em>, <em>handlers</em> will not contain an entry corresponding to that bit. This is a departure from the <code>*_get_exception_ports()</code> functions, which may return a handler whose port is set to <code>EXCEPTION_PORT_NULL</code> in this case. On failure, this argument is untouched.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if <code>*_get_exception_ports()</code> returned <code>KERN_SUCCESS</code>, with <em>handlers</em> set appropriately. <code>false</code> otherwise, with an appropriate message logged. </dd></dl>
</div>
</div>
<a id="ae95003b8bb2c9549f35811d6ef20f24b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae95003b8bb2c9549f35811d6ef20f24b">&#9670;&nbsp;</a></span>SetExceptionPort()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool crashpad::ExceptionPorts::SetExceptionPort </td>
<td>(</td>
<td class="paramtype">exception_mask_t&#160;</td>
<td class="paramname"><em>mask</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">exception_handler_t&#160;</td>
<td class="paramname"><em>port</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">exception_behavior_t&#160;</td>
<td class="paramname"><em>behavior</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">thread_state_flavor_t&#160;</td>
<td class="paramname"><em>flavor</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Calls <code>*_set_exception_ports()</code> on the target. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">mask</td><td>A mask specifying the exception types to direct to <em>port</em>, containing <code>EXC_MASK_*</code> values. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">port</td><td>A send right to a Mach port that will handle exceptions sustained by <em>target_port</em> of the types indicated in <em>mask</em>. The send right is copied, not consumed, by this call. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">behavior</td><td>The “behavior” that the exception handler at <em>port</em> implements: <code>EXCEPTION_DEFAULT</code>, <code>EXCEPTION_STATE</code>, or <code>EXCEPTION_STATE_IDENTITY</code>, possibly combined with <code>MACH_EXCEPTION_CODES</code>. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">flavor</td><td>The thread state flavor that the exception handler at <em>port</em> expects to receive and possibly modify. This argument has no effect for <em>behavior</em> values that indicate a “default” behavior.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if <code>*_set_exception_ports()</code> returned <code>KERN_SUCCESS</code>. <code>false</code> otherwise, with an appropriate message logged. </dd></dl>
</div>
</div>
<a id="a17c5eab2e49a44acb936ecb3a1a9f61c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a17c5eab2e49a44acb936ecb3a1a9f61c">&#9670;&nbsp;</a></span>TargetTypeName()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const char * crashpad::ExceptionPorts::TargetTypeName </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns a string identifying the target type. </p>
<dl class="section return"><dt>Returns</dt><dd><code>"host"</code>, <code>"task"</code>, or <code>"thread"</code>, as appropriate. </dd></dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>util/mach/exception_ports.h</li>
<li>util/mach/exception_ports.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>