Thu Feb 19 00:34:27 CET 2009  Peter Hercek <phercek@gmail.com>
  * step(local|module) should not extend trace history with records outside (local|module) scope
diff -rN -u old-ghc/compiler/ghci/GhciMonad.hs new-ghc/compiler/ghci/GhciMonad.hs
--- old-ghc/compiler/ghci/GhciMonad.hs	2009-02-22 16:52:16.962156095 +0100
+++ new-ghc/compiler/ghci/GhciMonad.hs	2009-02-22 16:52:17.025485604 +0100
@@ -248,8 +248,8 @@
                                         return GHC.RunFailed) $ do
           GHC.runStmt expr step
 
-resume :: GHC.SingleStep -> GHCi GHC.RunResult
-resume step = GHC.resume step
+resume :: (SrcSpan->Bool) -> GHC.SingleStep -> GHCi GHC.RunResult
+resume canLogSpan step = GHC.resume canLogSpan step
 
 -- --------------------------------------------------------------------------
 -- timing & statistics
diff -rN -u old-ghc/compiler/ghci/InteractiveUI.hs new-ghc/compiler/ghci/InteractiveUI.hs
--- old-ghc/compiler/ghci/InteractiveUI.hs	2009-02-22 16:52:16.962156095 +0100
+++ new-ghc/compiler/ghci/InteractiveUI.hs	2009-02-22 16:52:17.218815953 +0100
@@ -742,7 +742,7 @@
                st <- getGHCiState
                enqueueCommands [stop st]
                return ()
-         | otherwise -> resume GHC.SingleStep >>=
+         | otherwise -> resume step_here GHC.SingleStep >>=
                         afterRunStmt step_here >> return ()
      _ -> return ()
 
@@ -1965,7 +1965,7 @@
 -- doContinue :: SingleStep -> GHCi ()
 doContinue :: (SrcSpan -> Bool) -> SingleStep -> GHCi ()
 doContinue pred step = do 
-  runResult <- resume step
+  runResult <- resume pred step
   afterRunStmt pred runResult
   return ()
 
diff -rN -u old-ghc/compiler/main/InteractiveEval.hs new-ghc/compiler/main/InteractiveEval.hs
--- old-ghc/compiler/main/InteractiveEval.hs	2009-02-22 16:52:16.958820140 +0100
+++ new-ghc/compiler/main/InteractiveEval.hs	2009-02-22 16:52:17.028820162 +0100
@@ -434,8 +434,8 @@
   putStrLn $ "*** Ignoring breakpoint: "++mn ++ " #"++show i
 noBreakAction True  _ _ = return () -- exception: just continue
 
-resume :: GhcMonad m => SingleStep -> m RunResult
-resume step
+resume :: GhcMonad m => (SrcSpan->Bool) -> SingleStep -> m RunResult
+resume canLogSpan step
  = do
    hsc_env <- getSession
    let ic = hsc_IC hsc_env
@@ -462,7 +462,7 @@
         when (isStep step) $ liftIO setStepFlag
         case r of 
           Resume expr tid breakMVar statusMVar bindings 
-              final_ids apStack info _ hist _ -> do
+              final_ids apStack info span hist _ -> do
                withVirtualCWD $ do
                 withBreakAction (isStep step) (hsc_dflags hsc_env) 
                                         breakMVar statusMVar $ do
@@ -471,10 +471,12 @@
                                       -- this awakens the stopped thread...
                              takeMVar statusMVar
                                       -- and wait for the result 
-                let hist' = 
-                     case info of 
-                       Nothing -> fromListBL 50 hist
-                       Just i -> mkHistory hsc_env apStack i `consBL` 
+                let prevHistoryLst = fromListBL 50 hist
+                    hist' = case info of
+                       Nothing -> prevHistoryLst
+                       Just i
+                         | not $canLogSpan span -> prevHistoryLst
+                         | otherwise -> mkHistory hsc_env apStack i `consBL`
                                                         fromListBL 50 hist
                 case step of
                   RunAndLogSteps -> 

