From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 43020 invoked by alias); 11 Mar 2015 11:22:22 -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 42992 invoked by uid 89); 11 Mar 2015 11:22:21 -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,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:22:20 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t2BBMJci025454 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 11 Mar 2015 07:22:19 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2BBMHn4002140; Wed, 11 Mar 2015 07:22:18 -0400 Message-ID: <55002568.1050305@redhat.com> Date: Wed, 11 Mar 2015 11:22: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 CC: gdb-patches@sourceware.org Subject: Re: [PATCH 3/3 v3] Implement remote_bfd_iovec_stat using vFile:fstat References: <1425986407-18203-1-git-send-email-gbenson@redhat.com> <1426002678-30472-1-git-send-email-gbenson@redhat.com> <54FF39AD.2040707@redhat.com> <20150311102310.GB3698@blade.nx> In-Reply-To: <20150311102310.GB3698@blade.nx> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-03/txt/msg00276.txt.bz2 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