14d9ea299d2cd7ce9cfeb53ee237a69e4d4c14d8
[ghc-hetmet.git] / compiler / main / Breakpoints.hs
1 -----------------------------------------------------------------------------\r
2 --\r
3 -- GHC API breakpoints. This module includes the main API (BkptHandler) and\r
4 -- utility code for implementing a client to this API used in GHCi \r
5 --\r
6 -- Pepe Iborra (supported by Google SoC) 2006\r
7 --\r
8 -----------------------------------------------------------------------------\r
9 \r
10 module Breakpoints where\r
11 \r
12 import {-#SOURCE#-} HscTypes     ( Session )\r
13 \r
14 data BkptHandler a = BkptHandler {\r
15      handleBreakpoint  :: forall b. Session -> [(Id,HValue)] -> BkptLocation a ->  String -> b -> IO b\r
16    , isAutoBkptEnabled :: Session -> BkptLocation a -> IO Bool\r
17    }\r
18 \r
19 nullBkptHandler = BkptHandler {\r
20     isAutoBkptEnabled = \ _ _     -> return False,\r
21     handleBreakpoint  = \_ _ _ _ b -> putStrLn "null Bkpt Handler" >> return b\r
22                               }\r
23 \r
24 type BkptLocation a = (a, SiteNumber)\r
25 type SiteNumber   = Int\r
26 \r
27 type SiteMap      = [(SiteNumber, Coord)]\r
28 type Coord        = (Int, Int)\r
29 \r
30 noDbgSites :: SiteMap\r
31 noDbgSites = []\r