From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 56484 invoked by alias); 11 Mar 2015 11:35:16 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 56475 invoked by uid 89); 11 Mar 2015 11:35:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 11 Mar 2015 11:35:15 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t2BBZC1n025130 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 11 Mar 2015 07:35:12 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2BBZAQQ000837; Wed, 11 Mar 2015 07:35:11 -0400 Message-ID: <5500286E.6030304@redhat.com> Date: Wed, 11 Mar 2015 11:35:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Gary Benson , gdb-patches@sourceware.org CC: Eli Zaretskii Subject: Re: [PATCH 2/3 v2] Implement vFile:fstat: packet in gdbserver References: <54FF3878.8050202@redhat.com> <1426070029-969-1-git-send-email-gbenson@redhat.com> In-Reply-To: <1426070029-969-1-git-send-email-gbenson@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-03/txt/msg00279.txt.bz2 On 03/11/2015 10:33 AM, Gary Benson wrote: > --- a/gdb/doc/gdb.texinfo > +++ b/gdb/doc/gdb.texinfo > @@ -36062,6 +36062,11 @@ These are the currently defined stub features and their properties: > @tab @samp{-} > @tab No > > +@item @samp{vFile:fstat} > +@tab No > +@tab @samp{-} > +@tab Yes > + > @end multitable > > These are the currently defined stub features, in more detail: > @@ -36250,6 +36255,9 @@ 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. > + Thanks, combined with the "set remote ..." bit, I think that was all that was missing. > @end table > > @item qSymbol:: > @@ -37411,6 +37419,13 @@ packet is used. @samp{vFile:write} returns the number of bytes written, > which may be shorter than the length of @var{data}, or -1 if an > error occurred. > > +@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}. > + I still think that we should mention the need for the qSupported feature here. This is because the other vFile:XXX packets don't have associated qSupported features - GDB just tries them out and detects empty response (probes them). For example for the recent "swbreak" feature, I added: The remote stub must also supply the appropriate @samp{qSupported} feature indicating support. > + > + remote_fileio_to_fio_stat (&st, &fst); > + > + bytes_sent = hostio_reply_with_data (own_buf, > + (char *) &fst, sizeof (fst), > + new_packet_len); > + > + /* If the response does not fit into a single packet, do not attempt > + to return a partial response, but simply fail. */ > + if (bytes_sent < sizeof (fst)) > + sprintf (own_buf, "F-1,%x", FILEIO_ENOSYS); It occurred to me that this -1 case isn't really an error with the syscall, but rather a protocol error. Thus, shouldn't this really be an RSP E01 error ? Thanks, Pedro Alves