Spec-Zone.ru › Haskell 9

GHC.ExecutionStack

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

Description

This is a module for efficient stack traces. This stack trace implementation is considered low overhead. Basic usage looks like this:

import GHC.ExecutionStack

myFunction :: IO ()
myFunction = do
     putStrLn =<< showStackTrace

Your GHC must have been built with libdw support for this to work.

user@host:~$ ghc --info | grep libdw
 ,("RTS expects libdw",YES)

Since: base-4.9.0.0

data Location Source

Location information about an address from a backtrace.

Constructors

Location

Fields

  • objectName :: String
  • functionName :: String
  • srcLoc :: Maybe SrcLoc

data SrcLoc Source

A location in the original program source.

Constructors

SrcLoc

Fields

  • sourceFile :: String
  • sourceLine :: Int
  • sourceColumn :: Int

getStackTrace :: IO (Maybe [Location]) Source

Get a trace of the current execution stack state.

Returns Nothing if stack trace support isn't available on host machine.

showStackTrace :: IO (Maybe String) Source

Get a string representation of the current execution stack state.

© The University of Glasgow and others
Licensed under a BSD-style license (see top of the page).
https://downloads.haskell.org/~ghc/9.14.1/docs/libraries/base-4.22.0.0-66f8/GHC-ExecutionStack.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API