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

#include <TBPCommand.hh>

Inheritance diagram for TBPCommand:
Inheritance graph
Collaboration diagram for TBPCommand:
Collaboration graph

Public Member Functions

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

Definition at line 47 of file TBPCommand.hh.

Constructor & Destructor Documentation

◆ TBPCommand()

TBPCommand::TBPCommand ( )

Constructor.

Sets the name of the command to the base class.

Definition at line 48 of file TBPCommand.cc.

48  : SimControlLanguageCommand("tbp") {
49 }

◆ ~TBPCommand()

TBPCommand::~TBPCommand ( )
virtual

Destructor.

Does nothing.

Definition at line 56 of file TBPCommand.cc.

56  {
57 }

Member Function Documentation

◆ execute()

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

Executes the "tbp" command.

Sets a temporary breakpoint, which is automatically deleted after the first time it stops the simulation. The arguments args are the same as for the bp command.

Parameters
argumentsThe address (and condition of the breakpoint).
Returns
True in case simulation is initialized and arguments are ok.
Exceptions
NumberFormatExceptionIs never thrown by this command.

Implements CustomCommand.

Definition at line 71 of file TBPCommand.cc.

71  {
72  Breakpoint breakpoint(simulatorFrontend(), 0);
73  if (!parseBreakpoint(arguments, breakpoint)) {
74  return false;
75  }
76  breakpoint.setDeletedAfterTriggered(true);
77 
78  StopPointManager& stopPointManager =
80  return printBreakpointInfo(stopPointManager.add(breakpoint));
81 }

References StopPointManager::add(), SimControlLanguageCommand::parseBreakpoint(), SimControlLanguageCommand::printBreakpointInfo(), StopPoint::setDeletedAfterTriggered(), SimControlLanguageCommand::simulatorFrontend(), and SimulatorFrontend::stopPointManager().

Here is the call graph for this function:

◆ helpText()

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

Returns the help text for this command.

Help text is searched from SimulatorTextGenerator.

Returns
The help text.

Implements CustomCommand.

Definition at line 91 of file TBPCommand.cc.

91  {
94 }

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

Here is the call graph for this function:

The documentation for this class was generated from the following files:
StopPointManager::add
unsigned int add(const StopPoint &stopPoint)
Definition: StopPointManager.cc:81
Breakpoint
Definition: Breakpoint.hh:50
Texts::TXT_INTERP_HELP_TBREAK
@ TXT_INTERP_HELP_TBREAK
Help text for command "tbp" of the CLI.
Definition: SimulatorTextGenerator.hh:89
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
Definition: StopPointManager.hh:50
SimulatorToolbox::textGenerator
static SimulatorTextGenerator & textGenerator()
Definition: SimulatorToolbox.cc:75
SimControlLanguageCommand::parseBreakpoint
bool parseBreakpoint(const std::vector< DataObject > &arguments, Breakpoint &target)
Definition: SimControlLanguageCommand.cc:593
SimControlLanguageCommand::simulatorFrontend
SimulatorFrontend & simulatorFrontend()
Definition: SimControlLanguageCommand.cc:214
SimulatorFrontend::stopPointManager
StopPointManager & stopPointManager()
Definition: SimulatorFrontend.cc:2108
SimControlLanguageCommand::printBreakpointInfo
virtual bool printBreakpointInfo(unsigned int breakpointHandle)
Definition: SimControlLanguageCommand.cc:678