OpenASIP 2.2
Loading...
Searching...
No Matches
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.
 

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 }
SimulatorFrontend & target_
Simulator frontend to use when stopping the simulation.
Definition TTASim.cc:159

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 }
@ SRE_RUNTIME_ERROR
A fatal runtime error occured in the simulated program.
void reportSimulatedProgramError(RuntimeErrorSeverity severity, const std::string &description)
@ RES_FATAL
Fatal runtime error, there is a serious error in the simulated program, thus it makes no sense to go ...
void prepareToStop(StopReason reason)

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: