From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15897 invoked by alias); 30 Jul 2013 14:47:31 -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 15888 invoked by uid 89); 30 Jul 2013 14:47:31 -0000 X-Spam-SWARE-Status: No, score=-4.6 required=5.0 tests=AWL,BAYES_05,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RDNS_NONE,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.1 Received: from Unknown (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 30 Jul 2013 14:47:30 +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 r6UElKwc018935 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 30 Jul 2013 10:47:21 -0400 Received: from barimba (ovpn-113-128.phx2.redhat.com [10.3.113.128]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r6UElJno010789 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 30 Jul 2013 10:47:20 -0400 From: Tom Tromey To: "Metzger\, Markus T" Cc: "gdb-patches\@sourceware.org" Subject: Re: [PATCH 2/8] add target method delegation References: <1375116324-32092-1-git-send-email-tromey@redhat.com> <1375116324-32092-3-git-send-email-tromey@redhat.com> Date: Tue, 30 Jul 2013 14:47:00 -0000 In-Reply-To: (Markus T. Metzger's message of "Tue, 30 Jul 2013 14:06:31 +0000") Message-ID: <8761vsm7ex.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2013-07/txt/msg00767.txt.bz2 >>>>> "Markus" == Metzger, Markus T writes: Markus> Once we have all the delegates in place, shouldn't we rewrite Markus> the original target_~ functions to call the respective Markus> target_delegate_~ with ¤t_target as first argument? Yeah, that would be good. Tom> To fix the second problem, this patch adds find_target_at to determine Tom> whether a target appears at a given stratum. This may seem like Tom> overkill somehow, but I have a subsequent patch series (see archer.git Tom> tromey/multi-target) that uses it more heavily. Markus> I'd rather consistently add struct target_opc *self as first Markus> parameter to all target functions. I considered this, but the difficulty is that I can't test, or even compile, a reasonable subset of the changes. If that doesn't bother people then I'm happy to change things that way. I do think it would be cleaner. Markus> Otherwise, we rely on the fact that the target doing the Markus> delegation is at the top of its stratum. This holds for record Markus> targets and I may be ignorant enough to not realize that this Markus> holds in general. If we could have another target on top of us Markus> in the same stratum, though, we would delegate to ourselves. Only a single target can appear at a given stratum. This is enforced by push_target. This is pretty obscure due to how the code is written; but with my other target stack series this becomes more obvious. So I don't think there is an issue here. However, I do agree that it is a violation of the abstraction. Tom