Skip to content

Commit

Permalink
fix gdb stub causing the emulator to hang on undefined instructions (#…
Browse files Browse the repository at this point in the history
…2054)

* dont hang on undefined instruction

* Add spaces

---------

Co-authored-by: Kemal Afzal <[email protected]>
  • Loading branch information
Jaklyy and RSDuck authored Aug 1, 2024
1 parent 161bd9d commit 12be06b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ARMInterpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/debug/GdbStub.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ class GdbStub
int RespFmt(const char* fmt, ...);

int RespStr(const char* str);
inline bool IsConnected() { return ConnFd > 0; }

private:
void Disconnect();
Expand Down

0 comments on commit 12be06b

Please sign in to comment.