From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29751 invoked by alias); 7 Feb 2014 02:11:20 -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 29740 invoked by uid 89); 7 Feb 2014 02:11:18 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=1.6 required=5.0 tests=AWL,BAYES_00,GARBLED_BODY autolearn=no 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, 07 Feb 2014 02:11:18 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1WBauP-0002OC-VM from Yao_Qi@mentor.com ; Thu, 06 Feb 2014 18:11:14 -0800 Received: from SVR-ORW-FEM-04.mgc.mentorg.com ([147.34.97.41]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Thu, 6 Feb 2014 18:11:13 -0800 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.2.247.3; Thu, 6 Feb 2014 18:11:12 -0800 Message-ID: <52F4403E.8030202@codesourcery.com> Date: Fri, 07 Feb 2014 02:11:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Pedro Alves CC: Subject: Re: [PATCH 5/6] Return target_xfer_status in to_xfer_partial References: <1391139325-2758-1-git-send-email-yao@codesourcery.com> <1391139325-2758-6-git-send-email-yao@codesourcery.com> <52F39FD8.2070507@redhat.com> In-Reply-To: <52F39FD8.2070507@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2014-02/txt/msg00181.txt.bz2 On 02/06/2014 10:44 PM, Pedro Alves wrote: >> -static LONGEST >> > +static enum target_xfer_status >> > target_read_live_memory (enum target_object object, >> > - ULONGEST memaddr, gdb_byte *myaddr, ULONGEST len) >> > + ULONGEST memaddr, gdb_byte *myaddr, ULONGEST len, >> > + ULONGEST *xfered_len) >> > { >> > - LONGEST ret; >> > + enum target_xfer_status ret; >> > struct cleanup *cleanup; >> > >> > /* Switch momentarily out of tfind mode so to access live memory. >> > @@ -1326,8 +1327,8 @@ target_read_live_memory (enum target_object object, >> > cleanup = make_cleanup_restore_traceframe_number (); >> > set_traceframe_number (-1); >> > >> > - ret = target_read (current_target.beneath, object, NULL, >> > - myaddr, memaddr, len); >> > + ret = target_xfer_partial (current_target.beneath, object, NULL, >> > + myaddr, NULL, memaddr, len, xfered_len); > This doesn't seem equivalent? > We added 'xfered_len' to target_read_live_memory, so we don't have to call target_read which tries to read all the requested data once. Instead, we call target_xfer_partial here which stores the length of transferred data in *xfered_len and target_xfer_partial here fits in the new target xfer infrastructure. -- Yao (齐尧)