<trclass="memdesc:"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Information about a registered exception handler. <ahref="structcrashpad_1_1ExceptionPorts_1_1ExceptionHandler.html#details">More...</a><br/></td></tr>
<trclass="memdesc:"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Wraps <code>std::vector<<aclass="el"href="structcrashpad_1_1ExceptionPorts_1_1ExceptionHandler.html"title="Information about a registered exception handler. ">ExceptionHandler</a>></code>, providing proper cleanup of the send rights contained in each element’s <aclass="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>. <ahref="classcrashpad_1_1ExceptionPorts_1_1ExceptionHandlerVector.html#details">More...</a><br/></td></tr>
<trclass="memitem:af3bb7100d4bf2e8ead5115e187434fb0"><tdclass="memItemLeft"align="right"valign="top">enum  </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="classcrashpad_1_1ExceptionPorts.html#af3bb7100d4bf2e8ead5115e187434fb0">TargetType</a><trclass="memdesc:af3bb7100d4bf2e8ead5115e187434fb0"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Various entities which can have their own exception ports set. <ahref="classcrashpad_1_1ExceptionPorts.html#af3bb7100d4bf2e8ead5115e187434fb0">More...</a><br/></td></tr>
<trclass="memdesc:ae4f91b18d0e8b766acd2077103b1b091"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Constructs an interface object to get or set exception ports on a host, task, or thread port. <ahref="#ae4f91b18d0e8b766acd2077103b1b091">More...</a><br/></td></tr>
<trclass="memdesc:a55ae807d8ed9e37dec1560043ad3ba63"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Calls <code>*_get_exception_ports()</code> on the target. <ahref="#a55ae807d8ed9e37dec1560043ad3ba63">More...</a><br/></td></tr>
<trclass="memdesc:ae95003b8bb2c9549f35811d6ef20f24b"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Calls <code>*_set_exception_ports()</code> on the target. <ahref="#ae95003b8bb2c9549f35811d6ef20f24b">More...</a><br/></td></tr>
<trclass="memdesc:a17c5eab2e49a44acb936ecb3a1a9f61c"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns a string identifying the target type. <ahref="#a17c5eab2e49a44acb936ecb3a1a9f61c">More...</a><br/></td></tr>
<divclass="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>
<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>
<dlclass="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>
<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>
<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>
<h2class="groupheader">Constructor & Destructor Documentation</h2>
<p>Constructs an interface object to get or set exception ports on a host, task, or thread port. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">target_type</td><td>The type of target on which the exception ports are to be get or set: <aclass="el"href="classcrashpad_1_1ExceptionPorts.html#af3bb7100d4bf2e8ead5115e187434fb0a1fbac1b7493bb39014e3e230710ca8d6"title="The host exception target. ">kTargetTypeHost</a>, <aclass="el"href="classcrashpad_1_1ExceptionPorts.html#af3bb7100d4bf2e8ead5115e187434fb0a09b11dc4afd9c15e3c5aea28a4277837"title="A task exception target. ">kTargetTypeTask</a>, or or <aclass="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><tdclass="paramdir">[in]</td><tdclass="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 <aclass="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>
<h2class="groupheader">Member Function Documentation</h2>
<p>Calls <code>*_get_exception_ports()</code> on the target. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[in]</td><tdclass="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><tdclass="paramdir">[out]</td><tdclass="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>
<dlclass="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>
<p>Calls <code>*_set_exception_ports()</code> on the target. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[in]</td><tdclass="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><tdclass="paramdir">[in]</td><tdclass="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><tdclass="paramdir">[in]</td><tdclass="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><tdclass="paramdir">[in]</td><tdclass="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>
<dlclass="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>