| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
GHC.Debugger.Runtime.Eval
Description
Higher-level interface to evaluating things in the (possibly remote) debuggee process
Synopsis
- evalExpr :: EvalExpr ForeignHValue -> Debugger (Either BadEvalStatus [ForeignHValue])
- evalString :: ForeignRef (IO String) -> Debugger String
- handleSingStatus :: Either BadEvalStatus [ForeignHValue] -> Either BadEvalStatus ForeignHValue
- data BadEvalStatus
- data EvalExpr a
Raw evaluation
evalExpr :: EvalExpr ForeignHValue -> Debugger (Either BadEvalStatus [ForeignHValue]) Source #
Evaluate a raw EvalExpr which represents a debuggee expression of type IO [a]
evalString :: ForeignRef (IO String) -> Debugger String Source #
Evaluate a foreign value of type IO String to a String
Error handling
handleSingStatus :: Either BadEvalStatus [ForeignHValue] -> Either BadEvalStatus ForeignHValue Source #
Handle the EvalStatus_ of an evaluation using EvalStepNone which returns a single value
data BadEvalStatus Source #
Constructors
| EvalRaisedException SomeException | |
| EvalHitUnexpectedBreakpoint | |
| EvalReturnedNoResults | |
| EvalReturnedTooManyResults |
Instances
| Exception BadEvalStatus Source # | |
Defined in GHC.Debugger.Runtime.Eval Methods toException :: BadEvalStatus -> SomeException # fromException :: SomeException -> Maybe BadEvalStatus # displayException :: BadEvalStatus -> String # backtraceDesired :: BadEvalStatus -> Bool # | |
| Show BadEvalStatus Source # | |
Defined in GHC.Debugger.Runtime.Eval Methods showsPrec :: Int -> BadEvalStatus -> ShowS # show :: BadEvalStatus -> String # showList :: [BadEvalStatus] -> ShowS # | |
Re-exports
We can pass simple expressions to EvalStmt, consisting of values and application. This allows us to wrap the statement to be executed in another function, which is used by GHCi to implement :set args and :set prog. It might be worthwhile to extend this little language in the future.