OpenASIP  2.0
Public Member Functions | Private Attributes | List of all members
SigSegvHandler Class Reference
Inheritance diagram for SigSegvHandler:
Inheritance graph
Collaboration diagram for SigSegvHandler:
Collaboration graph

Public Member Functions

 SigSegvHandler (SimulatorFrontend &target)
 
virtual void execute (int, siginfo_t *)
 
- Public Member Functions inherited from Application::UnixSignalHandler
virtual ~UnixSignalHandler ()
 

Private Attributes

SimulatorFrontendtarget_
 Simulator frontend to use when stopping the simulation. More...
 

Detailed Description

A handler class for SIGSEGV signal

Stops the simulation (if it's running). Used for catching errors from the simulated program in the compiled simulation engine.

Definition at line 133 of file TTASim.cc.

Constructor & Destructor Documentation

◆ SigSegvHandler()

SigSegvHandler::SigSegvHandler ( SimulatorFrontend target)
inline

Constructor.

Parameters
targetThe target SimulatorFrontend instance.

Definition at line 140 of file TTASim.cc.

140  : target_(target) {
141  }

Member Function Documentation

◆ execute()

virtual void SigSegvHandler::execute ( int  ,
siginfo_t *   
)
inlinevirtual

Terminates the simulation.

Exceptions
SimulationExecutionErrorthrown always

Implements Application::UnixSignalHandler.

Definition at line 148 of file TTASim.cc.

148  {
149  std::string msg("Invalid memory reference");
150 
154 
155  throw SimulationExecutionError(__FILE__, __LINE__, __FUNCTION__, msg);
156  }

References SimulatorFrontend::prepareToStop(), SimulatorFrontend::reportSimulatedProgramError(), SimulatorFrontend::RES_FATAL, SRE_RUNTIME_ERROR, and target_.

Here is the call graph for this function:

Member Data Documentation

◆ target_

SimulatorFrontend& SigSegvHandler::target_
private

Simulator frontend to use when stopping the simulation.

Definition at line 159 of file TTASim.cc.

Referenced by execute().


The documentation for this class was generated from the following file:
SimulationExecutionError
Definition: Exception.hh:951
SigSegvHandler::target_
SimulatorFrontend & target_
Simulator frontend to use when stopping the simulation.
Definition: TTASim.cc:159
SRE_RUNTIME_ERROR
@ SRE_RUNTIME_ERROR
A fatal runtime error occured in the simulated program.
Definition: SimulatorConstants.hh:68
SimulatorFrontend::RES_FATAL
@ RES_FATAL
Fatal runtime error, there is a serious error in the simulated program, thus it makes no sense to go ...
Definition: SimulatorFrontend.hh:95
SimulatorFrontend::reportSimulatedProgramError
void reportSimulatedProgramError(RuntimeErrorSeverity severity, const std::string &description)
Definition: SimulatorFrontend.cc:2304
SimulatorFrontend::prepareToStop
void prepareToStop(StopReason reason)
Definition: SimulatorFrontend.cc:1331