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

#include <KillCommand.hh>

Inheritance diagram for KillCommand:
Inheritance graph
Collaboration diagram for KillCommand:
Collaboration graph

Public Member Functions

 KillCommand ()
 
virtual ~KillCommand ()
 
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 "kill" command of the Simulator Control Language.

Definition at line 46 of file KillCommand.hh.

Constructor & Destructor Documentation

◆ KillCommand()

KillCommand::KillCommand ( )

Constructor.

Sets the name of the command to the base class.

Definition at line 47 of file KillCommand.cc.

47  :
49 }

◆ ~KillCommand()

KillCommand::~KillCommand ( )
virtual

Destructor.

Does nothing.

Definition at line 56 of file KillCommand.cc.

56  {
57 }

Member Function Documentation

◆ execute()

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

Executes the "kill" command.

Terminate the simulation. The program being simulated remains loaded and the simulation can be restarted from the beginning by means of command run. The Simulator will normally prompt the user for comfirmation before terminating the simulation.

Parameters
argumentsNo arguments needed.
Returns
Always true.
Exceptions
NumberFormatExceptionIs never thrown by this command.

Implements CustomCommand.

Definition at line 73 of file KillCommand.cc.

73  {
74  const int argumentCount = arguments.size() - 1;
75  if (!checkArgumentCount(argumentCount, 0, 0)) {
76  return false;
77  }
78 
79  if (!checkSimulationEnded()) {
80  if (!checkSimulationStopped()) {
81  return false;
82  }
83  }
84 
85  if (!interpreter()->lineReader()->confirmation(
88  return false;
89  }
90 
92  return true;
93 }

References CustomCommand::checkArgumentCount(), SimControlLanguageCommand::checkSimulationEnded(), SimControlLanguageCommand::checkSimulationStopped(), CustomCommand::interpreter(), SimulatorFrontend::killSimulation(), SimControlLanguageCommand::simulatorFrontend(), SimulatorToolbox::textGenerator(), and Texts::TXT_CONFIRM_KILL_SIMULATION.

Here is the call graph for this function:

◆ helpText()

std::string KillCommand::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 104 of file KillCommand.cc.

104  {
107 }

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

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
SimControlLanguageCommand::checkSimulationStopped
bool checkSimulationStopped()
Definition: SimControlLanguageCommand.cc:135
Texts::TextGenerator::text
virtual boost::format text(int textId)
Definition: TextGenerator.cc:94
Texts::TXT_CONFIRM_KILL_SIMULATION
@ TXT_CONFIRM_KILL_SIMULATION
Definition: SimulatorTextGenerator.hh:191
SimControlLanguageCommand::checkSimulationEnded
bool checkSimulationEnded()
Definition: SimControlLanguageCommand.cc:158
SimControlLanguageCommand::SimControlLanguageCommand
SimControlLanguageCommand(const std::string &name)
Definition: SimControlLanguageCommand.cc:67
SimulatorToolbox::textGenerator
static SimulatorTextGenerator & textGenerator()
Definition: SimulatorToolbox.cc:75
CustomCommand::interpreter
ScriptInterpreter * interpreter() const
SimulatorFrontend::killSimulation
virtual void killSimulation()
Definition: SimulatorFrontend.cc:1784
SimControlLanguageCommand::simulatorFrontend
SimulatorFrontend & simulatorFrontend()
Definition: SimControlLanguageCommand.cc:214
Texts::TXT_INTERP_HELP_KILL
@ TXT_INTERP_HELP_KILL
Help text for command "kill" of the CLI.
Definition: SimulatorTextGenerator.hh:103