summaryrefslogtreecommitdiff
path: root/libraries/ghci/GHCi/Run.hs
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/ghci/GHCi/Run.hs')
-rw-r--r--libraries/ghci/GHCi/Run.hs15
1 files changed, 13 insertions, 2 deletions
diff --git a/libraries/ghci/GHCi/Run.hs b/libraries/ghci/GHCi/Run.hs
index d05877579a..72099b205f 100644
--- a/libraries/ghci/GHCi/Run.hs
+++ b/libraries/ghci/GHCi/Run.hs
@@ -12,6 +12,7 @@ module GHCi.Run
( run, redirectInterrupts
) where
+import Prelude -- See note [Why do we import Prelude here?]
import GHCi.CreateBCO
import GHCi.InfoTable
import GHCi.FFI
@@ -31,8 +32,9 @@ import Data.Binary.Get
import Data.ByteString (ByteString)
import qualified Data.ByteString.Unsafe as B
import GHC.Exts
+import GHC.Exts.Heap
import GHC.Stack
-import Foreign
+import Foreign hiding (void)
import Foreign.C
import GHC.Conc.Sync
import GHC.IO hiding ( bracket )
@@ -86,6 +88,10 @@ run m = case m of
MkConInfoTable ptrs nptrs tag ptrtag desc ->
toRemotePtr <$> mkConInfoTable ptrs nptrs tag ptrtag desc
StartTH -> startTH
+ GetClosure ref -> do
+ clos <- getClosureData =<< localRef ref
+ mapM (\(Box x) -> mkRemoteRef (HValue x)) clos
+ Seq ref -> tryEval (void $ evaluate =<< localRef ref)
_other -> error "GHCi.Run.run"
evalStmt :: EvalOpts -> EvalExpr HValueRef -> IO (EvalStatus [HValueRef])
@@ -298,7 +304,12 @@ setStepFlag = poke stepFlag 1
resetStepFlag :: IO ()
resetStepFlag = poke stepFlag 0
-type BreakpointCallback = Int# -> Int# -> Bool -> HValue -> IO ()
+type BreakpointCallback
+ = Int# -- the breakpoint index
+ -> Int# -- the module uniq
+ -> Bool -- exception?
+ -> HValue -- the AP_STACK, or exception
+ -> IO ()
foreign import ccall "&rts_breakpoint_io_action"
breakPointIOAction :: Ptr (StablePtr BreakpointCallback)