| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Debug.DebugTrace
Description
Module for recording and manipulating debug traces. For most users, the
TemplateHaskell helpers in Debug should be sufficient.
Synopsis
- data DebugTrace = DebugTrace {}
- data Function = Function {}
- data CallData = CallData {
- callFunctionId :: Int
- callVals :: [(Text, Int)]
- callDepends :: [Int]
- callParents :: [Int]
- debugPrintTrace :: DebugTrace -> IO ()
- debugJSONTrace :: DebugTrace -> ByteString
- debugViewTrace :: DebugTrace -> IO ()
- debugSaveTrace :: FilePath -> DebugTrace -> IO ()
- getTraceVars :: DebugTrace -> [(Function, [(Text, Text)])]
Debug traces
data DebugTrace #
A flat encoding of debugging observations.
Constructors
| DebugTrace | |
Instances
Metadata about a function, used to drive the HTML view.
Constructors
| Function | |
Instances
| Eq Function # | |
| Ord Function # | |
Defined in Debug.DebugTrace | |
| Show Function # | |
| Generic Function # | |
| Hashable Function # | |
Defined in Debug.DebugTrace | |
| ToJSON Function # | |
Defined in Debug.DebugTrace | |
| FromJSON Function # | |
| NFData Function # | |
Defined in Debug.DebugTrace | |
| type Rep Function # | |
Defined in Debug.DebugTrace type Rep Function = D1 (MetaData "Function" "Debug.DebugTrace" "debug-0.1.1-K3UyNTV9oWqLiWJUdJ5HEC" False) (C1 (MetaCons "Function" PrefixI True) ((S1 (MetaSel (Just "funName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text) :*: S1 (MetaSel (Just "funSource") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)) :*: (S1 (MetaSel (Just "funArguments") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Text]) :*: S1 (MetaSel (Just "funResult") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)))) | |
A flat encoding of an observed call.
Constructors
| CallData | |
Fields
| |
Instances
| Eq CallData # | |
| Show CallData # | |
| Generic CallData # | |
| ToJSON CallData # | |
Defined in Debug.DebugTrace | |
| FromJSON CallData # | |
| NFData CallData # | |
Defined in Debug.DebugTrace | |
| type Rep CallData # | |
Defined in Debug.DebugTrace type Rep CallData = D1 (MetaData "CallData" "Debug.DebugTrace" "debug-0.1.1-K3UyNTV9oWqLiWJUdJ5HEC" False) (C1 (MetaCons "CallData" PrefixI True) ((S1 (MetaSel (Just "callFunctionId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int) :*: S1 (MetaSel (Just "callVals") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(Text, Int)])) :*: (S1 (MetaSel (Just "callDepends") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Int]) :*: S1 (MetaSel (Just "callParents") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Int])))) | |
Viewing the trace
debugPrintTrace :: DebugTrace -> IO () #
Print information about the observed function calls to stdout,
in a human-readable format.
debugJSONTrace :: DebugTrace -> ByteString #
Obtain information about observed functions in JSON format. The JSON format is not considered a stable part of the interface, more presented as a back door to allow exploration of alternative views.
debugViewTrace :: DebugTrace -> IO () #
Open a web browser showing information about observed functions.
debugSaveTrace :: FilePath -> DebugTrace -> IO () #
Save information about observed functions to the specified file, in HTML format.
getTraceVars :: DebugTrace -> [(Function, [(Text, Text)])] #
Along with the function metatdata, get a list of the variable names and string values from the trace