/* Parse the F reply packet and extract the return value and an ErrNo if it exists. */
INTN GdbParseFReplyPacket(IN CHAR8 *Packet, OUT UINTN *ErrNo)
/* Parse the F reply packet and extract the return value and an ErrNo if it exists. */
INTN GdbParseFReplyPacket(IN CHAR8 *Packet, OUT UINTN *ErrNo)
{
  INTN  RetCode;
  if (Packet[0] != 'F') {
    return -1;
  }
  RetCode = AsciiStrHexToUintn (&Packet[1]);
  for ( ; *Packet != '\0' && *Packet != ','; Packet++) {
  }
  if (*Packet == '\0') {
    *ErrNo = 0;
    return RetCode;
  }
  *ErrNo = AsciiStrHexToUintn (++Packet);
  for ( ; *Packet != '\0' && *Packet != ','; Packet++) {
  }
  if (*Packet == '\0') {
    return RetCode;
  }
  if (*(++Packet) == 'C') {
    GdbCtrlCBreakMessage (*ErrNo);
  }
  return RetCode;
}