diff --git a/app/MimaRun/Main.hs b/app/MimaRun/Main.hs index 4908736..5f55c79 100644 --- a/app/MimaRun/Main.hs +++ b/app/MimaRun/Main.hs @@ -153,7 +153,6 @@ printState ms flags labels settings = do lift $ putStrLn "" lift $ putStrLn "Dump of MiMa state:" lift $ T.putStrLn $ formatState formatEnv - lift $ putStrLn "" -- TODO exception handling main :: IO () diff --git a/src/Mima/Format/State.hs b/src/Mima/Format/State.hs index 41e5fee..dcd8ec1 100644 --- a/src/Mima/Format/State.hs +++ b/src/Mima/Format/State.hs @@ -35,6 +35,7 @@ import Mima.Word data FormatConfig = FormatConfig { fcSparse :: Bool , fcShowRegisters :: Bool + , fcShowMemory :: Bool , fcShowMemoryFlags :: Bool , fcShowRegisterFlags :: Bool , fcShowAddressDec :: Bool @@ -203,11 +204,10 @@ fState :: Formatter fState = do env <- ask let conf = feConf env - memText <- ("--< MEMORY >--\n" <>) <$> fMemory regText <- ("--< REGISTERS >--\n" <>) <$> fRegisters - pure $ if fcShowRegisters conf - then regText <> memText - else memText + memText <- ("--< MEMORY >--\n" <>) <$> fMemory + pure $ (if fcShowRegisters conf then regText else "") + <> (if fcShowMemory conf then memText else "") formatState :: FormatEnv -> T.Text formatState = runReader fState diff --git a/src/Mima/Options.hs b/src/Mima/Options.hs index 36a00ee..a372ac0 100644 --- a/src/Mima/Options.hs +++ b/src/Mima/Options.hs @@ -38,6 +38,8 @@ formatConfigParser = FormatConfig "Omit uninteresting addresses" <*> hiddenSwitchWithNo "registers" True "Show the contents of registers before the memory dump" + <*> hiddenSwitchWithNo "memory" True + "Show the memory dump" <*> hiddenSwitchWithNo "memory-flags" False "For each address, show all registers currently pointing to that address" <*> hiddenSwitchWithNo "register-flags" True