diff options
author | Karel Kočí <cynerd@email.cz> | 2018-01-01 20:43:42 +0100 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2018-01-01 20:47:36 +0100 |
commit | 128ce1ee2115b54d43db1334e12410b1cc216f10 (patch) | |
tree | 10593231884a85966f38ac1fff9d139ae75e1bbb /qtmips_cli/reporter.h | |
parent | 92b6d05aed7cbfa7ddb0c5dcc61318c69c03bc97 (diff) | |
download | qtmips-128ce1ee2115b54d43db1334e12410b1cc216f10.tar.gz qtmips-128ce1ee2115b54d43db1334e12410b1cc216f10.tar.bz2 qtmips-128ce1ee2115b54d43db1334e12410b1cc216f10.zip |
cli: extend tracer and implement reporter
Diffstat (limited to 'qtmips_cli/reporter.h')
-rw-r--r-- | qtmips_cli/reporter.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/qtmips_cli/reporter.h b/qtmips_cli/reporter.h new file mode 100644 index 0000000..8dcc5f1 --- /dev/null +++ b/qtmips_cli/reporter.h @@ -0,0 +1,40 @@ +#ifndef REPORTER_H +#define REPORTER_H + +#include <QObject> +#include <QCoreApplication> +#include "qtmipsmachine.h" + +class Reporter : QObject { + Q_OBJECT +public: + Reporter(QCoreApplication *app, machine::QtMipsMachine *machine); + + void regs(); // Report status of registers + // TODO + + enum FailReason { + FR_I = (1<<0), // Unsupported Instruction + FR_A = (1<<1), // Unsupported ALU operation + FR_O = (1<<2), // Overflow/underflow of numerical operation + FR_J = (1<<3), // Unaligned jump + }; + static const enum FailReason FailAny = (enum FailReason)(FR_I | FR_A | FR_O | FR_J); + + void expect_fail(enum FailReason reason); + +private slots: + void machine_exit(); + void machine_trap(machine::QtMipsException &e); + +private: + QCoreApplication *app; + machine::QtMipsMachine *machine; + + bool e_regs; + enum FailReason e_fail; + + void report(); +}; + +#endif // REPORTER_H |