This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 3/3 v3] Implement remote_bfd_iovec_stat using vFile:fstat
- From: Pedro Alves <palves at redhat dot com>
- To: Gary Benson <gbenson at redhat dot com>, gdb-patches at sourceware dot org
- Date: Tue, 10 Mar 2015 18:31:31 +0000
- Subject: Re: [PATCH 3/3 v3] Implement remote_bfd_iovec_stat using vFile:fstat
- Authentication-results: sourceware.org; auth=none
- References: <1425986407-18203-1-git-send-email-gbenson at redhat dot com> <1426002678-30472-1-git-send-email-gbenson at redhat dot com>
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