package ocaml-base-compiler

  1. Overview
  2. Docs
Official 4.06.0 release

Install

Dune Dependency

Authors

Maintainers

Sources

4.06.0.tar.gz
sha256=011879c913e8f988ecdac020b205e2baa4023052efed25013bdb9a6b0d5c6a80
md5=4f3906e581181c5435078ffe3e485e3f

doc/stdlib/Printexc/Slot/index.html

Module Printexc.Slot

  • since 4.02.0
val is_raise : t -> bool

is_raise slot is true when slot refers to a raising point in the code, and false when it comes from a simple function call.

  • since 4.02
val is_inline : t -> bool

is_inline slot is true when slot refers to a call that got inlined by the compiler, and false when it comes from any other context.

  • since 4.04.0
val location : t -> location option

location slot returns the location information of the slot, if available, and None otherwise.

Some possible reasons for failing to return a location are as follow:

  • the slot corresponds to a compiler-inserted raise
  • the slot corresponds to a part of the program that has not been compiled with debug information (-g)
  • since 4.02
val format : int -> t -> string option

format pos slot returns the string representation of slot as raw_backtrace_to_string would format it, assuming it is the pos-th element of the backtrace: the 0-th element is pretty-printed differently than the others.

Whole-backtrace printing functions also skip some uninformative slots; in that case, format pos slot returns None.

  • since 4.02
OCaml

Innovation. Community. Security.