debug-0.1.1: Simple trace-based debugger

Safe HaskellNone
LanguageHaskell2010

Debug.DebugTrace

Contents

Description

Module for recording and manipulating debug traces. For most users, the TemplateHaskell helpers in Debug should be sufficient.

Synopsis

Debug traces

data DebugTrace #

A flat encoding of debugging observations.

Constructors

DebugTrace 

Fields

Instances
Eq DebugTrace # 
Instance details

Defined in Debug.DebugTrace

Show DebugTrace # 
Instance details

Defined in Debug.DebugTrace

Generic DebugTrace # 
Instance details

Defined in Debug.DebugTrace

Associated Types

type Rep DebugTrace :: * -> * #

ToJSON DebugTrace # 
Instance details

Defined in Debug.DebugTrace

FromJSON DebugTrace # 
Instance details

Defined in Debug.DebugTrace

NFData DebugTrace # 
Instance details

Defined in Debug.DebugTrace

Methods

rnf :: DebugTrace -> () #

type Rep DebugTrace # 
Instance details

Defined in Debug.DebugTrace

type Rep DebugTrace = D1 (MetaData "DebugTrace" "Debug.DebugTrace" "debug-0.1.1-K3UyNTV9oWqLiWJUdJ5HEC" False) (C1 (MetaCons "DebugTrace" PrefixI True) (S1 (MetaSel (Just "functions") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Function]) :*: (S1 (MetaSel (Just "variables") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Text]) :*: S1 (MetaSel (Just "calls") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [CallData]))))

data Function #

Metadata about a function, used to drive the HTML view.

Constructors

Function 

Fields

Instances
Eq Function # 
Instance details

Defined in Debug.DebugTrace

Ord Function # 
Instance details

Defined in Debug.DebugTrace

Show Function # 
Instance details

Defined in Debug.DebugTrace

Generic Function # 
Instance details

Defined in Debug.DebugTrace

Associated Types

type Rep Function :: * -> * #

Methods

from :: Function -> Rep Function x #

to :: Rep Function x -> Function #

Hashable Function # 
Instance details

Defined in Debug.DebugTrace

Methods

hashWithSalt :: Int -> Function -> Int #

hash :: Function -> Int #

ToJSON Function # 
Instance details

Defined in Debug.DebugTrace

FromJSON Function # 
Instance details

Defined in Debug.DebugTrace

NFData Function # 
Instance details

Defined in Debug.DebugTrace

Methods

rnf :: Function -> () #

type Rep Function # 
Instance details

Defined in Debug.DebugTrace

data CallData #

A flat encoding of an observed call.

Constructors

CallData 

Fields

Instances
Eq CallData # 
Instance details

Defined in Debug.DebugTrace

Show CallData # 
Instance details

Defined in Debug.DebugTrace

Generic CallData # 
Instance details

Defined in Debug.DebugTrace

Associated Types

type Rep CallData :: * -> * #

Methods

from :: CallData -> Rep CallData x #

to :: Rep CallData x -> CallData #

ToJSON CallData # 
Instance details

Defined in Debug.DebugTrace

FromJSON CallData # 
Instance details

Defined in Debug.DebugTrace

NFData CallData # 
Instance details

Defined in Debug.DebugTrace

Methods

rnf :: CallData -> () #

type Rep CallData # 
Instance details

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

Orphan instances

Show a #

An orphan instance of Show that maps anything without a Show instance to ?. Suitable for use only when debugging.

Instance details

Methods

showsPrec :: Int -> a -> ShowS #

show :: a -> String #

showList :: [a] -> ShowS #