/* Reads the n-th register's value into an output buffer and sends it as a packet  */
VOID ReadNthRegister(IN EFI_SYSTEM_CONTEXT SystemContext, IN CHAR8 *InBuffer)
/* Reads the n-th register's value into an output buffer and sends it as a packet  */
VOID ReadNthRegister(IN EFI_SYSTEM_CONTEXT SystemContext, IN CHAR8 *InBuffer)
{
  UINTN  RegNumber;
  CHAR8  OutBuffer[9];
  CHAR8  *OutBufPtr;
  RegNumber = AsciiStrHexToUintn (&InBuffer[1]);
  if (RegNumber >= MaxRegisterCount ()) {
    SendError (GDB_EINVALIDREGNUM);
    return;
  }
  OutBufPtr = OutBuffer;
  OutBufPtr = BasicReadRegister (SystemContext, RegNumber, OutBufPtr);
  *OutBufPtr = '\0';
  SendPacket (OutBuffer);
}