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>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 11 Mar 2015 11:22:16 +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> <54FF39AD dot 2040707 at redhat dot com> <20150311102310 dot GB3698 at blade dot nx>
On 03/11/2015 10:23 AM, Gary Benson wrote:
> Pedro Alves wrote:
>>> + if (packet_support (PACKET_vFile_fstat) != PACKET_ENABLE)
>>> + {
>>> + memset (st, 0, sizeof (struct stat));
>>> + st->st_size = INT_MAX;
>>
>> A future reader may wonder why this isn't ENOSYS instead. I think
>> a comment here would help.
>
> How about this:
>
> /* Strictly we should return -1, ENOSYS here, but when
> "set sysroot remote:" was implemented in August 2008
> BFD's need for a stat function was sidestepped with
> this hack. This was not remedied until March 2015
> so we retain the previous behavior to avoid breaking
> compatibility.
>
> Note that the memset is a March 2015 addition; older
> GDBs set st_size *and nothing else* so the structure
> would have garbage in all other fields. This might
> break something but retaining the previous behavior
> here would be just too wrong. */
Thanks.
It also occurred to me something else on the gdbserver patch.
I'll send a follow up.
> Are you ok for me to commit this patch, reordered before the
> gdbserver changes, with extract_unsigned_integer used in
> remote_fileio_to_host_{uint,ulong}, and that comment added?
It be easier for me to just see the patch before answering, but
I think I am, though I'd like to take another look at the docs
patch with everything combined, to cross check whether more
bits would be missing.
I think it'd be good to have a "RSP packets: how to add / best practices
how to document" wiki page/guide, serving as both guidance for
submitters and for cross checking for reviewers, mentioning
things like remembering to document the "set remote foo commands",
qSupported entries, NEWS, etc.
> (I will regenerate patch 2 with updated docs for Eli to
> approve).
Thanks,
Pedro Alves