Reimplement "vFile:fstat" without qSupported

This commit makes support for the "vFile:fstat" packet be detected
by probing rather than using qSupported, for consistency with the
other vFile: packets.

gdb/ChangeLog:

	(remote_protocol_features): Remove the "vFile:fstat" feature.
	(remote_hostio_fstat): Probe for "vFile:fstat" support.

gdb/doc/ChangeLog:

	* gdb.texinfo (General Query Packets): Remove documentation
	for now-removed vFile:fstat qSupported features.

gdb/gdbserver/ChangeLog:

	* server.c (handle_query): Do not report vFile:fstat as supported.
This commit is contained in:
Gary Benson 2015-03-18 11:19:02 +00:00
parent f68f11b76d
commit 464b0089f0
6 changed files with 25 additions and 28 deletions

View File

@ -1,3 +1,8 @@
2015-03-18 Gary Benson <gbenson@redhat.com>
(remote_protocol_features): Remove the "vFile:fstat" feature.
(remote_hostio_fstat): Probe for "vFile:fstat" support.
2015-03-11 Yao Qi <yao.qi@linaro.org>
PR tdep/18107

View File

@ -1,3 +1,8 @@
2015-03-18 Gary Benson <gbenson@redhat.com>
* gdb.texinfo (General Query Packets): Remove documentation
for now-removed vFile:fstat qSupported features.
2015-03-11 Gary Benson <gbenson@redhat.com>
* gdb.texinfo (Remote Configuration): Document the

View File

@ -36062,11 +36062,6 @@ These are the currently defined stub features and their properties:
@tab @samp{-}
@tab No
@item @samp{vFile:fstat}
@tab No
@tab @samp{-}
@tab No
@end multitable
These are the currently defined stub features, in more detail:
@ -36255,9 +36250,6 @@ breakpoints.
The remote stub reports the @samp{hwbreak} stop reason for hardware
breakpoints.
@item vFile:fstat
The remote stub understands the @samp{vFile:fstat} packet.
@end table
@item qSymbol::
@ -37426,10 +37418,6 @@ 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}).
@item vFile:unlink: @var{filename}
Delete the file at @var{filename} on the target. Return 0,
or -1 if an error occurs. The @var{filename} is a string.

View File

@ -1,3 +1,7 @@
2015-03-18 Gary Benson <gbenson@redhat.com>
* server.c (handle_query): Do not report vFile:fstat as supported.
2015-03-11 Gary Benson <gbenson@redhat.com>
* hostio.c (sys/types.h): New include.
@ -5,7 +9,6 @@
(common-remote-fileio.h): Likewise.
(handle_fstat): New function.
(handle_vFile): Handle vFile:fstat packets.
* server.c (handle_query): Report vFile:fstat as supported.
2015-03-11 Gary Benson <gbenson@redhat.com>

View File

@ -2082,8 +2082,6 @@ handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
if (target_supports_stopped_by_hw_breakpoint ())
strcat (own_buf, ";hwbreak+");
strcat (own_buf, ";vFile:fstat+");
return;
}

View File

@ -4049,8 +4049,6 @@ static const struct protocol_feature remote_protocol_features[] = {
PACKET_Qbtrace_conf_bts_size },
{ "swbreak", PACKET_DISABLE, remote_supported_packet, PACKET_swbreak_feature },
{ "hwbreak", PACKET_DISABLE, remote_supported_packet, PACKET_hwbreak_feature },
{ "vFile:fstat", PACKET_DISABLE, remote_supported_packet,
PACKET_vFile_fstat },
};
static char *remote_support_xml;
@ -10084,8 +10082,18 @@ remote_hostio_fstat (struct target_ops *self,
struct fio_stat fst;
int read_len;
if (packet_support (PACKET_vFile_fstat) != PACKET_ENABLE)
remote_buffer_add_string (&p, &left, "vFile:fstat:");
remote_buffer_add_int (&p, &left, fd);
ret = remote_hostio_send_command (p - rs->buf, PACKET_vFile_fstat,
remote_errno, &attachment,
&attachment_len);
if (ret < 0)
{
if (*remote_errno != FILEIO_ENOSYS)
return ret;
/* 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
@ -10104,16 +10112,6 @@ remote_hostio_fstat (struct target_ops *self,
return 0;
}
remote_buffer_add_string (&p, &left, "vFile:fstat:");
remote_buffer_add_int (&p, &left, fd);
ret = remote_hostio_send_command (p - rs->buf, PACKET_vFile_fstat,
remote_errno, &attachment,
&attachment_len);
if (ret < 0)
return ret;
read_len = remote_unescape_input ((gdb_byte *) attachment, attachment_len,
(gdb_byte *) &fst, sizeof (fst));