GDBServer: Preserve unchanged resume state

Avoid calling SetPC when an address-qualified continue or single-step
names the CPU's current PC. The next instruction is already prefetched
at that address, and rebuilding the pipeline would incorrectly discard
pending load and branch-delay state.
pull/3782/head
Stenzek 2 months ago
parent a36b75716a
commit c7324e3333
No known key found for this signature in database

@ -316,7 +316,7 @@ bool GDBServer::Cmd$c(ClientSocket* client, std::string_view data)
}
client->SendAck();
if (address.has_value())
if (address.has_value() && address.value() != CPU::g_state.pc)
CPU::SetPC(address.value());
System::PauseSystem(false);
return true;
@ -334,7 +334,7 @@ bool GDBServer::Cmd$s(ClientSocket* client, std::string_view data)
}
client->SendAck();
if (address.has_value())
if (address.has_value() && address.value() != CPU::g_state.pc)
CPU::SetPC(address.value());
System::SingleStepCPU();
return true;

Loading…
Cancel
Save