From 6d075f13b503ad7b1255911e98f4837a08607ed7 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Thu, 19 Apr 2007 09:48:06 +0000 Subject: [PATCH] more layering cleanup: BreakArray should come from GHC --- compiler/ghci/InteractiveUI.hs | 13 ++++--------- compiler/main/GHC.hs | 2 ++ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/compiler/ghci/InteractiveUI.hs b/compiler/ghci/InteractiveUI.hs index 7a40a74..3e528d0 100644 --- a/compiler/ghci/InteractiveUI.hs +++ b/compiler/ghci/InteractiveUI.hs @@ -85,11 +85,6 @@ import Data.IORef ( IORef, readIORef, writeIORef ) import System.Posix.Internals ( setNonBlockingFD ) --- these are needed by the new ghci debugger -import ByteCodeLink (HValue) -import ByteCodeInstr (BreakInfo (..)) -import BreakArray - ----------------------------------------------------------------------------- ghciWelcomeMsg = @@ -1659,7 +1654,7 @@ mkTickArray ticks max_line = maximum (map srcSpanEndLine (map snd ticks)) srcSpanLines span = [ srcSpanStartLine span .. srcSpanEndLine span ] -getModBreak :: Module -> GHCi (BreakArray, Array Int SrcSpan) +getModBreak :: Module -> GHCi (GHC.BreakArray, Array Int SrcSpan) getModBreak mod = do session <- getSession Just mod_info <- io $ GHC.getModuleInfo session mod @@ -1672,10 +1667,10 @@ lookupModule :: Session -> String -> GHCi Module lookupModule session modName = io (GHC.findModule session (GHC.mkModuleName modName) Nothing) -setBreakFlag :: Bool -> BreakArray -> Int -> IO Bool +setBreakFlag :: Bool -> GHC.BreakArray -> Int -> IO Bool setBreakFlag toggle array index - | toggle = setBreakOn array index - | otherwise = setBreakOff array index + | toggle = GHC.setBreakOn array index + | otherwise = GHC.setBreakOff array index {- these should probably go to the GHC API at some point -} diff --git a/compiler/main/GHC.hs b/compiler/main/GHC.hs index 8d54058..0b93cd8 100644 --- a/compiler/main/GHC.hs +++ b/compiler/main/GHC.hs @@ -87,6 +87,7 @@ module GHC ( obtainTerm, obtainTerm1, ModBreaks(..), BreakIndex, BreakInfo(breakInfo_number, breakInfo_module), + BreakArray, setBreakOn, setBreakOff, getBreak, modInfoModBreaks, #endif @@ -198,6 +199,7 @@ import ByteCodeInstr import DebuggerTys import IdInfo import HscMain ( hscParseIdentifier, hscTcExpr, hscKcType, hscStmt ) +import BreakArray #endif import Packages -- 1.7.10.4