X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fghci%2FDebugger.hs;h=b158d33068aa08a6f177cd11f05db8cbe50bd00f;hb=4349893026e658316e35a0bdf0a08d49d45366c9;hp=75ad838370c44eafb4a64d36d0e16ee804b43969;hpb=80def9e1a3e0b54c759d04817ba76c717e861298;p=ghc-hetmet.git diff --git a/compiler/ghci/Debugger.hs b/compiler/ghci/Debugger.hs index 75ad838..b158d33 100644 --- a/compiler/ghci/Debugger.hs +++ b/compiler/ghci/Debugger.hs @@ -108,7 +108,6 @@ pprintClosureCommand bindThings force str = do , 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 @@ -376,10 +375,12 @@ bkptOptions cmd = do bkptOptions' _ _ = throwDyn $ CmdLineError $ "syntax: :breakpoint (list|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 and reload it" + handleBkptEx m NotHandled = error$ "Module " ++ showSDoc (ppr m) ++ " was not loaded under debugging mode. Enable debugging mode with -fdebugging (and reload your module)" ------------------------- -- Breakpoint Tables @@ -510,8 +511,7 @@ getSiteCoords bt a site , 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 +addModule a [] bt = bt {sites = Map.insert a [] (sites bt)} addModule a siteCoords bt | nrows <- maximum$ [i | (_,(i,j)) <- siteCoords ] , sitesByRow <- [ [(s,c) | (s,(r,c)) <- siteCoords, r==i] @@ -525,7 +525,7 @@ isBkptEnabled bt (a,site) | 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