base-4.20.2.0: Core data structures and operations

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

GHC.InfoProv

Contents

- Internals

Description

Access to GHC's info-table provenance metadata.

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.18.0.0

Synopsis

- data InfoProv = InfoProv {
  - ipName :: String
  - ipDesc :: ClosureType
  - ipTyDesc :: String
  - ipLabel :: String
  - ipUnitId :: String
  - ipMod :: String
  - ipSrcFile :: String
  - ipSrcSpan :: String
  }
- ipLoc :: InfoProv -> String
- ipeProv :: Ptr InfoProvEnt -> Ptr InfoProv
- whereFrom :: a -> IO (Maybe InfoProv)
- data InfoProvEnt
- peekInfoProv :: Ptr InfoProv -> IO InfoProv

# Documentation

data InfoProv Source #

Constructors

InfoProv |

Fields

- ipName :: String
- ipDesc :: ClosureType
- ipTyDesc :: String
- ipLabel :: String
- ipUnitId :: String

  Since: base-4.20.0.0

- ipMod :: String
- ipSrcFile :: String
- ipSrcSpan :: String

#### Instances

Instances details

Show InfoProv |
Instance details Defined in GHC.Internal.InfoProv.Types Methods showsPrec :: Int -> InfoProv -> ShowS Source # show :: InfoProv -> String Source # showList :: [InfoProv] -> ShowS Source #
Eq InfoProv |
Instance details Defined in GHC.Internal.InfoProv.Types Methods (==) :: InfoProv -> InfoProv -> Bool Source # (/=) :: InfoProv -> InfoProv -> Bool Source #

ipLoc :: InfoProv -> String Source #

ipeProv :: Ptr InfoProvEnt -> Ptr InfoProv Source #

whereFrom :: a -> IO (Maybe InfoProv) Source #

Get information about where a value originated from. This information is stored statically in a binary when `-finfo-table-map` is enabled. The source positions will be greatly improved by also enabled debug information with `-g3`. Finally you can enable `-fdistinct-constructor-tables` to get more precise information about data constructor allocations.

The information is collect by looking at the info table address of a specific closure and then consulting a specially generated map (by `-finfo-table-map`) to find out where we think the best source position to describe that info table arose from.

Since: base-4.16.0.0

# Internals

data InfoProvEnt Source #

peekInfoProv :: Ptr InfoProv -> IO InfoProv Source #