Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Gary Benson <gbenson@redhat.com>, gdb-patches@sourceware.org
Cc: Eli Zaretskii <eliz@gnu.org>
Subject: Re: [PATCH 2/3 v5] Implement remote_bfd_iovec_stat
Date: Wed, 11 Mar 2015 13:52:00 -0000	[thread overview]
Message-ID: <550048B0.8020403@redhat.com> (raw)
In-Reply-To: <1426081190-9381-3-git-send-email-gbenson@redhat.com>

On 03/11/2015 01:39 PM, Gary Benson wrote:
> This patch implements the function remote_bfd_iovec_stat using a
> vFile:fstat hostio call to the remote target.  If vFile:fstat is
> not supported GDB creates a dummy result by zeroing the supplied
> stat structure and then setting it's st_size field to INT_MAX.
> This mimic's GDB's previous behaviour, with the exception that
> GDB did not previously zero the structure so all other fields
> would have been returned unchanged, which is to say very likely
> populated with random values from the stack.

Note this reads as if the packet already existed.  It should
be updated to say something like:

Subject: Add "vFile:fstat:", implement remote_bfd_iovec_stat

This patch adds a new packet "vFile:fstat:" to gdb.
This can be used by to retrieve information about files that have
been previously open with vFile:open.
This patch then implements the function remote_bfd_iovec_stat using a
vFile:fstat hostio call to the remote target.  If vFile:fstat is
not supported GDB creates a dummy result by zeroing the supplied
stat structure and then setting it's st_size field to INT_MAX.
This mimic's GDB's previous behaviour, with the exception that
GDB did not previously zero the structure so all other fields
would have been returned unchanged, which is to say very likely
populated with random values from the stack.

> +@item vFile:fstat: @var{fd}
> +Get information about the open file corresponding to @var{fd}.
> +On success the information is returned as a binary attachment
> +and the return value is the size of this attachment in bytes.
> +If an error occurs the return value is -1.  The format of the
> +returned binary attachment is as described in @ref{struct stat}.
> +
> +This packet is not probed by default; the remote stub must request
> +it, by supplying an appropriate @samp{qSupported} response
> +(@pxref{qSupported}).

Thanks for adding this.  The patch looks great to me now.

Thanks,
Pedro Alves


  reply	other threads:[~2015-03-11 13:52 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-09 11:58 [PATCH 0/3] Properly implement remote_bfd_iovec_stat Gary Benson
2015-03-09 11:58 ` [PATCH 1/3] Move remote_fileio_to_fio_stat to gdb/common Gary Benson
2015-03-10 18:30   ` Pedro Alves
2015-03-09 11:58 ` [PATCH 2/3] Add vFile:fstat: packet to gdbserver Gary Benson
2015-03-10 18:31   ` Pedro Alves
2015-03-11 10:33     ` [PATCH 2/3 v2] Implement vFile:fstat: packet in gdbserver Gary Benson
2015-03-11 11:35       ` Pedro Alves
2015-03-11 16:00       ` Eli Zaretskii
2015-03-09 11:58 ` [PATCH 3/3] Implement remote_bfd_iovec_stat using vFile:fstat Gary Benson
2015-03-09 16:17   ` Eli Zaretskii
2015-03-10  9:32     ` Gary Benson
2015-03-10 16:40       ` Eli Zaretskii
2015-03-10 11:20   ` [PATCH 3/3 v2] " Gary Benson
2015-03-10 15:51     ` [PATCH 3/3 v3] " Gary Benson
2015-03-10 18:31       ` Pedro Alves
2015-03-10 18:36       ` Pedro Alves
2015-03-11 10:23         ` Gary Benson
2015-03-11 11:22           ` Pedro Alves
2015-03-11 12:58             ` [PATCH 3/3 v4] Implement remote_bfd_iovec_stat Gary Benson
2015-03-11 13:15               ` Pedro Alves
2015-03-11 13:16               ` Gary Benson
2015-03-11 13:39                 ` [PATCH 0/3 v2] Gary Benson
2015-03-11 18:04                   ` [PATCH 0/3 v2] Properly implement remote_bfd_iovec_stat Gary Benson
2015-03-11 13:40                 ` [PATCH 1/3] Move remote_fileio_to_fio_stat to gdb/common Gary Benson
2015-03-11 13:40                 ` [PATCH 2/3 v5] Implement remote_bfd_iovec_stat Gary Benson
2015-03-11 13:52                   ` Pedro Alves [this message]
2015-03-11 13:40                 ` [PATCH 3/3 v3] Implement vFile:fstat: packet in gdbserver Gary Benson
2015-03-11 13:53                   ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=550048B0.8020403@redhat.com \
    --to=palves@redhat.com \
    --cc=eliz@gnu.org \
    --cc=gbenson@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox