From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 40036 invoked by alias); 10 Mar 2015 18:31:25 -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 39995 invoked by uid 89); 10 Mar 2015 18:31:24 -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; Tue, 10 Mar 2015 18:31:23 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t2AIVMc5006792 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 10 Mar 2015 14:31:22 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2AIVKXK001867; Tue, 10 Mar 2015 14:31:21 -0400 Message-ID: <54FF3878.8050202@redhat.com> Date: Tue, 10 Mar 2015 18:31:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Gary Benson , gdb-patches@sourceware.org Subject: Re: [PATCH 2/3] Add vFile:fstat: packet to gdbserver References: <1425902299-2151-1-git-send-email-gbenson@redhat.com> <1425902299-2151-3-git-send-email-gbenson@redhat.com> In-Reply-To: <1425902299-2151-3-git-send-email-gbenson@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-03/txt/msg00261.txt.bz2 On 03/09/2015 11:58 AM, Gary Benson wrote: > This patch adds a new packet "vFile:fstat:" to gdbserver. > This can be used by clients to retrieve information about > open files. Nit: Strictly speaking, it's a bit backwards to first add packets to gdbserver that gdb doesn't support. In general, I prefer that the gdb patch lands first, documenting the packets/commands. > > gdb/ChangeLog: > > * NEWS: Announce new vFile:fstat packet. > > gdb/doc/ChangeLog: > > * gdb.texinfo (Host I/O Packets): Document vFile:fstat. These changes above should be in the patch that teaches GDB about the packets. Also, I think you're missing documentation on the qSupported bits. > > gdb/gdbserver/ChangeLog: > > * hostio.c (sys/types.h): New include. > (sys/stat.h): Likewise. > (common-remote-fileio.h): Likewise. > (handle_fstat): New function. > (handle_vFile): Handle vFile:fstat packets. > * server.c (handle_query): Report vFile:fstat as supported. This part looks good. > --- a/gdb/doc/gdb.texinfo > +++ b/gdb/doc/gdb.texinfo > @@ -37407,6 +37407,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}. This should mention/reference the qSupported bit too. Thanks, Pedro Alves