From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta040.useast.a.cloudfilter.net (omta040.useast.a.cloudfilter.net [44.202.169.39]) by sourceware.org (Postfix) with ESMTPS id 8D631385770D for ; Wed, 13 Mar 2024 19:27:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8D631385770D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8D631385770D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.39 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710358027; cv=none; b=s3E70rEYx56pmlDtj+K8ck2LIlAmnc5Am/ed6pKOr3BRGNB6zKu6E5pkgTBqImnFl42qNA8auRptJ3hmU2g8TuQRtqQMWAcx3cp1by5IEyKUqI/Tx3CJcNMdTZVpE9WdPn//3ft22I8Jt6MHSKSvYGDaC7s9ArBixMAwPocvL9k= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710358027; c=relaxed/simple; bh=YsDgQa5ugKU2gcPzgSx3AtMV/WVt2oOGa4xQTYfgj4Q=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=kWxUKZ4GQTn4JC+v+nQW3VuedxMvJI3WG0L5IwW3MPR2hQNF+5Q4YTYExIbij3p9a3borbw3M7sOKDBOwCYRtklyrvXkeR/+1+1koBgBbYFDvthE6U2bY1+fwY+0Z0pp/ZufCa4B5WngVaDSsZxD9UN9ca59+R+yBH13jyb5wlc= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-5009a.ext.cloudfilter.net ([10.0.29.176]) by cmsmtp with ESMTPS id kN7frtbp7l9dRkUFlrKWxn; Wed, 13 Mar 2024 19:27:05 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id kUFkrqMjynAD0kUFkrTEAW; Wed, 13 Mar 2024 19:27:05 +0000 X-Authority-Analysis: v=2.4 cv=E4TLp7dl c=1 sm=1 tr=0 ts=65f1fe09 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=K6JAEmCyrfEA:10 a=Qbun_eYptAEA:10 a=QyXUC8HyAAAA:8 a=CCpqsmhAAAAA:8 a=WB1lI-SiL6daetv8DbQA:9 a=ul9cdbp4aOFLsgKbc677:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=MNzvDcG5iEWi+MxOOpS/MvRarKerAFlKucPJThz7D8A=; b=vwB2HG5r4vqw8QHW3a9qabx/1X AAI9J5xvNJNE69j2soJM0Nx59bHkAabjQ6KiOR1DttKGtQ/mhi14xD/bbaKIYUyHa0eo/QYT0GnaZ 3mG83W6f1p2TNAAJ6mASJ2cm7; Received: from 97-122-82-115.hlrn.qwest.net ([97.122.82.115]:50408 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1rkUFk-002uZv-0z; Wed, 13 Mar 2024 13:27:04 -0600 From: Tom Tromey To: Tankut Baris Aktemur Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 3/3] gdb, gdbserver: introduce the 'x' RSP packet for binary memory read References: <990be8b42f1f6ca33ffed7a8ae7ead327009d847.1710343840.git.tankut.baris.aktemur@intel.com> X-Attribution: Tom Date: Wed, 13 Mar 2024 13:27:03 -0600 In-Reply-To: <990be8b42f1f6ca33ffed7a8ae7ead327009d847.1710343840.git.tankut.baris.aktemur@intel.com> (Tankut Baris Aktemur's message of "Wed, 13 Mar 2024 16:35:45 +0100") Message-ID: <87h6halypk.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.82.115 X-Source-L: No X-Exim-ID: 1rkUFk-002uZv-0z X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-82-115.hlrn.qwest.net (murgatroyd) [97.122.82.115]:50408 X-Source-Auth: tom+tromey.com X-Email-Count: 6 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfJWi4pqMwLcBcTPuh0gwXHLNeidu1tifoBa0fYgIE63JaeDmb6I9ia+/5rUT4AnEbvvGBjMop/TgZIae+hm84BYrpxysIyUoVjYWGcrrdezfU5Wga0OK o+vAf8xhV62mI1ljvYKuQ8j45lAsEbLbnPXwGXlhyyD3oN241aMMNjvVH4UZ2+XMMKHxWA1EalbhdkQjtykdVUmOorOd4HLd7D8= X-Spam-Status: No, score=-3015.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: >>>>> Tankut Baris Aktemur writes: > Introduce an RSP packet, 'x', for reading from the remote server > memory in binary format. The binary write packet, 'X' already exists. > The 'x' packet is essentially the same as 'm', except that the > returned data is in binary format. For transferring relatively large > data (e.g. shared library files), the 'x' packet can reduce the > transfer costs. Thanks for the patch. I agree with the overall idea and the choice of 'x' as the packet. > +@item x @var{addr},@var{length} > +@anchor{x packet} > +@cindex @samp{x} packet > +Read @var{length} addressable memory units starting at address @var{addr} > +(@pxref{addressable memory unit}). Note that @var{addr} may not be aligned > +to any particular boundary. I think it would be good to address the "short read" request here: https://sourceware.org/bugzilla/show_bug.cgi?id=24751 that is, document what ought to happen in this case. Now that 'E' must be quoted in binary packets, I think the "binary data" section of the "Overview" node must be updated to mention that certain replies -- and in particular this one -- must handle this properly. > + /* Determine which packet format to use. */ > + char packet_format = 'm'; > +DIAGNOSTIC_PUSH > +DIAGNOSTIC_ERROR_SWITCH > + switch (m_features.packet_support (PACKET_x)) > + { > + case PACKET_ENABLE: > + packet_format = 'x'; > + break; > + case PACKET_DISABLE: > + packet_format = 'm'; > + break; > + case PACKET_SUPPORT_UNKNOWN: > + internal_error (_("remote_read_bytes_1: bad internal state")); > + } > +DIAGNOSTIC_POP Can this possibly be done without the diagnostic stuff. > + /* Binary memory read support. */ > + strcat (own_buf, ";x+"); One thing I don't really know about the remote protocol is whether we prefer to add advertised features (like this) or just have gdb probe. > + suppress_next_putpkt_log (); Ok, I guess I see why you did it this way now. You can ignore that earlier comment I guess. Tom