, substFiltered <- filter (not.isTyVarTy) . varEnvElts . getTvSubstEnv $ subst
, not . null $ substFiltered
, all (flip notElemTvSubst subst) ty_vars
--- , pprTrace "subst" (ppr subst) True
= True
| otherwise = False
where bindOnlyTy1 tyv | tyv `elem` ty_vars = AvoidMe
-----------------------------
-- | The :breakpoint command
-----------------------------
-bkptOptions :: String -> GHCi ()
+bkptOptions :: String -> GHCi Bool
+bkptOptions "continue" = -- We want to quit if in an inferior session
+ liftM not isTopLevel
+bkptOptions "stop" = do
+ inside_break <- liftM not isTopLevel
+ when inside_break $ throwDyn StopChildSession
+ return False
+
bkptOptions cmd = do
dflags <- getDynFlags
bt <- getBkptTable
bkptOptions' (words cmd) bt
+ return False
where
bkptOptions' ["list"] bt = do
let msgs = [ ppr mod <+> colon <+> ppr coords
else vcat num_msgs
io$ putStrLn msg
- bkptOptions' ["stop"] bt = do
- inside_break <- liftM not isTopLevel
- when inside_break $ throwDyn StopChildSession
-
bkptOptions' ("add":cmds) bt
| [mod_name,line]<- cmds
, [(lineNum,[])] <- reads line
io$ putStrLn delMsg
bkptOptions' _ _ = throwDyn $ CmdLineError $
- "syntax: :breakpoint (list|stop|add|del)"
+ "syntax: :breakpoint (list|continue|stop|add|del)"
-- Error messages
handleBkptEx :: Module -> Debugger.BkptException -> a
- handleBkptEx _ NoBkptFound = error "No suitable breakpoint site found" --TODO Automatically add to the next suitable line
+ handleBkptEx _ NoBkptFound = error "No suitable breakpoint site found"
+ -- ^ TODO Instead of complaining, set a bkpt in the next suitable line
handleBkptEx _ NotNeeded = error "Nothing to do"
handleBkptEx m NotHandled = error$ "Module " ++ showSDoc (ppr m) ++ " was not loaded under debugging mode. Enable debugging mode with -fdebugging (and reload your module)"
, s == site ]
-- addModule is dumb and inefficient, but it does the job
---addModule fn siteCoords _ | trace ("addModule: " ++ moduleString (unsafeCoerce# fn) ++ " - " ++ show siteCoords) False = undefined
addModule a [] bt = bt {sites = Map.insert a [] (sites bt)}
addModule a siteCoords bt
| nrows <- maximum$ [i | (_,(i,j)) <- siteCoords ]
| Just bkpts <- bkptsOf bt a
, inRange (bounds bkpts) site
= bkpts ! site
- | otherwise = throwDyn NotHandled -- This is an error
+ | otherwise = panic "unexpected condition: I don't know that breakpoint site"
-----------------
-- Other stuff