X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fghci%2FInteractiveUI.hs;h=b794436b952d1a96464d6cb1424e4c1e419218da;hp=cea3b29c6aa13a7326e4080b85a66998baf70a94;hb=cdce647711c0f46f5799b24de087622cb77e647f;hpb=dc8ffcb9797ade3e3a68e6ec0a89fe2e7444e0ef diff --git a/compiler/ghci/InteractiveUI.hs b/compiler/ghci/InteractiveUI.hs index cea3b29..b794436 100644 --- a/compiler/ghci/InteractiveUI.hs +++ b/compiler/ghci/InteractiveUI.hs @@ -41,8 +41,7 @@ import Linker import Util -- The debugger -import Breakpoints -import Debugger hiding ( addModule ) +import Debugger import HscTypes import Id import Var ( globaliseId ) @@ -74,9 +73,7 @@ import System.Console.Readline as Readline import Control.Exception as Exception -- import Control.Concurrent -import Numeric import Data.List -import Data.Int ( Int64 ) import Data.Maybe ( isJust, isNothing, fromMaybe, catMaybes ) import System.Cmd import System.Environment @@ -86,16 +83,23 @@ import System.IO import System.IO.Error as IO import Data.Char import Data.Dynamic +import Data.Array import Control.Monad as Monad -import Foreign.StablePtr ( newStablePtr ) +import Foreign.StablePtr ( StablePtr, newStablePtr, deRefStablePtr, freeStablePtr ) import GHC.Exts ( unsafeCoerce# ) -import GHC.IOBase ( IOErrorType(InvalidArgument) ) +import GHC.IOBase ( IOErrorType(InvalidArgument), IO(IO) ) -import Data.IORef ( IORef, newIORef, readIORef, writeIORef ) +import Data.IORef ( IORef, readIORef, writeIORef ) import System.Posix.Internals ( setNonBlockingFD ) +-- these are needed by the new ghci debugger +import ByteCodeLink (HValue) +import ByteCodeInstr (BreakInfo (..)) +import BreakArray +import TickTree + ----------------------------------------------------------------------------- ghciWelcomeMsg = @@ -112,41 +116,37 @@ GLOBAL_VAR(commands, builtin_commands, [Command]) builtin_commands :: [Command] builtin_commands = [ + -- Hugs users are accustomed to :e, so make sure it doesn't overlap + ("?", keepGoing help, False, completeNone), ("add", tlC$ keepGoingPaths addModule, False, completeFilename), + ("break", breakCmd, False, completeNone), ("browse", keepGoing browseCmd, False, completeModule), -#ifdef DEBUGGER - -- I think that :c should mean :continue rather than :cd, makes more sense - -- (pepe 01.11.07) - ("continue", const(bkptOptions "continue"), False, completeNone), -#endif ("cd", tlC$ keepGoing changeDirectory, False, completeFilename), + ("check", keepGoing checkModule, False, completeHomeModule), + ("continue", continueCmd, False, completeNone), + ("ctags", keepGoing createCTagsFileCmd, False, completeFilename), ("def", keepGoing defineMacro, False, completeIdentifier), + ("delete", deleteCmd, False, completeNone), ("e", keepGoing editFile, False, completeFilename), - -- Hugs users are accustomed to :e, so make sure it doesn't overlap ("edit", keepGoing editFile, False, completeFilename), + ("etags", keepGoing createETagsFileCmd, False, completeFilename), + ("force", keepGoing (pprintClosureCommand False True), False, completeIdentifier), ("help", keepGoing help, False, completeNone), - ("?", keepGoing help, False, completeNone), ("info", keepGoing info, False, completeIdentifier), + ("kind", keepGoing kindOfType, False, completeIdentifier), ("load", tlC$ keepGoingPaths loadModule_,False, completeHomeModuleOrFile), ("module", keepGoing setContext, False, completeModule), ("main", tlC$ keepGoing runMain, False, completeIdentifier), + ("print", keepGoing (pprintClosureCommand True False), False, completeIdentifier), + ("quit", quit, False, completeNone), ("reload", tlC$ keepGoing reloadModule, False, completeNone), - ("check", keepGoing checkModule, False, completeHomeModule), ("set", keepGoing setCmd, True, completeSetOptions), ("show", keepGoing showCmd, False, completeNone), - ("etags", keepGoing createETagsFileCmd, False, completeFilename), - ("ctags", keepGoing createCTagsFileCmd, False, completeFilename), - ("type", keepGoing typeOfExpr, False, completeIdentifier), -#if defined(DEBUGGER) - ("print", keepGoing (pprintClosureCommand True False), False, completeIdentifier), ("sprint", keepGoing (pprintClosureCommand False False),False, completeIdentifier), - ("force", keepGoing (pprintClosureCommand False True), False, completeIdentifier), - ("breakpoint",bkptOptions, False, completeBkpt), -#endif - ("kind", keepGoing kindOfType, False, completeIdentifier), - ("unset", keepGoing unsetOptions, True, completeSetOptions), + ("step", stepCmd, False, completeNone), + ("type", keepGoing typeOfExpr, False, completeIdentifier), ("undef", keepGoing undefineMacro, False, completeMacro), - ("quit", quit, False, completeNone) + ("unset", keepGoing unsetOptions, True, completeSetOptions) ] keepGoing :: (String -> GHCi ()) -> (String -> GHCi Bool) @@ -171,10 +171,8 @@ helpText = "\n" ++ " evaluate/run \n" ++ " :add ... add module(s) to the current target set\n" ++ - " :breakpoint