From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27603 invoked by alias); 18 Jul 2011 18:06:50 -0000 Received: (qmail 27595 invoked by uid 22791); 18 Jul 2011 18:06:49 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 18 Jul 2011 18:06:33 +0000 Received: from wpaz5.hot.corp.google.com (wpaz5.hot.corp.google.com [172.24.198.69]) by smtp-out.google.com with ESMTP id p6II6WkO016112 for ; Mon, 18 Jul 2011 11:06:32 -0700 Received: from gxk8 (gxk8.prod.google.com [10.202.11.8]) by wpaz5.hot.corp.google.com with ESMTP id p6II6FEp004277 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Mon, 18 Jul 2011 11:06:31 -0700 Received: by gxk8 with SMTP id 8so1715821gxk.23 for ; Mon, 18 Jul 2011 11:06:31 -0700 (PDT) Received: by 10.150.203.11 with SMTP id a11mr5895216ybg.202.1311012391150; Mon, 18 Jul 2011 11:06:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.151.48.15 with HTTP; Mon, 18 Jul 2011 11:06:01 -0700 (PDT) In-Reply-To: References: <20110715180748.A0390190BC2@elbrus2.mtv.corp.google.com> From: Paul Pluzhnikov Date: Mon, 18 Jul 2011 19:01:00 -0000 Message-ID: Subject: Re: [RFC] Make target_read_string faster over high-latency links. To: Tom Tromey Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-IsSubscribed: yes 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 X-SW-Source: 2011-07/txt/msg00429.txt.bz2 On Mon, Jul 18, 2011 at 10:09 AM, Tom Tromey wrote: > Paul> 2. Current target_read_string aligns reads on a 4-byte boundary. Co= de > Paul> =A0 =A0could be simplified quite a bit if it didn't do that. > Paul> =A0 =A0Are there targets where such alignment is required? > > I don't know this either, sorry. In gdb.texinfo, Node Packets: @item m @var{addr},@var{length} @cindex @samp{m} packet Read @var{length} bytes of memory starting at address @var{addr}. Note that @var{addr} may not be aligned to any particular boundary. I *think* this suggests that alignment is not really necessary here. > What about making it possible for gdbserver to do the string-reading > itself, with a fallback to the existing code for older versions? =A0Then > you don't need a parameter or any tuning. Just to clarify, you are suggesting a new packet, e.g. qStr {addr},{maxlen} in response to which gdbserver will read up to either terminating NUL, or maxlen. That sounds like a good idea, except I would also add {terminator} byte, so you could read "memory from addr to {terminator} but no more than {maxlen}". Terminator could be optional. Don't know if it's really necessary, but it could come in handy if you want to read up to '\n' or some such. Thanks, --=20 Paul Pluzhnikov