ghc-debugger
Safe HaskellNone
LanguageHaskell2010

GHC.Debugger

Synopsis

Executing commands

execute :: Command -> Debugger Response Source #

Execute the given debugger command in the current Debugger session

Breakpoints

clearBreakpoints :: Maybe FilePath -> Debugger () Source #

Remove all module breakpoints set on the given loaded module by path

If the argument is Nothing, clear all function breakpoints instead.

getBreakpointsAt Source #

Arguments

:: ModSummary

module

-> Int

line num

-> Maybe Int

column num

-> Debugger (Maybe (BreakIndex, RealSrcSpan)) 

Find a BreakpointId and its span from a module + line + column.

Used by setBreakpoints and GetBreakpointsAt requests

setBreakpoint :: Breakpoint -> BreakpointStatus -> Debugger BreakFound Source #

Set a breakpoint in this session

Evaluation

debugExecution Source #

Arguments

:: EntryPoint 
-> [String]

Args

-> Debugger EvalResult 

Run a program with debugging enabled

doContinue :: Debugger EvalResult Source #

Resume execution of the stopped debuggee program

doSingleStep :: Debugger EvalResult Source #

Resume execution but only take a single step.

doLocalStep :: Debugger EvalResult Source #

Resume execution but stop at the next tick within the same function.

To do a local step, we get the SrcSpan of the current suspension state and get its enclosingTickSpan to use as a filter for breakpoints in the call to resumeExec. Execution will only stop at breakpoints whose span matches this enclosing span.

doEval :: String -> Debugger EvalResult Source #

Evaluate expression. Includes context of breakpoint if stopped at one (the current interactive context).

Stack trace

getStacktrace :: Debugger [StackFrame] Source #

Get the stack frames at the point we're stopped at

Scopes

getScopes :: Debugger [ScopeInfo] Source #

Get the stack frames at the point we're stopped at

Variables

getVariables :: VariableReference -> Debugger (Either VarInfo [VarInfo]) Source #

Get variables using a variable/variables reference

If the Variable Request ends up being case (VARR)(b), then we signal the request forced the variable and return Left varInfo. Otherwise, Right vis.

See Note [Variables Requests]

GHC Utilities

getTopEnv :: Module -> Debugger TypeEnv Source #

All top-level things from a module, including unexported ones.

getTopImported :: Module -> Debugger GlobalRdrEnv Source #

All bindings imported at a given module

inspectName :: Name -> Debugger (Maybe VarInfo) Source #

Get the value and type of a given Name as rendered strings in VarInfo.

tyThingToVarInfo Source #

Arguments

:: Int

Depth

-> TyThing 
-> Debugger VarInfo 

TyThing to VarInfo. The Bool argument indicates whether to force the value of the thing (as in True = :force, False = :print)

termToVarInfo :: Name -> Term -> Debugger VarInfo Source #

Construct a VarInfo from the given Name of the variable and the Term it binds

isBoringTy :: Type -> Bool Source #

A boring type is one for which we don't care about the structure and would rather see "whole" when being inspected. Strings and literals are a good example, because it's more useful to see the string value than it is to see a linked list of characters where each has to be forced individually.

leaveSuspendedState :: Debugger () Source #

Whenever we run a request that continues execution from the current suspended state, such as Next,Step,Continue, this function should be called to delete the variable references that become invalid as we leave the suspended state.

In particular, varReferences is reset.

See also section "Lifetime of Objects References" in the DAP specification.

realSrcSpanToSourceSpan :: RealSrcSpan -> SourceSpan Source #

Convert a GHC's src span into an interface one

General utilities

display :: Outputable a => a -> Debugger String Source #

Display an Outputable value as a String