From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2259 invoked by alias); 21 Mar 2014 11:56:41 -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 2164 invoked by uid 89); 21 Mar 2014 11:56:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 21 Mar 2014 11:56:37 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s2LBuZE0023666 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 21 Mar 2014 07:56:35 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s2LBuY4k014760; Fri, 21 Mar 2014 07:56:34 -0400 Message-ID: <532C28F1.5040705@redhat.com> Date: Fri, 21 Mar 2014 11:56:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Yao Qi CC: gdb-patches@sourceware.org Subject: Re: [PATCH 1/3] Move the traceframe_available_memory code from memory_xfer_partial_1 down to the targets References: <1394541731-27486-1-git-send-email-yao@codesourcery.com> In-Reply-To: <1394541731-27486-1-git-send-email-yao@codesourcery.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-03/txt/msg00518.txt.bz2 On 03/11/2014 12:42 PM, Yao Qi wrote: > (remote_read_bytes): Moved from memory_xfer_partial_1. Say: (remote_read_bytes): New, factored out from memory_xfer_partial_1. > @@ -6847,6 +6928,63 @@ remote_read_bytes (CORE_ADDR memaddr, gdb_byte *myaddr, ULONGEST len, > if (len == 0) > return 0; > > + if (get_traceframe_number () != -1) > + { > + VEC(mem_range_s) *available; > + > + /* If we fail to get the set of available memory, then the > + target does not support querying traceframe info, and so we > + attempt reading from the traceframe anyway (assuming the > + target implements the old QTro packet then). */ > + if (traceframe_available_memory (&available, memaddr, len)) > + { > + struct cleanup *old_chain; > + > + old_chain = make_cleanup (VEC_cleanup(mem_range_s), &available); > + > + if (VEC_empty (mem_range_s, available) > + || VEC_index (mem_range_s, available, 0)->start != memaddr) > + { > + enum target_xfer_status res; > + > + /* Don't read into the traceframe's available > + memory. */ > + if (!VEC_empty (mem_range_s, available)) > + { > + LONGEST oldlen = len; > + > + len = VEC_index (mem_range_s, available, 0)->start - memaddr; > + gdb_assert (len <= oldlen); > + } > + > + do_cleanups (old_chain); > + > + /* This goes through the topmost target again. */ > + res = memory_xfer_live_readonly_partial (&remote_ops, This "&remote_ops" here will be wrong in case we're connected with extended-remote. Looks like remote_read_bytes needs to be gain an ops parameter. Otherwise looks good. Thanks, -- Pedro Alves