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

#include <BPCommand.hh>

Inheritance diagram for BPCommand:
Inheritance graph
Collaboration diagram for BPCommand:
Collaboration graph

Public Member Functions

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

Definition at line 47 of file BPCommand.hh.

Constructor & Destructor Documentation

◆ BPCommand()

BPCommand::BPCommand ( )

Constructor.

Sets the name of the command to the base class.

Definition at line 48 of file BPCommand.cc.

49 }

◆ ~BPCommand()

BPCommand::~BPCommand ( )
virtual

Destructor.

Does nothing.

Definition at line 56 of file BPCommand.cc.

56  {
57 }

Member Function Documentation

◆ execute()

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

Executes the "bp" command.

A breakpoint stops the simulation whenever the Simulator reaches a certain point in the program. It is possible to add a condition to a breakpoint, to control when the Simulator must stop with increased precision.

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 72 of file BPCommand.cc.

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

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

Here is the call graph for this function:

◆ helpText()

std::string BPCommand::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 92 of file BPCommand.cc.

92  {
95 }

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

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::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
Texts::TXT_INTERP_HELP_BREAK
@ TXT_INTERP_HELP_BREAK
Help text for command "bp" of the CLI.
Definition: SimulatorTextGenerator.hh:85
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