Safe Haskell | None |
---|---|
Language | Haskell2010 |
GHC.Debugger
Synopsis
- execute :: Command -> Debugger Response
- clearBreakpoints :: Maybe FilePath -> Debugger ()
- getBreakpointsAt :: ModSummary -> Int -> Maybe Int -> Debugger (Maybe (BreakIndex, RealSrcSpan))
- setBreakpoint :: Breakpoint -> BreakpointStatus -> Debugger BreakFound
- debugExecution :: EntryPoint -> [String] -> Debugger EvalResult
- doContinue :: Debugger EvalResult
- doSingleStep :: Debugger EvalResult
- doLocalStep :: Debugger EvalResult
- doEval :: String -> Debugger EvalResult
- handleExecResult :: ExecResult -> Debugger EvalResult
- getStacktrace :: Debugger [StackFrame]
- getScopes :: Debugger [ScopeInfo]
- getVariables :: VariableReference -> Debugger (Either VarInfo [VarInfo])
- defaultDepth :: Int
- getTopEnv :: Module -> Debugger TypeEnv
- getTopImported :: Module -> Debugger GlobalRdrEnv
- inspectName :: Name -> Debugger (Maybe VarInfo)
- tyThingToVarInfo :: Int -> TyThing -> Debugger VarInfo
- termToVarInfo :: Name -> Term -> Debugger VarInfo
- isBoringTy :: Type -> Bool
- leaveSuspendedState :: Debugger ()
- realSrcSpanToSourceSpan :: RealSrcSpan -> SourceSpan
- display :: Outputable a => a -> Debugger String
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.
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
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).
handleExecResult :: ExecResult -> Debugger EvalResult Source #
Turn a GHC's ExecResult
into an EvalResult
response
Stack trace
getStacktrace :: Debugger [StackFrame] Source #
Get the stack frames at the point we're stopped at
Scopes
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]
defaultDepth :: Int Source #
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
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,
is reset.varReferences
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