Safe Haskell | None |
---|---|
Language | Haskell2010 |
GHC.Internal.Stack.Decode
Synopsis
- decode :: StackSnapshot -> IO [StackEntry]
- decodeStack :: StackSnapshot -> IO StgStackClosure
- decodeStackWithIpe :: StackSnapshot -> IO [(StackFrame, Maybe InfoProv)]
- decodeStackWithFrameUnpack :: (StackFrameLocation -> IO a) -> StackSnapshot -> IO (StgInfoTable, [a])
- data StackEntry = StackEntry {}
- prettyStackEntry :: StackEntry -> String
High-level stack decoders
decode :: StackSnapshot -> IO [StackEntry] Source #
Decode a StackSnapshot
to a stacktrace (a list of StackEntry
).
The stack trace is created from return frames with according InfoProvEnt
entries. To generate them, use the GHC flag -finfo-table-map
. If there are
no InfoProvEnt
entries, an empty list is returned.
Please note:
- To gather
StackEntry
from libraries, these have to be compiled with-finfo-table-map
, too. - Due to optimizations by GHC (e.g. inlining) the stacktrace may change with different GHC parameters and versions.
- The stack trace is empty (by design) if there are no return frames on
the stack. (These are pushed every time when a
case ... of
scrutinee is evaluated.)
Since: base-4.17.0.0
decodeStack :: StackSnapshot -> IO StgStackClosure Source #
Decode StackSnapshot
to a StgStackClosure
The return value is the representation of the StgStack
itself.
See Note [Decoding the stack].
decodeStackWithIpe :: StackSnapshot -> IO [(StackFrame, Maybe InfoProv)] Source #
Stack decoder helpers
decodeStackWithFrameUnpack :: (StackFrameLocation -> IO a) -> StackSnapshot -> IO (StgInfoTable, [a]) Source #
StackEntry
data StackEntry Source #
Representation for the source location where a return frame was pushed on the stack.
This happens every time when a case ... of
scrutinee is evaluated.
Constructors
StackEntry | |
Fields
|
Instances
Eq StackEntry Source # | |
Defined in GHC.Internal.Stack.Decode Methods (==) :: StackEntry -> StackEntry -> Bool Source # (/=) :: StackEntry -> StackEntry -> Bool Source # | |
Show StackEntry Source # | |
Defined in GHC.Internal.Stack.Decode |
Pretty printing
prettyStackEntry :: StackEntry -> String Source #