From 742d48d1462523c89087551e683e824f922bb629 Mon Sep 17 00:00:00 2001 From: Pavel Pisa Date: Sun, 24 Mar 2019 22:21:01 +0100 Subject: Extend qtmips_cli to recognize break and report final state. Signed-off-by: Pavel Pisa --- qtmips_machine/qtmipsmachine.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'qtmips_machine/qtmipsmachine.cpp') diff --git a/qtmips_machine/qtmipsmachine.cpp b/qtmips_machine/qtmipsmachine.cpp index e047167..35843f4 100644 --- a/qtmips_machine/qtmipsmachine.cpp +++ b/qtmips_machine/qtmipsmachine.cpp @@ -332,3 +332,14 @@ bool QtMipsMachine::get_step_over_exception(enum ExceptionCause excause) const { return cr->get_step_over_exception(excause); return false; } + +enum ExceptionCause QtMipsMachine::get_exception_cause() const { + std::uint32_t val; + if (cop0st == nullptr) + return EXCAUSE_NONE; + val = (cop0st->read_cop0reg(Cop0State::Cause) >> 2) & 0x3f; + if (val == 0) + return EXCAUSE_INT; + else + return (ExceptionCause)val; +} -- cgit v1.2.3