gdb: simply gdbstate
This commit is contained in:
@@ -178,7 +178,6 @@ void GDB_DetachFromProcess(GDBContext *ctx)
|
||||
ctx->nbThreads = 0;
|
||||
ctx->totalNbCreatedThreads = 0;
|
||||
memset(ctx->threadInfos, 0, sizeof(ctx->threadInfos));
|
||||
ctx->catchThreadEvents = false;
|
||||
}
|
||||
|
||||
GDB_DECLARE_HANDLER(Unsupported)
|
||||
|
||||
@@ -141,7 +141,7 @@ int GDB_ReceivePacket(GDBContext *ctx)
|
||||
return -1;
|
||||
if(ctx->buffer[0] == '+') // GDB sometimes acknowleges TCP acknowledgment packets (yes...). IDA does it properly
|
||||
{
|
||||
if(ctx->state == GDB_STATE_NOACK)
|
||||
if(ctx->flags & GDB_FLAG_NOACK)
|
||||
return -1;
|
||||
|
||||
// Consume it
|
||||
@@ -193,7 +193,7 @@ int GDB_ReceivePacket(GDBContext *ctx)
|
||||
ctx->commandEnd = ctx->buffer;
|
||||
}
|
||||
|
||||
if(ctx->state >= GDB_STATE_CONNECTED && ctx->state < GDB_STATE_NOACK)
|
||||
if(!(ctx->flags & GDB_FLAG_NOACK))
|
||||
{
|
||||
int r2 = soc_send(ctx->super.sockfd, "+", 1, 0);
|
||||
if(r2 != 1)
|
||||
@@ -201,12 +201,12 @@ int GDB_ReceivePacket(GDBContext *ctx)
|
||||
}
|
||||
|
||||
if(ctx->state == GDB_STATE_NOACK_SENT)
|
||||
ctx->state = GDB_STATE_NOACK;
|
||||
ctx->flags |= GDB_FLAG_NOACK;
|
||||
|
||||
return r;
|
||||
|
||||
packet_error:
|
||||
if(ctx->state >= GDB_STATE_CONNECTED && ctx->state < GDB_STATE_NOACK)
|
||||
if(!(ctx->flags & GDB_FLAG_NOACK))
|
||||
{
|
||||
r = soc_send(ctx->super.sockfd, "-", 1, 0);
|
||||
if(r != 1)
|
||||
|
||||
@@ -205,6 +205,9 @@ void GDB_ReleaseClient(GDBServer *server, GDBContext *ctx)
|
||||
ctx->enableExternalMemoryAccess = false;
|
||||
ctx->flags = (GDBFlags)0;
|
||||
ctx->state = GDB_STATE_DISCONNECTED;
|
||||
|
||||
ctx->catchThreadEvents = false;
|
||||
|
||||
RecursiveLock_Unlock(&ctx->lock);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user