/* Transfer length bytes of input buffer, starting at Address, to memory. */
VOID TransferFromInBufToMem(IN UINTN Length, IN unsigned char *Address, IN CHAR8 *NewData)
/* Transfer length bytes of input buffer, starting at Address, to memory. */
VOID TransferFromInBufToMem(IN UINTN Length, IN unsigned char *Address, IN CHAR8 *NewData)
{
  CHAR8  c1;
  CHAR8  c2;
  while (Length-- > 0) {
    c1 = (CHAR8)HexCharToInt (*NewData++);
    c2 = (CHAR8)HexCharToInt (*NewData++);
    if ((c1 < 0) || (c2 < 0)) {
      Print ((CHAR16 *)L"Bad message from write to memory..\n");
      SendError (GDB_EBADMEMDATA);
      return;
    }
    *Address++ = (UINT8)((c1 << 4) + c2);
  }
  SendSuccess ();
}