BackwardStepCommand.cc Source File
Back to the index.
Go to the documentation of this file.
50 "already at step 0.\n");
66 ss <<
"step " << step <<
" -> " << (step-1) <<
": ";
71 stringstream changeMessages;
74 string msg = changeMessages.str();
76 msg =
"No state change.\n";
86 return "Runs one step of the emulation backwards.";
93 "Runs one step of the emulation backwards. This command does the same as\n"
94 "manually decreasing root.step by 1, except that all state changes are also\n"
98 "step 3 -> 2: => cpu0.a1: 0 -> 0x2a\n"
99 " => cpu0.pc: 0xffffffffbfc0004c -> 0xffffffffbfc00048\n"
101 "This command requires that snapshotting support is enabled (using the\n"
102 "-B command line option).\n";
111 static void Test_BackwardStepCommand_AlreadyAtStep0()
114 vector<string> dummyArguments;
120 cmd->Execute(gxemul, dummyArguments);
125 static void Test_BackwardStepCommand_NotWhenSnapshotsAreDisabled()
128 vector<string> dummyArguments;
132 char filename[] =
"test/FileLoader_ELF_MIPS";
133 char *filenames[] = { filename };
151 cmd->Execute(gxemul, dummyArguments);
155 static void Test_BackwardStepCommand_Basic()
158 vector<string> dummyArguments;
162 char filename[] =
"test/FileLoader_ELF_MIPS";
163 char *filenames[] = { filename };
180 cmd->Execute(gxemul, dummyArguments);
188 cmd->Execute(gxemul, dummyArguments);
196 cmd->Execute(gxemul, dummyArguments);
204 cmd->Execute(gxemul, dummyArguments);
214 static void Test_BackwardStepCommand_ManualAddAndLoad()
217 vector<string> dummyArguments;
235 cmd->Execute(gxemul, dummyArguments);
243 cmd->Execute(gxemul, dummyArguments);
251 cmd->Execute(gxemul, dummyArguments);
259 cmd->Execute(gxemul, dummyArguments);
270 UNITTEST(Test_BackwardStepCommand_AlreadyAtStep0);
271 UNITTEST(Test_BackwardStepCommand_NotWhenSnapshotsAreDisabled);
272 UNITTEST(Test_BackwardStepCommand_Basic);
273 UNITTEST(Test_BackwardStepCommand_ManualAddAndLoad);
virtual string GetLongDescription() const
Returns a long description/help message for the command.
void SetSnapshottingEnabled(bool enabled)
Sets whether or not to use snapshots.
virtual ~BackwardStepCommand()
bool ParseFilenames(string templateMachine, int filenameCount, char *filenames[])
Parses command line arguments (file names).
CommandInterpreter & GetCommandInterpreter()
Gets a reference to the CommandInterpreter.
StateVariables make up the persistent state of Component objects.
virtual string GetShortDescription() const
Returns a short (one-line) description of the command.
A Command which sets the RunState to BackwardsSingleStepping.
uint64_t ToInteger() const
Returns the variable as an unsignedinteger value.
#define UNITTESTS(class)
Helper for unit test case execution.
virtual bool Execute(GXemul &gxemul, const vector< string > &arguments)
Executes the command on a given GXemul instance.
A Command is a named function, executed by the CommandInterpreter.
#define UNITTEST(functionname)
Helper for unit test case execution.
static void Assert(const string &strFailMessage, bool condition)
Asserts that a boolean condition is correct.
refcount_ptr< Component > GetRootComponent()
Gets a pointer to the root configuration component.
virtual void ShowDebugMessage(const string &msg)=0
Shows a debug message.
void DetectChanges(const refcount_ptr< Component > &oldClone, ostream &changeMessages) const
Compare an older clone to the current tree, to find changes.
void Execute(const int longestTotalRun=100000)
Run the emulation for "a while".
const refcount_ptr< Component > LookupPath(string path) const
Looks up a path from this Component, and returns a pointer to the found Component,...
bool Reset()
Resets the emulation.
bool SetVariableValue(const string &name, const string &expression)
Sets a variable to a new value.
bool RunCommand(const string &command, bool *pSuccess=NULL)
Runs a command, given as a string.
UI * GetUI()
Gets a pointer to the GXemul instance' active UI.
uint64_t GetStep() const
Gets the current step of the emulation.
const refcount_ptr< Component > LightClone() const
Makes a light clone of the component and all its children.
StateVariable * GetVariable(const string &name)
Gets a pointer to a state variable.
BackwardStepCommand()
Constructs a BackwardStepCommand.
Generated on Tue Mar 24 2020 14:04:48 for GXemul by
1.8.17