From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13967 invoked by alias); 29 Oct 2013 20:55:24 -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 13948 invoked by uid 89); 29 Oct 2013 20:55:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.6 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS 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; Tue, 29 Oct 2013 20:55:22 +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 r9TKtKnm018665 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 29 Oct 2013 16:55:20 -0400 Received: from barimba (ovpn-113-94.phx2.redhat.com [10.3.113.94]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r9TKtJkr025770 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 29 Oct 2013 16:55:20 -0400 From: Tom Tromey To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [PATCH v4 3/9] add target method delegation References: <1382464769-2465-1-git-send-email-tromey@redhat.com> <1382464769-2465-4-git-send-email-tromey@redhat.com> <526E8B54.8040104@redhat.com> <87eh75cmig.fsf@fleche.redhat.com> <87a9htcme3.fsf@fleche.redhat.com> Date: Tue, 29 Oct 2013 20:55:00 -0000 In-Reply-To: <87a9htcme3.fsf@fleche.redhat.com> (Tom Tromey's message of "Mon, 28 Oct 2013 11:53:40 -0600") Message-ID: <87habz7q6g.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-10/txt/msg00914.txt.bz2 Tom> But looking more closely at the code on the branch, there is an Tom> assertion in those methods returning something other than void. Tom> I'll think about it some more. I looked at all the delegation functions today. I think it would be fine to make nearly all of them assert. The two exceptions are target_delegate_xfer_partial (already does not assert) and target_delegate_wait (which does assert but which I think should not). In all other cases there is either a de_fault call for the method, or the dummy target implements the method. target_delegate_wait is a tricky one, as it returns a value. Perhaps just throwing an exception is best. The current code isn't much of a guide because it throws the exception when the record target is pushed -- but as noted in the thread, this is not robust as the target stack can change even after a target is pushed. Your comments on this would be much appreciated. Some thoughts the target vector. I think the underlying problem here is complex, so it is reasonable if the model is as well. That is, I think it's fine to combine inheritance (e.g., the various linux-* vectors) with delegation (the whole stack itself plus special hacks in record and maybe elsewhere). That in itself is tractable. However, I think the combination of using INHERIT, plus de_fault, plus the dummy target, plus special wrappers for some target APIs leads to madness. It's much too hard to navigate this. I think we should adopt some simpler rule. Tom