This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 3/3 v3] Implement remote_bfd_iovec_stat using vFile:fstat


On 03/10/2015 03:51 PM, Gary Benson wrote:
> 
> +
> +/* Unpack an fio_uint_t.  */
> +
> +static unsigned int
> +remote_fileio_to_host_uint (fio_uint_t fnum)
> +{
> +  gdb_byte *buf, *lim;
> +  unsigned int num = 0;
> +
> +  for (buf = (gdb_byte *) fnum, lim = buf + 4; buf < lim; buf++)
> +    {
> +      num <<= 8;
> +      num |= *buf;
> +    }

How about we use

  extract_unsigned_integer ((gdb_byte *) fnum, 4, BFD_ENDIAN_BIG)

instead?

Otherwise looks good.

Thanks,
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]