mirror of
https://github.com/c-cube/moonpool.git
synced 2025-12-17 08:06:43 -05:00
2 lines
No EOL
4.6 KiB
HTML
2 lines
No EOL
4.6 KiB
HTML
<!DOCTYPE html>
|
||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Slot (ocaml.Stdlib.Printexc.Slot)</title><link rel="stylesheet" href="../../../../_odoc-theme/odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> – <a href="../../../index.html">ocaml</a> » <a href="../../index.html">Stdlib</a> » <a href="../index.html">Printexc</a> » Slot</nav><header class="odoc-preamble"><h1>Module <code><span>Printexc.Slot</span></code></h1><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 4.02.0</li></ul></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-t"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span><span> = <a href="../index.html#type-backtrace_slot">backtrace_slot</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-is_raise"><a href="#val-is_raise" class="anchor"></a><code><span><span class="keyword">val</span> is_raise : <span><a href="#type-t">t</a> <span class="arrow">-></span></span> bool</span></code></div><div class="spec-doc"><p><code>is_raise slot</code> is <code>true</code> when <code>slot</code> refers to a raising point in the code, and <code>false</code> when it comes from a simple function call.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 4.02</li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-is_inline"><a href="#val-is_inline" class="anchor"></a><code><span><span class="keyword">val</span> is_inline : <span><a href="#type-t">t</a> <span class="arrow">-></span></span> bool</span></code></div><div class="spec-doc"><p><code>is_inline slot</code> is <code>true</code> when <code>slot</code> refers to a call that got inlined by the compiler, and <code>false</code> when it comes from any other context.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 4.04.0</li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-location"><a href="#val-location" class="anchor"></a><code><span><span class="keyword">val</span> location : <span><a href="#type-t">t</a> <span class="arrow">-></span></span> <span><a href="../index.html#type-location">location</a> option</span></span></code></div><div class="spec-doc"><p><code>location slot</code> returns the location information of the slot, if available, and <code>None</code> otherwise.</p><p>Some possible reasons for failing to return a location are as follow:</p><ul><li>the slot corresponds to a compiler-inserted raise</li><li>the slot corresponds to a part of the program that has not been compiled with debug information (<code>-g</code>)</li></ul><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 4.02</li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-name"><a href="#val-name" class="anchor"></a><code><span><span class="keyword">val</span> name : <span><a href="#type-t">t</a> <span class="arrow">-></span></span> <span>string option</span></span></code></div><div class="spec-doc"><p><code>name slot</code> returns the name of the function or definition enclosing the location referred to by the slot.</p><p><code>name slot</code> returns None if the name is unavailable, which may happen for the same reasons as <code>location</code> returning None.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 4.11</li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-format"><a href="#val-format" class="anchor"></a><code><span><span class="keyword">val</span> format : <span>int <span class="arrow">-></span></span> <span><a href="#type-t">t</a> <span class="arrow">-></span></span> <span>string option</span></span></code></div><div class="spec-doc"><p><code>format pos slot</code> returns the string representation of <code>slot</code> as <code>raw_backtrace_to_string</code> would format it, assuming it is the <code>pos</code>-th element of the backtrace: the <code>0</code>-th element is pretty-printed differently than the others.</p><p>Whole-backtrace printing functions also skip some uninformative slots; in that case, <code>format pos slot</code> returns <code>None</code>.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 4.02</li></ul></div></div></div></body></html> |