GHC.Internal.ExecutionStack.Internal

ghc-internal-9.1001.0: Basic libraries

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

GHC.Internal.ExecutionStack.Internal

Contents

- Internal

Description

Internals of the GHC.ExecutionStack module.

The API of this module is unstable and not meant to be consumed by the general public. If you absolutely must depend on it, make sure to use a tight upper bound, e.g., `base < 4.X` rather than `base < 5`, because the interface can change rapidly without much warning.

@since base-4.9.0.0

Synopsis

- data Location = Location {
  - objectName :: String
  - functionName :: String
  - srcLoc :: Maybe SrcLoc
  }
- showLocation :: Location -> ShowS
- data SrcLoc = SrcLoc {
  - sourceFile :: String
  - sourceLine :: Int
  - sourceColumn :: Int
  }
- data StackTrace
- stackFrames :: StackTrace -> Maybe [Location]
- stackDepth :: StackTrace -> Int
- collectStackTrace :: IO (Maybe StackTrace)
- showStackFrames :: [Location] -> ShowS
- invalidateDebugCache :: IO ()

# Internal

data Location Source #

Location information about an address from a backtrace.

Constructors

Location |
Fields objectName :: String functionName :: String srcLoc :: Maybe SrcLoc

showLocation :: Location -> ShowS Source #

Render a `Location` as a string

data SrcLoc Source #

A location in the original program source.

Constructors

SrcLoc |
Fields sourceFile :: String sourceLine :: Int sourceColumn :: Int

data StackTrace Source #

The state of the execution stack

stackFrames :: StackTrace -> Maybe [Location] Source #

List the frames of a stack trace.

stackDepth :: StackTrace -> Int Source #

How many stack frames in the given `StackTrace`

collectStackTrace :: IO (Maybe StackTrace) Source #

Get an execution stack.

showStackFrames :: [Location] -> ShowS Source #

Render a stacktrace as a string

invalidateDebugCache :: IO () Source #

Free the cached debug data.