Control.Exception.Backtrace

base-4.20.0.0: Core data structures and operations

Copyright | (c) The University of Glasgow 1994-2023
License | see libraries/base/LICENSE
Maintainer | ghc-devs@haskell.org
Stability | internal
Portability | non-portable (GHC Extensions)
Safe Haskell | None
Language | Haskell2010

Control.Exception.Backtrace

Contents

- Backtrace mechanisms
- Collecting backtraces

Description

Mechanisms for collecting diagnostic backtraces and their representation.

Synopsis

- data BacktraceMechanism
  - = CostCentreBacktrace
  - | HasCallStackBacktrace
  - | ExecutionBacktrace
  - | IPEBacktrace
- getBacktraceMechanismState :: BacktraceMechanism -> IO Bool
- setBacktraceMechanismState :: BacktraceMechanism -> Bool -> IO ()
- data Backtraces
- displayBacktraces :: Backtraces -> String
- collectBacktraces :: (?callStack :: CallStack) => IO Backtraces

# Backtrace mechanisms

data BacktraceMechanism Source #

How to collect a backtrace when an exception is thrown.

Constructors

CostCentreBacktrace | collect cost-centre stack backtraces (only available when built with profiling)
HasCallStackBacktrace | collect `HasCallStack` backtraces
ExecutionBacktrace | collect backtraces from native execution stack unwinding
IPEBacktrace | collect backtraces from Info Table Provenance Entries

getBacktraceMechanismState :: BacktraceMechanism -> IO Bool Source #

Will the given `BacktraceMechanism` be used when collecting backtraces?

setBacktraceMechanismState :: BacktraceMechanism -> Bool -> IO () Source #

Set whether the given `BacktraceMechanism` will be used when collecting backtraces?

# Collecting backtraces

data Backtraces Source #

A collection of backtraces.

#### Instances

Instances details

ExceptionAnnotation Backtraces |
Instance details Defined in GHC.Internal.Exception.Backtrace Methods displayExceptionAnnotation :: Backtraces -> String Source #

displayBacktraces :: Backtraces -> String Source #

Render a set of backtraces to a human-readable string.

collectBacktraces :: (?callStack :: CallStack) => IO Backtraces Source #

Collect a set of `Backtraces`.