aboutsummaryrefslogtreecommitdiff
path: root/src/ARMInterpreter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ARMInterpreter.cpp')
-rw-r--r--src/ARMInterpreter.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ARMInterpreter.cpp b/src/ARMInterpreter.cpp
index 35854d1..0451894 100644
--- a/src/ARMInterpreter.cpp
+++ b/src/ARMInterpreter.cpp
@@ -27,6 +27,10 @@
using Platform::Log;
using Platform::LogLevel;
+#ifdef GDBSTUB_ENABLED
+#include "debug/GdbStub.h"
+#endif
+
namespace ARMInterpreter
{
@@ -34,6 +38,9 @@ namespace ARMInterpreter
void A_UNK(ARM* cpu)
{
Log(LogLevel::Warn, "undefined ARM%d instruction %08X @ %08X\n", cpu->Num?7:9, cpu->CurInstr, cpu->R[15]-8);
+#ifdef GDBSTUB_ENABLED
+ cpu->GdbStub.Enter(true, Gdb::TgtStatus::FaultInsn, cpu->R[15]-8);
+#endif
//for (int i = 0; i < 16; i++) printf("R%d: %08X\n", i, cpu->R[i]);
//NDS::Halt();
u32 oldcpsr = cpu->CPSR;
@@ -49,6 +56,9 @@ void A_UNK(ARM* cpu)
void T_UNK(ARM* cpu)
{
Log(LogLevel::Warn, "undefined THUMB%d instruction %04X @ %08X\n", cpu->Num?7:9, cpu->CurInstr, cpu->R[15]-4);
+#ifdef GDBSTUB_ENABLED
+ cpu->GdbStub.Enter(true, Gdb::TgtStatus::FaultInsn, cpu->R[15]-4);
+#endif
//NDS::Halt();
u32 oldcpsr = cpu->CPSR;
cpu->CPSR &= ~0xBF;