Go to the documentation of this file.
37 #include <boost/shared_ptr.hpp>
94 virtual void execute(
int, siginfo_t *info) {
95 std::string msg(
"Unknown floating point exception");
97 if (info->si_code == FPE_INTDIV) {
98 msg =
"integer division by zero";
99 }
else if (info->si_code == FPE_FLTDIV) {
100 msg =
"floating-point division by zero";
101 }
else if (info->si_code == FPE_INTOVF) {
102 msg =
"integer overflow";
103 }
else if (info->si_code == FPE_FLTOVF) {
104 msg =
"floating-point overflow";
105 }
else if (info->si_code == FPE_FLTUND) {
106 msg =
"floating-point underflow";
107 }
else if (info->si_code == FPE_FLTRES) {
108 msg =
"floating-point inexact result";
109 }
else if (info->si_code == FPE_FLTINV) {
110 msg =
"invalid floating-point operation";
111 }
else if (info->si_code == FPE_FLTSUB) {
112 msg =
" Subscript out of range";
149 std::string msg(
"Invalid memory reference");
172 int main(
int argc,
char* argv[]) {
176 boost::shared_ptr<SimulatorFrontend> simFront;
199 if (simFront->isCompiledSimulation()) {
214 const std::string personalInitScript =
220 std::string machineToLoad =
options->machineFile();
221 std::string programToLoad =
options->programFile();
222 const std::string scriptString =
options->scriptString();
232 const std::string currentDirInitScript =
238 if (machineToLoad !=
"") {
242 if (programToLoad !=
"") {
244 if (scriptString ==
"") {
250 if (scriptString !=
"") {
258 if (simFront->isCompiledSimulation()) {
SigINTHandler(SimulatorFrontend &target)
@ SRE_USER_REQUESTED
User requested the simulation to stop explicitly, e.g., by pressing ctrl-c in the CLI.
virtual int numberOfArguments() const
static void restoreSignalHandler(int signalNum)
virtual void execute(int, siginfo_t *)
#define SIM_INIT_FILE_NAME
The initialization script file name.
virtual void execute(int, siginfo_t *)
static void setCmdLineOptions(CmdLineOptions *options_)
static void setSignalHandler(int signalNum, UnixSignalHandler &handler)
virtual boost::format text(int textId)
SigSegvHandler(SimulatorFrontend &target)
static std::string homeDirectory()
virtual void execute(int, siginfo_t *info)
SimulatorFrontend & target_
Simulator frontend to use when stopping the simulation.
@ SRE_RUNTIME_ERROR
A fatal runtime error occured in the simulated program.
@ RES_FATAL
Fatal runtime error, there is a serious error in the simulated program, thus it makes no sense to go ...
SimulatorFrontend & target_
Simulator frontend to use when stopping the simulation.
std::string errorMessage() const
void parse(char *argv[], int argc)
SimulatorInterpreter & interpreter()
static MachInfoCmdLineOptions options
static bool fileExists(const std::string fileName)
SigFPEHandler(SimulatorFrontend &target)
SimulatorFrontend & target_
Simulator frontend to use when stopping the simulation.
static std::string currentWorkingDir()
void reportSimulatedProgramError(RuntimeErrorSeverity severity, const std::string &description)
int main(int argc, char *argv[])
virtual void interpreteAndPrintResults(const TCEString &scriptString)
virtual bool processScriptFile(const std::string &scriptFileName)
void prepareToStop(StopReason reason)