Copyright | (c) Galois Inc. 2025 |
---|---|
Maintainer | Langston Barrett <langston@galois.com> |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Lang.Crucible.Debug
Description
Synopsis
- debugger :: sym ~ ExprBuilder s st fs => IsSymInterface sym => IsSyntaxExtension ext => IsExpr (SymExpr sym) => (?parserHooks :: ParserHooks ext) => Pretty cExt => CommandExt cExt -> ExtImpl cExt p sym ext t -> IntrinsicPrinters sym -> Inputs (CompletionT cExt (StyleT cExt IO)) (Statement cExt) -> Outputs IO (Response cExt) -> TypeRepr t -> IO (ExecutionFeature p sym ext (RegEntry sym t))
- bareDebuggerExt :: IsSyntaxExtension ext => (?parserHooks :: ParserHooks ext) => Pretty cExt => CommandExt cExt -> (forall p sym t. IsSymInterface sym => ExtImpl cExt p sym ext t) -> (forall p sym. IsSymInterface sym => ExtensionImpl p sym ext) -> Inputs (CompletionT cExt (StyleT cExt IO)) (Statement cExt) -> Outputs IO (Response cExt) -> (Text -> IO ()) -> IO ()
- bareDebugger :: Inputs (CompletionT Void (StyleT Void IO)) (Statement Void) -> Outputs IO (Response Void) -> (Text -> IO ()) -> IO ()
- defaultDebuggerInputs :: MonadIO m => CommandExt cExt -> IO (Inputs (CompletionT cExt (StyleT cExt m)) (Statement cExt))
- defaultDebuggerOutputs :: Pretty cExt => Pretty (ResponseExt cExt) => Outputs IO (Response cExt)
- data Arg cExt i where
- data ArgTypeRepr i where
- TBreakpointRepr :: ArgTypeRepr 'TBreakpoint
- TCommandRepr :: ArgTypeRepr 'TCommand
- TExactlyRepr :: SymbolRepr s -> ArgTypeRepr ('TExactly s)
- TFunctionRepr :: ArgTypeRepr 'TFunction
- TIntRepr :: ArgTypeRepr 'TInt
- TPathRepr :: ArgTypeRepr 'TPath
- TTextRepr :: ArgTypeRepr 'TText
- type Breakpoint = Lit 'TBreakpoint
- type Exactly s = Lit ('TExactly s)
- type Function = Lit 'TFunction
- type Int = Lit 'TInt
- type Path = Lit 'TPath
- type Text = Lit 'TText
- data Command cExt
- data CommandExt cExt = CommandExt {}
- voidExts :: CommandExt Void
- execStateSimState :: ExecState p sym ext r -> Either NotApplicable (SomeSimState p sym ext r)
- data EvalResult cExt p sym ext t = EvalResult {
- evalCtx :: Context cExt p sym ext t
- evalFeatureResult :: ExecutionFeatureResult p sym ext (RegEntry sym t)
- evalResp :: Response cExt
- data Context cExt p sym ext t = Context {
- dbgBreakpoints :: Set Breakpoint
- dbgCommandExt :: CommandExt cExt
- dbgExtImpl :: ExtImpl cExt p sym ext t
- dbgInputs :: Inputs (CompletionT cExt (StyleT cExt IO)) (Statement cExt)
- dbgOutputs :: Outputs IO (Response cExt)
- dbgPpIntrinsic :: IntrinsicPrinters sym
- dbgRetTy :: TypeRepr t
- dbgState :: DebuggerState
- dbgStopOnAbort :: Bool
- dbgTrace :: Trace ext
- data CommandImpl cExt p sym ext t = forall r.CommandImpl {}
- newtype ExtImpl cExt p sym ext t = ExtImpl {
- getExtImpl :: cExt -> CommandImpl cExt p sym ext t
- voidImpl :: ExtImpl Void p sym ext t
- data Response cExt
- = Ok
- | UserError (UserError cExt)
- | XResponse (ResponseExt cExt)
- data UserError cExt = NotApplicable NotApplicable
- data NotApplicable
- type family ResponseExt cExt :: Type
- data Regex a
- type Empty = 'TEmpty
- type Lit = 'TLit
- type (:|) a b = 'TOr a b
- type Then = 'TThen
- type Star = 'TStar
- data Match k r where
- data RegexRepr f r where
- data Trace ext
- data TraceEntry ext = forall blocks init ret.TraceEntry {
- traceCfg :: CFG ext blocks init ret
- traceBlock :: Some (BlockID blocks)
- latest :: Trace ext -> Int -> IO [TraceEntry ext]
- newtype IntrinsicPrinters sym = IntrinsicPrinters {}
Documentation
debugger :: sym ~ ExprBuilder s st fs => IsSymInterface sym => IsSyntaxExtension ext => IsExpr (SymExpr sym) => (?parserHooks :: ParserHooks ext) => Pretty cExt => CommandExt cExt -> ExtImpl cExt p sym ext t -> IntrinsicPrinters sym -> Inputs (CompletionT cExt (StyleT cExt IO)) (Statement cExt) -> Outputs IO (Response cExt) -> TypeRepr t -> IO (ExecutionFeature p sym ext (RegEntry sym t)) Source #
bareDebuggerExt :: IsSyntaxExtension ext => (?parserHooks :: ParserHooks ext) => Pretty cExt => CommandExt cExt -> (forall p sym t. IsSymInterface sym => ExtImpl cExt p sym ext t) -> (forall p sym. IsSymInterface sym => ExtensionImpl p sym ext) -> Inputs (CompletionT cExt (StyleT cExt IO)) (Statement cExt) -> Outputs IO (Response cExt) -> (Text -> IO ()) -> IO () Source #
Like bareDebugger
, but with a syntax extension
bareDebugger :: Inputs (CompletionT Void (StyleT Void IO)) (Statement Void) -> Outputs IO (Response Void) -> (Text -> IO ()) -> IO () Source #
Start a debugger instance in an empty Crucible program.
The Crucible program simply returns the unit value. The idea is to use the
Load
and Call
commands to actually run some Crucible CFG(s).
Proves obligations using Z3.
defaultDebuggerInputs :: MonadIO m => CommandExt cExt -> IO (Inputs (CompletionT cExt (StyleT cExt m)) (Statement cExt)) Source #
defaultDebuggerOutputs :: Pretty cExt => Pretty (ResponseExt cExt) => Outputs IO (Response cExt) Source #
data Arg cExt i where Source #
Constructors
ABreakpoint :: Breakpoint -> Arg cExt 'TBreakpoint | |
ACommand :: Command cExt -> Arg cExt 'TCommand | |
AExactly :: SymbolRepr s -> Arg cExt ('TExactly s) | |
AFunction :: FunctionName -> Arg cExt 'TFunction | |
AInt :: Int -> Arg cExt 'TInt | |
APath :: Text -> Arg cExt 'TPath | |
AText :: Text -> Arg cExt 'TText |
data ArgTypeRepr i where Source #
Value-level representative of ArgType
Constructors
TBreakpointRepr :: ArgTypeRepr 'TBreakpoint | |
TCommandRepr :: ArgTypeRepr 'TCommand | |
TExactlyRepr :: SymbolRepr s -> ArgTypeRepr ('TExactly s) | |
TFunctionRepr :: ArgTypeRepr 'TFunction | |
TIntRepr :: ArgTypeRepr 'TInt | |
TPathRepr :: ArgTypeRepr 'TPath | |
TTextRepr :: ArgTypeRepr 'TText |
Instances
Show (ArgTypeRepr t) Source # | |
Defined in Lang.Crucible.Debug.Arg.Type Methods showsPrec :: Int -> ArgTypeRepr t -> ShowS # show :: ArgTypeRepr t -> String # showList :: [ArgTypeRepr t] -> ShowS # | |
Pretty (ArgTypeRepr t) Source # | |
Defined in Lang.Crucible.Debug.Arg.Type |
type Breakpoint = Lit 'TBreakpoint Source #
data CommandExt cExt Source #
Constructors
CommandExt | |
Fields
|
execStateSimState :: ExecState p sym ext r -> Either NotApplicable (SomeSimState p sym ext r) Source #
data EvalResult cExt p sym ext t Source #
The result of evaluating a Statement
Constructors
EvalResult | |
Fields
|
data Context cExt p sym ext t Source #
Debugger state.
Type parameters:
cExt
is the command extension type, seeCommandExt
p
,sym
,ext
are as inOverrideSim
t
is the Crucible type of theRegValue
returned by the program
cExt
is different from ext
because it's not necessarily true that you
would want the debugger command extensions to be tied in a 1:1 fashion with
the syntax extension (source language).
Constructors
Context | |
Fields
|
data CommandImpl cExt p sym ext t Source #
Constructors
forall r. CommandImpl | |
Fields
|
newtype ExtImpl cExt p sym ext t Source #
Constructors
ExtImpl | |
Fields
|
Constructors
Ok | |
UserError (UserError cExt) | |
XResponse (ResponseExt cExt) |
Instances
(Show (ResponseExt cExt), Show cExt) => Show (Response cExt) Source # | |
(Pretty (ResponseExt cExt), Pretty cExt) => Pretty (Response cExt) Source # | |
Defined in Lang.Crucible.Debug.Response |
The command could not be completed successfully for some reason the user should have anticipated.
Constructors
NotApplicable NotApplicable |
data NotApplicable Source #
The command was not applicable in this state
Constructors
DoneSimulating | |
NotYetSimulating |
Instances
Show NotApplicable Source # | |
Defined in Lang.Crucible.Debug.Response Methods showsPrec :: Int -> NotApplicable -> ShowS # show :: NotApplicable -> String # showList :: [NotApplicable] -> ShowS # | |
Pretty NotApplicable Source # | |
Defined in Lang.Crucible.Debug.Response |
type family ResponseExt cExt :: Type Source #
Instances
type ResponseExt Void Source # | |
Defined in Lang.Crucible.Debug.Response |
Type-level only
Instances
FoldableFC (RegexRepr :: (k -> Type) -> Regex k -> Type) Source # | |
Defined in Lang.Crucible.Debug.Regex Methods foldMapFC :: forall f m. Monoid m => (forall (x :: k0). f x -> m) -> forall (x :: l). RegexRepr f x -> m # foldrFC :: (forall (x :: k0). f x -> b -> b) -> forall (x :: l). b -> RegexRepr f x -> b # foldlFC :: forall f b. (forall (x :: k0). b -> f x -> b) -> forall (x :: l). b -> RegexRepr f x -> b # foldrFC' :: (forall (x :: k0). f x -> b -> b) -> forall (x :: l). b -> RegexRepr f x -> b # foldlFC' :: forall f b. (forall (x :: k0). b -> f x -> b) -> forall (x :: l). b -> RegexRepr f x -> b # toListFC :: (forall (x :: k0). f x -> a) -> forall (x :: l). RegexRepr f x -> [a] # | |
FunctorFC (RegexRepr :: (k -> Type) -> Regex k -> Type) Source # | |
Defined in Lang.Crucible.Debug.Regex | |
TraversableFC (RegexRepr :: (k -> Type) -> Regex k -> Type) Source # | |
Defined in Lang.Crucible.Debug.Regex Methods traverseFC :: forall f g m. Applicative m => (forall (x :: k0). f x -> m (g x)) -> forall (x :: l). RegexRepr f x -> m (RegexRepr g x) # | |
TestEquality f => TestEquality (RegexRepr f :: Regex k -> Type) Source # | |
Defined in Lang.Crucible.Debug.Regex |
The result of match
, in case of success
data RegexRepr f r where Source #
Value-level representative of Regex
The order of the type parameters is a bit arbitrary... This order gives
KnownRepr
and TestEquality
instances but requires flipping the type
parameters to get TraversableF
.
Constructors
Empty :: RegexRepr f 'TEmpty | |
Fail :: RegexRepr f 'TFail | |
Lit :: f t -> RegexRepr f ('TLit t) | |
Or :: RegexRepr f l -> RegexRepr f r -> RegexRepr f ('TOr l r) | |
Star :: RegexRepr f r -> RegexRepr f ('TStar r) | |
Then :: RegexRepr f l -> RegexRepr f r -> RegexRepr f ('TThen l r) |
Instances
FoldableFC (RegexRepr :: (k -> Type) -> Regex k -> Type) Source # | |
Defined in Lang.Crucible.Debug.Regex Methods foldMapFC :: forall f m. Monoid m => (forall (x :: k0). f x -> m) -> forall (x :: l). RegexRepr f x -> m # foldrFC :: (forall (x :: k0). f x -> b -> b) -> forall (x :: l). b -> RegexRepr f x -> b # foldlFC :: forall f b. (forall (x :: k0). b -> f x -> b) -> forall (x :: l). b -> RegexRepr f x -> b # foldrFC' :: (forall (x :: k0). f x -> b -> b) -> forall (x :: l). b -> RegexRepr f x -> b # foldlFC' :: forall f b. (forall (x :: k0). b -> f x -> b) -> forall (x :: l). b -> RegexRepr f x -> b # toListFC :: (forall (x :: k0). f x -> a) -> forall (x :: l). RegexRepr f x -> [a] # | |
FunctorFC (RegexRepr :: (k -> Type) -> Regex k -> Type) Source # | |
Defined in Lang.Crucible.Debug.Regex | |
TraversableFC (RegexRepr :: (k -> Type) -> Regex k -> Type) Source # | |
Defined in Lang.Crucible.Debug.Regex Methods traverseFC :: forall f g m. Applicative m => (forall (x :: k0). f x -> m (g x)) -> forall (x :: l). RegexRepr f x -> m (RegexRepr g x) # | |
TestEquality f => TestEquality (RegexRepr f :: Regex k -> Type) Source # | |
Defined in Lang.Crucible.Debug.Regex |
data TraceEntry ext Source #
Constructors
forall blocks init ret. TraceEntry | |
Fields
|
Instances
PrettyExt ext => Pretty (TraceEntry ext) Source # | |
Defined in Lang.Crucible.Debug.Trace |
newtype IntrinsicPrinters sym Source #
Constructors
IntrinsicPrinters | |
Fields |