mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-10 14:39:01 +01:00
GDB Stub: do not send a packet when we just connected
This commit is contained in:
parent
85d2ea0dd2
commit
4b131bf1ce
@ -136,6 +136,7 @@ void Run()
|
||||
state_lock.unlock();
|
||||
if (GDBStub::IsActive() && GDBStub::HasControl())
|
||||
{
|
||||
if (!GDBStub::JustConnected())
|
||||
GDBStub::SendSignal(GDBStub::Signal::Sigtrap);
|
||||
GDBStub::ProcessCommands(true);
|
||||
// If we are still going to step, emulate the fact we just sent a step command
|
||||
|
@ -61,6 +61,7 @@ enum class BreakpointType
|
||||
const s64 GDB_UPDATE_CYCLES = 100000;
|
||||
|
||||
static bool s_has_control = false;
|
||||
static bool s_just_connected = false;
|
||||
|
||||
static int s_tmpsock = -1;
|
||||
static int s_sock = -1;
|
||||
@ -898,6 +899,7 @@ static void HandleRemoveBreakpoint()
|
||||
|
||||
void ProcessCommands(bool loop_until_continue)
|
||||
{
|
||||
s_just_connected = false;
|
||||
while (IsActive())
|
||||
{
|
||||
if (CPU::GetState() == CPU::State::PowerDown)
|
||||
@ -1038,6 +1040,7 @@ static void InitGeneric(int domain, const sockaddr* server_addr, socklen_t serve
|
||||
if (s_sock < 0)
|
||||
ERROR_LOG_FMT(GDB_STUB, "Failed to accept gdb client");
|
||||
INFO_LOG_FMT(GDB_STUB, "Client connected.");
|
||||
s_just_connected = true;
|
||||
|
||||
#ifdef _WIN32
|
||||
closesocket(s_tmpsock);
|
||||
@ -1083,6 +1086,11 @@ void TakeControl()
|
||||
s_has_control = true;
|
||||
}
|
||||
|
||||
bool JustConnected()
|
||||
{
|
||||
return s_just_connected;
|
||||
}
|
||||
|
||||
void SendSignal(Signal signal)
|
||||
{
|
||||
char bfr[128] = {};
|
||||
|
@ -22,6 +22,7 @@ void Deinit();
|
||||
bool IsActive();
|
||||
bool HasControl();
|
||||
void TakeControl();
|
||||
bool JustConnected();
|
||||
|
||||
void ProcessCommands(bool loop_until_continue);
|
||||
void SendSignal(Signal signal);
|
||||
|
Loading…
x
Reference in New Issue
Block a user