package base

  1. Overview
  2. Docs
Full standard library replacement for OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

base-v0.14.0.tar.gz
sha256=e89c4b898d9e93527f1c84f6784f9a92a1dfa86877f39ac4450a6cb69e866de6
md5=5a00382c724e97b6768aaa27481dd3cc

doc/base/Base/Backtrace/index.html

Module Base.Backtrace

Module for managing stack backtraces.

The Backtrace module deals with two different kinds of backtraces:

  1. Snapshots of the stack obtained on demand (Backtrace.get)
  2. The stack frames unwound when an exception is raised (Backtrace.Exn)
type t

A Backtrace.t is a snapshot of the stack obtained by calling Backtrace.get. It is represented as a string with newlines separating the frames. sexp_of_t splits the string at newlines and removes some of the cruft, leaving a human-friendly list of frames, but to_string does not.

val sexp_of_t : t -> Sexp.t
val get : ?at_most_num_frames:int -> unit -> t
val to_string : t -> string
val to_string_list : t -> string list
val elide : bool Caml.ref

The value of elide controls the behavior of backtrace serialization functions such as to_string, to_string_list, and sexp_of_t. When set to false, these functions behave as expected, returning a faithful representation of their argument. When set to true, these functions will ignore their argument and return a message indicating that behavior.

The default value is am_testing.

module Exn : sig ... end

Backtrace.Exn has functions for controlling and printing the backtrace of the most recently raised exception.

val initialize_module : unit -> unit

User code never calls this. It is called only in std_kernel.ml, as a top-level side effect, to initialize am_recording () as specified above.

OCaml

Innovation. Community. Security.