From patchwork Fri Aug 8 05:49:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 2351 Received: (qmail 6527 invoked by alias); 8 Aug 2014 05:54:26 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 6516 invoked by uid 89); 8 Aug 2014 05:54:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 08 Aug 2014 05:54:23 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1XFd88-0003WJ-7b from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Thu, 07 Aug 2014 22:54:20 -0700 Received: from SVR-ORW-FEM-06.mgc.mentorg.com ([147.34.97.120]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 7 Aug 2014 22:54:20 -0700 Received: from qiyao.dyndns.org.com (147.34.91.1) by SVR-ORW-FEM-06.mgc.mentorg.com (147.34.97.120) with Microsoft SMTP Server id 14.2.247.3; Thu, 7 Aug 2014 22:54:19 -0700 From: Yao Qi To: Subject: [PATCH] Fix PR remote/9053: remove dead code on query packet size Date: Fri, 8 Aug 2014 13:49:46 +0800 Message-ID: <1407476986-24777-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 X-IsSubscribed: yes The code becomes dead as GDB evolves. In 2003, Andrew Cagney post patch https://sourceware.org/ml/gdb-patches/2003-10/msg00511.html to add target read/write partial methods. They support query buffer size when both OFFSET and LEN is zero, and it was used in avr-tdep.c and kod.c. Then, Daniel added target_read_object_alloc and avr-tdep.c switches to use that in patch https://sourceware.org/ml/gdb-patches/2006-07/msg00009.html From then on, GDB on longer queries the buffer size, so the code returning packet size in remote_xfer_partial became dead. PR 17060 is duplicated of PR 9053, so I mention the latter in the ChangeLog entry. Rebuild GDB with this patch. OK to apply? I'll mark PR 17060 as duplicated once the patch is applied. gdb: 2014-08-08 Yao Qi PR remote/9053 * remote.c (remote_xfer_partial): Remove dead code. --- gdb/remote.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/gdb/remote.c b/gdb/remote.c index 473bb72..357e9f2 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -8863,10 +8863,6 @@ remote_xfer_partial (struct target_ops *ops, enum target_object object, return TARGET_XFER_E_IO; } - /* Note: a zero OFFSET and LEN can be used to query the minimum - buffer size. */ - if (offset == 0 && len == 0) - return (get_remote_packet_size ()); /* Minimum outbuf size is get_remote_packet_size (). If LEN is not large enough let the caller deal with it. */ if (len < get_remote_packet_size ())