X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fghci%2FInteractiveUI.hs;h=48033ae709fad0902acacbe745962e999bdb55bf;hb=fc9bbbab3fe56cf0ff5723abbdb0f496d257f34e;hp=896728b46ea2a156931a5422e565e1547a79f22a;hpb=e1ca71716cd40aecf23f572e661e0285dd1b8b3a;p=ghc-hetmet.git diff --git a/compiler/ghci/InteractiveUI.hs b/compiler/ghci/InteractiveUI.hs index 896728b..48033ae 100644 --- a/compiler/ghci/InteractiveUI.hs +++ b/compiler/ghci/InteractiveUI.hs @@ -42,6 +42,7 @@ import SrcLoc -- Other random utilities import ErrUtils +import CmdLineParser import Digraph import BasicTypes hiding (isTopLevel) import Panic hiding (showException) @@ -1053,6 +1054,7 @@ loadModule' files = do prev_context <- io $ GHC.getContext session -- unload first + io $ GHC.abandonAll session discardActiveBreakPoints io (GHC.setTargets session []) io (GHC.load session LoadAllTargets) @@ -1502,13 +1504,12 @@ newDynFlags :: [String] -> GHCi () newDynFlags minus_opts = do dflags <- getDynFlags let pkg_flags = packageFlags dflags - (dflags', leftovers, warns) <- io $ GHC.parseDynamicFlags dflags minus_opts + (dflags', leftovers, warns) <- io $ GHC.parseDynamicFlags dflags $ map noLoc minus_opts io $ handleFlagWarnings dflags' warns if (not (null leftovers)) - then ghcError (CmdLineError ("unrecognised flags: " ++ - unwords leftovers)) - else return () + then ghcError $ errorsToGhcException leftovers + else return () new_pkgs <- setDynFlags dflags'