Allow toggling memory part of memory dump
This commit is contained in:
parent
72e21d6ff2
commit
d5d29a8180
3 changed files with 6 additions and 5 deletions
|
|
@ -153,7 +153,6 @@ printState ms flags labels settings = do
|
||||||
lift $ putStrLn ""
|
lift $ putStrLn ""
|
||||||
lift $ putStrLn "Dump of MiMa state:"
|
lift $ putStrLn "Dump of MiMa state:"
|
||||||
lift $ T.putStrLn $ formatState formatEnv
|
lift $ T.putStrLn $ formatState formatEnv
|
||||||
lift $ putStrLn ""
|
|
||||||
|
|
||||||
-- TODO exception handling
|
-- TODO exception handling
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ import Mima.Word
|
||||||
data FormatConfig = FormatConfig
|
data FormatConfig = FormatConfig
|
||||||
{ fcSparse :: Bool
|
{ fcSparse :: Bool
|
||||||
, fcShowRegisters :: Bool
|
, fcShowRegisters :: Bool
|
||||||
|
, fcShowMemory :: Bool
|
||||||
, fcShowMemoryFlags :: Bool
|
, fcShowMemoryFlags :: Bool
|
||||||
, fcShowRegisterFlags :: Bool
|
, fcShowRegisterFlags :: Bool
|
||||||
, fcShowAddressDec :: Bool
|
, fcShowAddressDec :: Bool
|
||||||
|
|
@ -203,11 +204,10 @@ fState :: Formatter
|
||||||
fState = do
|
fState = do
|
||||||
env <- ask
|
env <- ask
|
||||||
let conf = feConf env
|
let conf = feConf env
|
||||||
memText <- ("--< MEMORY >--\n" <>) <$> fMemory
|
|
||||||
regText <- ("--< REGISTERS >--\n" <>) <$> fRegisters
|
regText <- ("--< REGISTERS >--\n" <>) <$> fRegisters
|
||||||
pure $ if fcShowRegisters conf
|
memText <- ("--< MEMORY >--\n" <>) <$> fMemory
|
||||||
then regText <> memText
|
pure $ (if fcShowRegisters conf then regText else "")
|
||||||
else memText
|
<> (if fcShowMemory conf then memText else "")
|
||||||
|
|
||||||
formatState :: FormatEnv -> T.Text
|
formatState :: FormatEnv -> T.Text
|
||||||
formatState = runReader fState
|
formatState = runReader fState
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,8 @@ formatConfigParser = FormatConfig
|
||||||
"Omit uninteresting addresses"
|
"Omit uninteresting addresses"
|
||||||
<*> hiddenSwitchWithNo "registers" True
|
<*> hiddenSwitchWithNo "registers" True
|
||||||
"Show the contents of registers before the memory dump"
|
"Show the contents of registers before the memory dump"
|
||||||
|
<*> hiddenSwitchWithNo "memory" True
|
||||||
|
"Show the memory dump"
|
||||||
<*> hiddenSwitchWithNo "memory-flags" False
|
<*> hiddenSwitchWithNo "memory-flags" False
|
||||||
"For each address, show all registers currently pointing to that address"
|
"For each address, show all registers currently pointing to that address"
|
||||||
<*> hiddenSwitchWithNo "register-flags" True
|
<*> hiddenSwitchWithNo "register-flags" True
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue