From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16585 invoked by alias); 29 Nov 2013 13:47:49 -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 16574 invoked by uid 89); 29 Nov 2013 13:47:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.3 required=5.0 tests=AWL,BAYES_50,RDNS_NONE,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from Unknown (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 29 Nov 2013 13:47:23 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rATDlE1d015213 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 29 Nov 2013 08:47:14 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id rATDlCq5001485; Fri, 29 Nov 2013 08:47:13 -0500 Message-ID: <52989AE0.2000008@redhat.com> Date: Fri, 29 Nov 2013 14:27: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] Delegate to target_ops->beneath to read cache lines References: <1385554824-7159-1-git-send-email-yao@codesourcery.com> <5295F877.3060004@redhat.com> <52980180.1050000@codesourcery.com> <529883D7.3030606@redhat.com> <52989668.3030604@codesourcery.com> In-Reply-To: <52989668.3030604@codesourcery.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-11/txt/msg00904.txt.bz2 On 11/29/2013 01:28 PM, Yao Qi wrote: > The endless recursion I saw yesterday is that both current_target.to_xfer_partial > and current_target.beneath->to_xfer_partial are core_xfer_partial. Looks > like it delegates to "itself", and causes an endless recursion, so I use > current_target.beneath instead of ¤t_target. I may mess up > something then. Not really. to_xfer_partial is not INHERITed in update_current_target. current_target.to_xfer_partial is set to current_xfer_partial, which always delegates to current_target.beneath. Even it is was inherited, I don't think we'd recurse forever, because although the callback would be the same, the target_ops instances are not. It's just that core_xfer_partial would end up unnecessarily being called twice, before reaching the the exec target: current_target.to_xfer_partial ==> core_xfer_partial (squashed target, returns 0, try beneath) current_target.beneath->to_xfer_partial ==> core_xfer_partial (corelow target, returns 0, try beneath) current_target.beneath->beneath->to_xfer_partial ==> exec_xfer_partial (exec target, returns != 0) (This is all less clear than it should be; I think Tromey's target delegation method patch should set us in the direction of making these things a little clearer.) -- Pedro Alves