From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 986 invoked by alias); 29 Nov 2013 13:30:28 -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 889 invoked by uid 89); 29 Nov 2013 13:30:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=3.2 required=5.0 tests=AWL,BAYES_50,GARBLED_BODY,RDNS_NONE autolearn=no version=3.3.2 X-HELO: relay1.mentorg.com Received: from Unknown (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 29 Nov 2013 13:30:03 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1VmO8g-0003UA-0a from Yao_Qi@mentor.com ; Fri, 29 Nov 2013 05:29:46 -0800 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 29 Nov 2013 05:29:45 -0800 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.2.247.3; Fri, 29 Nov 2013 05:28:52 -0800 Message-ID: <52989668.3030604@codesourcery.com> Date: Fri, 29 Nov 2013 14:00: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] 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> In-Reply-To: <529883D7.3030606@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2013-11/txt/msg00903.txt.bz2 On 11/29/2013 08:08 PM, Pedro Alves wrote: > Hmm, that's not what I recall and documented in > target_read_memory, etc. > > /* Dispatch to the topmost target, not the flattened current_target. > Memory accesses check target->to_has_(all_)memory, and the > flattened target doesn't inherit those. */ > > And indeed, if I tweak the patch to drop that hunk, > that's still what I see. What recursion did you see? I can see a segmentation fault instead of a endless recursion today :-/ (top-gdb) n 1420 if (ops->to_has_all_memory (ops)) (top-gdb) p ops->to_has_all_memory $13 = (int (*)(struct target_ops *)) 0x0 (top-gdb) p current_target.to_has_all_memory $14 = (int (*)(struct target_ops *)) 0x0 The quoted documentation correctly explainss the behaviour here. 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. > Note that using ¤t_target in dcache_read_line will cause an > endless recursion, so I change it to current_target.beneath. IMO, > other ¤t_target usages should be changed to > current_target.beneath too. I'll get rid of it from commit log. -- Yao (齐尧)