diff --git a/src/ARMInterpreter.cpp b/src/ARMInterpreter.cpp index 6fb86ef5..f5bf7713 100644 --- a/src/ARMInterpreter.cpp +++ b/src/ARMInterpreter.cpp @@ -38,7 +38,7 @@ 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); + cpu->GdbStub.Enter(cpu->GdbStub.IsConnected(), 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(); @@ -56,7 +56,7 @@ 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); + cpu->GdbStub.Enter(cpu->GdbStub.IsConnected(), Gdb::TgtStatus::FaultInsn, cpu->R[15]-4); #endif //NDS::Halt(); u32 oldcpsr = cpu->CPSR; diff --git a/src/debug/GdbStub.h b/src/debug/GdbStub.h index 99b88158..6461a354 100644 --- a/src/debug/GdbStub.h +++ b/src/debug/GdbStub.h @@ -152,6 +152,7 @@ public: int RespFmt(const char* fmt, ...); int RespStr(const char* str); + inline bool IsConnected() { return ConnFd > 0; } private: void Disconnect();