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

#include <DeleteBPCommand.hh>

Inheritance diagram for DeleteBPCommand:
Inheritance graph
Collaboration diagram for DeleteBPCommand:
Collaboration graph

Public Member Functions

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

Definition at line 47 of file DeleteBPCommand.hh.

Constructor & Destructor Documentation

◆ DeleteBPCommand()

DeleteBPCommand::DeleteBPCommand ( )

Constructor.

Sets the name of the command to the base class.

Definition at line 51 of file DeleteBPCommand.cc.

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

◆ ~DeleteBPCommand()

DeleteBPCommand::~DeleteBPCommand ( )
virtual

Destructor.

Does nothing.

Definition at line 60 of file DeleteBPCommand.cc.

60  {
61 }

Member Function Documentation

◆ execute()

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

Executes the "deletebp" command.

Deletes the given breakpoints.

Parameters
argumentsThe handle(s) of the breakpoint(s) to delete.
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 DeleteBPCommand.cc.

74  {
75  if (!checkSimulationStopped()) {
77  return false;
78  }
79  }
80 
81  StopPointManager& breakpointManager =
83  if (arguments.size() > 1) {
84  if (!verifyBreakpointHandles(arguments)) {
85  return false;
86  }
87 
88  // delete the given breakpoints
89  for (size_t i = 1; i < arguments.size(); ++i) {
90  const unsigned int breakpointHandle = arguments[i].integerValue();
91  try {
92  breakpointManager.deleteStopPoint(breakpointHandle);
93  } catch (const InstanceNotFound&) {
94  // user defined the same breakpoint handle twice, let's
95  // ignore this
96  }
97  }
98  } else {
99  // delete all breakpoints
100  if (!interpreter()->lineReader()->confirmation(
103  // user answered "no", command is still considered succesful
104  return true;
105  }
106  breakpointManager.deleteAll();
107  }
108  return true;
109 }

References SimControlLanguageCommand::checkSimulationInitialized(), SimControlLanguageCommand::checkSimulationStopped(), StopPointManager::deleteAll(), StopPointManager::deleteStopPoint(), CustomCommand::interpreter(), SimControlLanguageCommand::simulatorFrontend(), SimulatorFrontend::stopPointManager(), SimulatorToolbox::textGenerator(), Texts::TXT_CONFIRM_DELETE_ALL_BREAKPOINTS, and SimControlLanguageCommand::verifyBreakpointHandles().

Here is the call graph for this function:

◆ helpText()

std::string DeleteBPCommand::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 120 of file DeleteBPCommand.cc.

120  {
123 }

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

Here is the call graph for this function:

The documentation for this class was generated from the following files:
SimControlLanguageCommand::checkSimulationStopped
bool checkSimulationStopped()
Definition: SimControlLanguageCommand.cc:135
StopPointManager::deleteStopPoint
void deleteStopPoint(unsigned int handle)
Definition: StopPointManager.cc:108
Texts::TXT_INTERP_HELP_DELETEBP
@ TXT_INTERP_HELP_DELETEBP
Help text for command "deletebp" of the CLI.
Definition: SimulatorTextGenerator.hh:95
Texts::TextGenerator::text
virtual boost::format text(int textId)
Definition: TextGenerator.cc:94
SimControlLanguageCommand::verifyBreakpointHandles
bool verifyBreakpointHandles(const std::vector< DataObject > &arguments, std::size_t startIndex=1)
Definition: SimControlLanguageCommand.cc:712
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
StopPointManager::deleteAll
void deleteAll()
Definition: StopPointManager.cc:136
SimControlLanguageCommand::checkSimulationInitialized
bool checkSimulationInitialized()
Definition: SimControlLanguageCommand.cc:88
CustomCommand::interpreter
ScriptInterpreter * interpreter() const
SimControlLanguageCommand::simulatorFrontend
SimulatorFrontend & simulatorFrontend()
Definition: SimControlLanguageCommand.cc:214
Texts::TXT_CONFIRM_DELETE_ALL_BREAKPOINTS
@ TXT_CONFIRM_DELETE_ALL_BREAKPOINTS
Definition: SimulatorTextGenerator.hh:190
SimulatorFrontend::stopPointManager
StopPointManager & stopPointManager()
Definition: SimulatorFrontend.cc:2108
InstanceNotFound
Definition: Exception.hh:304