From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 94766 invoked by alias); 27 May 2016 08:35:37 -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 94749 invoked by uid 89); 27 May 2016 08:35:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2324, life, responses, HX-HELO:eggs.gnu.org X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 27 May 2016 08:35:25 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6DEl-00078q-2y for gdb-patches@sourceware.org; Fri, 27 May 2016 04:35:23 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:50424) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6DEk-00078g-VR; Fri, 27 May 2016 04:35:19 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3068 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1b6DEk-0002pZ-5n; Fri, 27 May 2016 04:35:18 -0400 Date: Fri, 27 May 2016 08:35:00 -0000 Message-Id: <83k2if290w.fsf@gnu.org> From: Eli Zaretskii To: David Taylor CC: gdb-patches@sourceware.org In-reply-to: <25526.1464294807@usendtaylorx2l> (message from David Taylor on Thu, 26 May 2016 16:33:27 -0400) Subject: Re: [PATCH] Document short responses to qXfer:object:read. Reply-to: Eli Zaretskii References: <25526.1464294807@usendtaylorx2l> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-IsSubscribed: yes X-SW-Source: 2016-05/txt/msg00478.txt.bz2 > From: David Taylor > cc: gdb-patches@sourceware.org, dtaylor@emc.com > Date: Thu, 26 May 2016 16:33:27 -0400 > > The qXfer:object:read packet contains an offset and a length. It says > for , starting at offset , send me characters. > > When 'reading' object , GDB starts at offset 0 and sends > qXfer::read packets with progressively higher offsets until it > gets everything. > > If it was a file, then a read of less than the requested amount (aka a > short read) would be interpreted as having reached the end of the file. > > These objects aren't really files. And returning less than requested > does not mean that the end of the object has been reached. > > GDB's next 'read' from 'object' will be at offset > > + > > NOT at > > + > > The fact that sending back less than requested is okay (i.e., does not > say to GDB -- hey, that's it, there is no more) and that the next > request starts where the last response ended (i.e., offset + returned > amount) rather than where the last request ended (i.e., offset + > requested amount) makes life easier on the remote stub implementer. > > Hope that clarifies somewhat. It very much does, thanks. I have 3 follow-up questions: . It's not clear to me what is the "returned amount" here, as the listed responses for this packet don't seem to provide the amount of data in the response. Do you mean the length of the data in the "m DATA" or "l DATA" responses, counted in bytes? . What is a zero-length response? Is that "l" without data? . If my interpretation of the above 2 issues is correct, then why do we need this new text you suggest? The 'm' and 'l' responses already say that the data can be shorter than the request, which seems to be what the new text says. Finally, it looks to me that we should move the description of the responses to precede the details of the 'read' requests, since the list of those requests is very long, and thus the promised description of the responses "below" is very far away, which IMO gets in the way of reading and comprehending the issue. > Now, can we come up with better wording? After we've figured out the above left-overs, sure. Thanks.