fix gdb stub causing the emulator to hang on undefined instructions (#2054)

* dont hang on undefined instruction

* Add spaces

---------

Co-authored-by: Kemal Afzal <RSDuck@users.noreply.github.com>
This commit is contained in:
Jakly 2024-08-01 16:48:52 -04:00 committed by GitHub
parent 161bd9d3d2
commit 12be06beb6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -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;

View File

@ -152,6 +152,7 @@ public:
int RespFmt(const char* fmt, ...);
int RespStr(const char* str);
inline bool IsConnected() { return ConnFd > 0; }
private:
void Disconnect();