Skip to content

Commit b4f55db

Browse files
committed
Implement monitor response as intermediate + OK response
1 parent 4c56e8a commit b4f55db

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

  • DebuggerFeaturePkg/Library/DebugAgent/GdbStub

DebuggerFeaturePkg/Library/DebugAgent/GdbStub/GdbStub.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,9 +580,14 @@ ProcessMonitorCmd (
580580
break;
581581
}
582582

583-
// RCmd commands return hex encoded responses, convert to HEX before sending.
584-
ConvertResponseToHex (&mScratch[0], mResponse, MAX_RESPONSE_SIZE);
583+
// Respond with a intermediate packet, "O[HEX]" follow by an empty "OK" packet
584+
// where the [HEX] is the hex encoding of the response string. The spec is
585+
// vague on the need for this, but this is to be consistent with other GDB stub
586+
// implementations and Windbg expectations.
587+
mResponse[0] = 'O';
588+
ConvertResponseToHex (&mScratch[0], &mResponse[1], MAX_RESPONSE_SIZE - 1);
585589
SendGdbResponse (mResponse);
590+
SendGdbResponse ("OK");
586591
}
587592

588593
/**

0 commit comments

Comments
 (0)