OpenASIP  2.0
Public Member Functions | List of all members
IgnoreCommand Class Reference

#include <IgnoreCommand.hh>

Inheritance diagram for IgnoreCommand:
Inheritance graph
Collaboration diagram for IgnoreCommand:
Collaboration graph

Public Member Functions

 IgnoreCommand ()
 
virtual ~IgnoreCommand ()
 
virtual bool execute (const std::vector< DataObject > &arguments)
 
virtual std::string helpText () const
 
- Public Member Functions inherited from SimControlLanguageCommand
 SimControlLanguageCommand (const std::string &name)
 
virtual ~SimControlLanguageCommand ()
 
SimulatorFrontendsimulatorFrontend ()
 
const SimulatorFrontendsimulatorFrontendConst ()
 
virtual void printNextInstruction ()
 
virtual void printStopInformation ()
 
virtual void printStopReasons ()
 
virtual bool printBreakpointInfo (unsigned int breakpointHandle)
 
virtual void printSimulationTime ()
 
virtual std::ostream & outputStream ()
 
bool checkSimulationInitialized ()
 
bool checkSimulationNotAlreadyRunning ()
 
bool checkSimulationStopped ()
 
bool checkSimulationEnded ()
 
bool checkProgramLoaded ()
 
bool checkMachineLoaded ()
 
InstructionAddress parseInstructionAddressExpression (const std::string &expression)
 
TTAProgram::Address parseDataAddressExpression (const std::string &expression)
 
bool parseBreakpoint (const std::vector< DataObject > &arguments, Breakpoint &target)
 
bool askConditionFromUser (TclConditionScript &target)
 
bool askExpressionFromUser (ExpressionScript &target)
 
bool verifyBreakpointHandles (const std::vector< DataObject > &arguments, std::size_t startIndex=1)
 
void setErrorMessage (const TCEString &errorMsg)
 
- Public Member Functions inherited from CustomCommand
 CustomCommand (std::string name)
 
 CustomCommand (const CustomCommand &cmd)
 
virtual ~CustomCommand ()
 
std::string name () const
 
void setContext (InterpreterContext *context)
 
InterpreterContextcontext () const
 
void setInterpreter (ScriptInterpreter *si)
 
ScriptInterpreterinterpreter () const
 
bool checkArgumentCount (int argumentCount, int minimum, int maximum)
 
bool checkIntegerArgument (const DataObject &argument)
 
bool checkPositiveIntegerArgument (const DataObject &argument)
 
bool checkUnsignedIntegerArgument (const DataObject &argument)
 
bool checkDoubleArgument (const DataObject &argument)
 

Additional Inherited Members

- Protected Member Functions inherited from SimControlLanguageCommand
bool setMemoryAddress (const std::string &addressString, std::string &addressSpaceName, std::size_t &memoryAddress)
 
bool setMemoryPointer (MemorySystem::MemoryPtr &memory, const std::string &addressSpaceName)
 

Detailed Description

Implementation of the "ignore" command of the Simulator Control Language.

Definition at line 47 of file IgnoreCommand.hh.

Constructor & Destructor Documentation

◆ IgnoreCommand()

IgnoreCommand::IgnoreCommand ( )

Constructor.

Sets the name of the command to the base class.

Definition at line 51 of file IgnoreCommand.cc.

51  :
52  SimControlLanguageCommand("ignore") {
53 }

◆ ~IgnoreCommand()

IgnoreCommand::~IgnoreCommand ( )
virtual

Destructor.

Does nothing.

Definition at line 60 of file IgnoreCommand.cc.

60  {
61 }

Member Function Documentation

◆ execute()

bool IgnoreCommand::execute ( const std::vector< DataObject > &  arguments)
virtual

Executes the "ignore" command.

Modifies the ignore counts of breakpoints.

Parameters
argumentsThe count of steps (default is one step).
Returns
True in case simulation is initialized and arguments are ok.
Exceptions
NumberFormatExceptionIs never thrown by this command.
Todo:
Use the count for the step.

Implements CustomCommand.

Definition at line 74 of file IgnoreCommand.cc.

74  {
75  if (!checkArgumentCount(arguments.size() - 1, 2, 2)) {
76  return false;
77  }
78 
79  if (!checkPositiveIntegerArgument(arguments[1]) ||
80  !checkPositiveIntegerArgument(arguments[2])) {
81  return false;
82  }
83 
84  if (!checkSimulationStopped()) {
86  return false;
87  }
88  }
89 
90  const int breakpointHandle = arguments[1].integerValue();
91  const int ignoreCount = arguments[2].integerValue();
92  try {
93  StopPointManager& stopPointManager =
95 
96  // just check that breakpoint is found with the handle
97  stopPointManager.stopPointWithHandleConst(breakpointHandle);
98  stopPointManager.setIgnore(breakpointHandle, ignoreCount);
99 
100  printBreakpointInfo(breakpointHandle);
101  } catch (const InstanceNotFound&) {
105  return false;
106  }
107  return true;
108 }

References CustomCommand::checkArgumentCount(), CustomCommand::checkPositiveIntegerArgument(), SimControlLanguageCommand::checkSimulationInitialized(), SimControlLanguageCommand::checkSimulationStopped(), CustomCommand::interpreter(), SimControlLanguageCommand::printBreakpointInfo(), ScriptInterpreter::setError(), StopPointManager::setIgnore(), SimControlLanguageCommand::simulatorFrontend(), SimulatorFrontend::stopPointManager(), StopPointManager::stopPointWithHandleConst(), SimulatorToolbox::textGenerator(), and Texts::TXT_BREAKPOINT_NOT_FOUND.

Here is the call graph for this function:

◆ helpText()

std::string IgnoreCommand::helpText ( ) const
virtual

Returns the help text for this command.

Help text is searched from SimulatorTextGenerator.

Returns
The help text.
Todo:
Use SimulatorTextGenerator to get the help text.

Implements CustomCommand.

Definition at line 119 of file IgnoreCommand.cc.

119  {
122 }

References Texts::TextGenerator::text(), SimulatorToolbox::textGenerator(), and Texts::TXT_INTERP_HELP_IGNORE.

Here is the call graph for this function:

The documentation for this class was generated from the following files:
CustomCommand::checkArgumentCount
bool checkArgumentCount(int argumentCount, int minimum, int maximum)
Definition: CustomCommand.cc:82
Texts::TXT_BREAKPOINT_NOT_FOUND
@ TXT_BREAKPOINT_NOT_FOUND
Definition: SimulatorTextGenerator.hh:186
SimControlLanguageCommand::checkSimulationStopped
bool checkSimulationStopped()
Definition: SimControlLanguageCommand.cc:135
CustomCommand::checkPositiveIntegerArgument
bool checkPositiveIntegerArgument(const DataObject &argument)
Definition: CustomCommand.cc:134
Texts::TextGenerator::text
virtual boost::format text(int textId)
Definition: TextGenerator.cc:94
SimControlLanguageCommand::SimControlLanguageCommand
SimControlLanguageCommand(const std::string &name)
Definition: SimControlLanguageCommand.cc:67
StopPointManager::stopPointWithHandleConst
const StopPoint & stopPointWithHandleConst(unsigned int handle) const
Definition: StopPointManager.cc:248
StopPointManager
Definition: StopPointManager.hh:50
Texts::TXT_INTERP_HELP_IGNORE
@ TXT_INTERP_HELP_IGNORE
Help text for command "ignore" of the CLI.
Definition: SimulatorTextGenerator.hh:93
SimulatorToolbox::textGenerator
static SimulatorTextGenerator & textGenerator()
Definition: SimulatorToolbox.cc:75
SimControlLanguageCommand::checkSimulationInitialized
bool checkSimulationInitialized()
Definition: SimControlLanguageCommand.cc:88
CustomCommand::interpreter
ScriptInterpreter * interpreter() const
ScriptInterpreter::setError
virtual void setError(bool state)
Definition: ScriptInterpreter.cc:205
SimControlLanguageCommand::simulatorFrontend
SimulatorFrontend & simulatorFrontend()
Definition: SimControlLanguageCommand.cc:214
StopPointManager::setIgnore
void setIgnore(unsigned int handle, unsigned int count)
Definition: StopPointManager.cc:283
SimulatorFrontend::stopPointManager
StopPointManager & stopPointManager()
Definition: SimulatorFrontend.cc:2108
InstanceNotFound
Definition: Exception.hh:304
SimControlLanguageCommand::printBreakpointInfo
virtual bool printBreakpointInfo(unsigned int breakpointHandle)
Definition: SimControlLanguageCommand.cc:678