remove the ITBL_SIZE constants which were wrong, but fortunately unused
[ghc-hetmet.git] / compiler / main / Breakpoints.hs
index 8bb1716..c4318ca 100644 (file)
@@ -9,8 +9,18 @@
 \r
 module Breakpoints where\r
 \r
+#ifdef GHCI\r
+import {-#SOURCE#-} ByteCodeLink ( HValue ) \r
+#endif\r
+\r
 import {-#SOURCE#-} HscTypes     ( Session )\r
+import Name\r
+import Var                       ( Id )\r
+import PrelNames\r
+\r
+import GHC.Exts\r
 \r
+#ifdef GHCI\r
 data BkptHandler a = BkptHandler {\r
      handleBreakpoint  :: forall b. Session -> [(Id,HValue)] -> BkptLocation a ->  String -> b -> IO b\r
    , isAutoBkptEnabled :: Session -> BkptLocation a -> IO Bool\r
@@ -20,6 +30,27 @@ nullBkptHandler = BkptHandler {
     isAutoBkptEnabled = \ _ _     -> return False,\r
     handleBreakpoint  = \_ _ _ _ b -> putStrLn "null Bkpt Handler" >> return b\r
                               }\r
+#endif\r
 \r
 type BkptLocation a = (a, SiteNumber)\r
 type SiteNumber   = Int\r
+\r
+type SiteMap      = [(SiteNumber, Coord)]\r
+type Coord        = (Int, Int)\r
+\r
+noDbgSites :: SiteMap\r
+noDbgSites = []\r
+\r
+-- | Returns the 'identity' jumps\r
+--   Used to deal with spliced code, where we don't want breakpoints\r
+#ifdef GHCI\r
+lookupBogusBreakpointVal :: Name -> Maybe HValue\r
+lookupBogusBreakpointVal name \r
+  | name == breakpointJumpName     = Just$ unsafeCoerce# (\_ _ a->a)\r
+  | name == breakpointAutoJumpName = Just$ unsafeCoerce# (\_ _ a->a)\r
+  | name == breakpointCondJumpName = Just$ unsafeCoerce# (\_ _ _ a->a)\r
+  | otherwise = Nothing\r
+#else \r
+lookupBogusBreakpointVal _ = Nothing\r
+#endif /* GHCI */\r
+\r