From 7bf92baeaa558bab450bcda6e65649be082fd1a7 Mon Sep 17 00:00:00 2001 From: Pepe Iborra Date: Thu, 9 Aug 2007 20:11:21 +0000 Subject: [PATCH] :step does not delete the :history anymore, and now it logs like :trace --- compiler/main/InteractiveEval.hs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/compiler/main/InteractiveEval.hs b/compiler/main/InteractiveEval.hs index 42b787a..1859582 100644 --- a/compiler/main/InteractiveEval.hs +++ b/compiler/main/InteractiveEval.hs @@ -358,7 +358,7 @@ resume (Session ref) step when (isStep step) $ setStepFlag case r of Resume expr tid breakMVar statusMVar bindings - final_ids apStack info _ _ _ -> do + final_ids apStack info _ hist _ -> do withBreakAction (isStep step) (hsc_dflags hsc_env) breakMVar statusMVar $ do status <- withInterruptsSentTo @@ -366,14 +366,18 @@ resume (Session ref) step -- this awakens the stopped thread... return tid) (takeMVar statusMVar) - -- and wait for the result + -- and wait for the result + let hist' = case info of + Nothing -> fromListBL 50 hist + Just i -> History apStack i `consBL` + fromListBL 50 hist case step of RunAndLogSteps -> traceRunStatus expr ref bindings final_ids - breakMVar statusMVar status emptyHistory + breakMVar statusMVar status hist' _other -> handleRunStatus expr ref bindings final_ids - breakMVar statusMVar status emptyHistory + breakMVar statusMVar status hist' back :: Session -> IO ([Name], Int, SrcSpan) @@ -632,6 +636,8 @@ consBL a (BL len bound left right) toListBL (BL _ _ left right) = left ++ reverse right +fromListBL bound l = BL (length l) bound l [] + -- lenBL (BL len _ _ _) = len -- ----------------------------------------------------------------------------- -- 1.7.10.4