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
|
new
|
|
| 248 | 248 | return GHC.RunFailed) $ do |
| 249 | 249 | GHC.runStmt expr step |
| 250 | 250 | |
| 251 | | resume :: GHC.SingleStep -> GHCi GHC.RunResult |
| 252 | | resume step = GHC.resume step |
| | 251 | resume :: (SrcSpan->Bool) -> GHC.SingleStep -> GHCi GHC.RunResult |
| | 252 | resume canLogSpan step = GHC.resume canLogSpan step |
| 253 | 253 | |
| 254 | 254 | -- -------------------------------------------------------------------------- |
| 255 | 255 | -- timing & statistics |
diff -rN -u old-ghc/compiler/ghci/InteractiveUI.hs new-ghc/compiler/ghci/InteractiveUI.hs
|
old
|
new
|
|
| 742 | 742 | st <- getGHCiState |
| 743 | 743 | enqueueCommands [stop st] |
| 744 | 744 | return () |
| 745 | | | otherwise -> resume GHC.SingleStep >>= |
| | 745 | | otherwise -> resume step_here GHC.SingleStep >>= |
| 746 | 746 | afterRunStmt step_here >> return () |
| 747 | 747 | _ -> return () |
| 748 | 748 | |
| … |
… |
|
| 1965 | 1965 | -- doContinue :: SingleStep -> GHCi () |
| 1966 | 1966 | doContinue :: (SrcSpan -> Bool) -> SingleStep -> GHCi () |
| 1967 | 1967 | doContinue pred step = do |
| 1968 | | runResult <- resume step |
| | 1968 | runResult <- resume pred step |
| 1969 | 1969 | afterRunStmt pred runResult |
| 1970 | 1970 | return () |
| 1971 | 1971 | |
diff -rN -u old-ghc/compiler/main/InteractiveEval.hs new-ghc/compiler/main/InteractiveEval.hs
|
old
|
new
|
|
| 434 | 434 | putStrLn $ "*** Ignoring breakpoint: "++mn ++ " #"++show i |
| 435 | 435 | noBreakAction True _ _ = return () -- exception: just continue |
| 436 | 436 | |
| 437 | | resume :: GhcMonad m => SingleStep -> m RunResult |
| 438 | | resume step |
| | 437 | resume :: GhcMonad m => (SrcSpan->Bool) -> SingleStep -> m RunResult |
| | 438 | resume canLogSpan step |
| 439 | 439 | = do |
| 440 | 440 | hsc_env <- getSession |
| 441 | 441 | let ic = hsc_IC hsc_env |
| … |
… |
|
| 462 | 462 | when (isStep step) $ liftIO setStepFlag |
| 463 | 463 | case r of |
| 464 | 464 | Resume expr tid breakMVar statusMVar bindings |
| 465 | | final_ids apStack info _ hist _ -> do |
| | 465 | final_ids apStack info span hist _ -> do |
| 466 | 466 | withVirtualCWD $ do |
| 467 | 467 | withBreakAction (isStep step) (hsc_dflags hsc_env) |
| 468 | 468 | breakMVar statusMVar $ do |
| … |
… |
|
| 471 | 471 | -- this awakens the stopped thread... |
| 472 | 472 | takeMVar statusMVar |
| 473 | 473 | -- and wait for the result |
| 474 | | let hist' = |
| 475 | | case info of |
| 476 | | Nothing -> fromListBL 50 hist |
| 477 | | Just i -> mkHistory hsc_env apStack i `consBL` |
| | 474 | let prevHistoryLst = fromListBL 50 hist |
| | 475 | hist' = case info of |
| | 476 | Nothing -> prevHistoryLst |
| | 477 | Just i |
| | 478 | | not $canLogSpan span -> prevHistoryLst |
| | 479 | | otherwise -> mkHistory hsc_env apStack i `consBL` |
| 478 | 480 | fromListBL 50 hist |
| 479 | 481 | case step of |
| 480 | 482 | RunAndLogSteps -> |