diff options
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/main/DynFlags.hs | 6 | ||||
| -rw-r--r-- | compiler/main/InteractiveEval.hs | 10 |
2 files changed, 12 insertions, 4 deletions
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index d745cd63af..4810ce85b1 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -670,6 +670,8 @@ data DynFlags = DynFlags { maxWorkerArgs :: Int, + ghciHistSize :: Int, + -- | MsgDoc output action: use "ErrUtils" instead of this if you can log_action :: LogAction, flushOut :: FlushOut, @@ -1227,6 +1229,8 @@ defaultDynFlags mySettings = maxWorkerArgs = 10, + ghciHistSize = 50, -- keep a log of length 50 by default + log_action = defaultLogAction, flushOut = defaultFlushOut, flushErr = defaultFlushErr, @@ -2126,6 +2130,8 @@ dynamic_flags = [ , Flag "fmax-worker-args" (intSuffix (\n d -> d {maxWorkerArgs = n})) + , Flag "fghci-hist-size" (intSuffix (\n d -> d {ghciHistSize = n})) + ------ Profiling ---------------------------------------------------- -- OLD profiling flags diff --git a/compiler/main/InteractiveEval.hs b/compiler/main/InteractiveEval.hs index 64b2d3303c..9b9c14bb0b 100644 --- a/compiler/main/InteractiveEval.hs +++ b/compiler/main/InteractiveEval.hs @@ -220,13 +220,15 @@ runStmtWithLocation source linenumber expr step = let ic = hsc_IC hsc_env bindings = (ic_tythings ic, ic_rn_gbl_env ic) + size = ghciHistSize idflags' + case step of RunAndLogSteps -> traceRunStatus expr bindings tyThings - breakMVar statusMVar status emptyHistory + breakMVar statusMVar status (emptyHistory size) _other -> handleRunStatus expr bindings tyThings - breakMVar statusMVar status emptyHistory + breakMVar statusMVar status (emptyHistory size) runDecls :: GhcMonad m => String -> m [Name] runDecls = runDeclsWithLocation "<interactive>" 1 @@ -268,8 +270,8 @@ withVirtualCWD m = do parseImportDecl :: GhcMonad m => String -> m (ImportDecl RdrName) parseImportDecl expr = withSession $ \hsc_env -> liftIO $ hscImport hsc_env expr -emptyHistory :: BoundedList History -emptyHistory = nilBL 50 -- keep a log of length 50 +emptyHistory :: Int -> BoundedList History +emptyHistory size = nilBL size handleRunStatus :: GhcMonad m => String-> ([TyThing],GlobalRdrEnv) -> [Id] |
