-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Write your GDB scripts in Haskell. -- -- Please see the README on GitHub at -- https://github.com/luc-tielen/debugger-hs#readme @package debugger-hs @version 0.1.1.0 module Debugger.Statement type Line = Int -- | A place to set a breakpoint at. data Location Function :: Text -> Location File :: FilePath -> Line -> Location type Var = Text type Expr = Text type ShellCommand = Text -- | Datatype representing a ID of a breakpoint. newtype Id Id :: Text -> Id -- | Helper datatype for a selection of 1 or more (breakpoints) data Selection Single :: Id -> Selection Many :: [Id] -> Selection All :: Selection type Port = Int -- | Datatype for configuring the GDB target. data TargetConfig Remote :: Port -> TargetConfig -- | Enumeration of all things info can be requested about. data InfoOptions Breakpoints :: InfoOptions -- | Main AST data type used to build a script with. data Statement Break :: Location -> Statement Command :: Id -> [Statement] -> Statement Continue :: Statement Step :: Maybe Int -> Statement Next :: Maybe Int -> Statement Run :: Statement Reset :: Statement Delete :: Selection -> Statement Enable :: Selection -> Statement Disable :: Selection -> Statement Shell :: ShellCommand -> Statement Source :: FilePath -> Statement Print :: Expr -> Statement Set :: Var -> Expr -> Statement Call :: Expr -> Statement Target :: TargetConfig -> Statement Info :: InfoOptions -> Statement -- | A script is a collection of statements. type Script = [Statement] instance GHC.Show.Show Debugger.Statement.Id instance GHC.Classes.Eq Debugger.Statement.Id instance GHC.Show.Show Debugger.Statement.Selection instance GHC.Classes.Eq Debugger.Statement.Selection instance GHC.Show.Show Debugger.Statement.TargetConfig instance GHC.Classes.Eq Debugger.Statement.TargetConfig instance GHC.Show.Show Debugger.Statement.InfoOptions instance GHC.Classes.Eq Debugger.Statement.InfoOptions instance GHC.Show.Show Debugger.Statement.Location instance GHC.Classes.Eq Debugger.Statement.Location instance GHC.Show.Show Debugger.Statement.Statement instance GHC.Classes.Eq Debugger.Statement.Statement module Debugger.Render -- | Renders a GDB script and writes it to stdout. renderToStdOut :: Script -> IO () -- | Renders a GDB script and writes it to the given file path. renderIO :: Script -> FilePath -> IO () -- | Renders a GDB script renderScript :: Script -> Text module Debugger.Builder -- | Builder pattern that allows using monadic do-syntax to build a GDB -- script. data Builder a -- | Helper typeclass, used for manipulating 1, many, or all Ids. class ToSelection a toSelection :: ToSelection a => a -> Selection -- | Creates a GDB script based on a builder. runBuilder :: Builder a -> Script -- | Emits a breakpoint statement. Returns the Id that corresponds -- with this newly set breakpoint. break :: Location -> Builder Id -- | Emits a command statement, that should be triggered when a breakpoint -- is triggered. command :: Id -> Builder () -> Builder () -- | Emits a continue statement. continue :: Builder () -- | Emits a step statement. If you want to step N times, use stepN. step :: Builder () -- | Emits a step statement that is repeated N times. stepN :: Int -> Builder () -- | Emits a "next" statement. If you want to repeat next N times, use -- nextN. next :: Builder () -- | Emits a "next" statement that is repeated N times. nextN :: Int -> Builder () -- | Emits a run statement. run :: Builder () -- | Emits a reset statement. reset :: Builder () -- | Emits a print statement. print :: Expr -> Builder () -- | Emits a set statement. set :: Var -> Expr -> Builder () -- | Emits a call statement. call :: Expr -> Builder () -- | Emits a delete statement. delete :: ToSelection a => a -> Builder () -- | Emits a disable statement. disable :: ToSelection a => a -> Builder () -- | Emits an enable statement. enable :: ToSelection a => a -> Builder () -- | Emits a source statement. source :: FilePath -> Builder () -- | Emits a shell statement. shell :: ShellCommand -> Builder () -- | Emits a target statement. target :: TargetConfig -> Builder () -- | Emits an info statement. info :: InfoOptions -> Builder () instance Control.Monad.State.Class.MonadState Debugger.Builder.BuilderState Debugger.Builder.Builder instance GHC.Base.Monad Debugger.Builder.Builder instance GHC.Base.Applicative Debugger.Builder.Builder instance GHC.Base.Functor Debugger.Builder.Builder instance Debugger.Builder.ToSelection Debugger.Statement.Id instance Debugger.Builder.ToSelection [Debugger.Statement.Id] instance Debugger.Builder.ToSelection Debugger.Statement.Selection