moonpool/dev/ocaml/Stdlib/Printexc/Slot/index.html
2023-08-28 17:11:38 +00:00

2 lines
No EOL
4.6 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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> &#x00BB; <a href="../../index.html">Stdlib</a> &#x00BB; <a href="../index.html">Printexc</a> &#x00BB; 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">&#45;&gt;</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">&#45;&gt;</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">&#45;&gt;</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">&#45;&gt;</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">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</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>