From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 65829 invoked by alias); 15 Nov 2017 06:15:26 -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 62904 invoked by uid 89); 15 Nov 2017 06:15:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=BAYES_00,KB_WAM_FROM_NAME_SINGLEWORD,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=no version=3.3.2 spammy= 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; Wed, 15 Nov 2017 06:15:17 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B1F9D883A2; Wed, 15 Nov 2017 06:15:16 +0000 (UTC) Received: from localhost (unused-10-15-17-193.yyz.redhat.com [10.15.17.193]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 87F36116D9E; Wed, 15 Nov 2017 06:15:16 +0000 (UTC) From: Sergio Durigan Junior To: Simon Marchi Cc: GDB Patches Subject: Re: [PATCH 1/3] Convert generic probe interface to C++ (and perform some cleanups) References: <20171113175901.25367-1-sergiodj@redhat.com> <20171113175901.25367-2-sergiodj@redhat.com> <457199c5-ba70-d26b-7fcb-9471ad5c9d11@simark.ca> <668ed4e4-c53c-2658-5205-41c57a3e768e@simark.ca> Date: Wed, 15 Nov 2017 06:15:00 -0000 In-Reply-To: <668ed4e4-c53c-2658-5205-41c57a3e768e@simark.ca> (Simon Marchi's message of "Tue, 14 Nov 2017 22:25:52 -0500") Message-ID: <877eus5aq4.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2017-11/txt/msg00271.txt.bz2 On Tuesday, November 14 2017, Simon Marchi wrote: > Damn, I hit send too soon... here's review part 2. Actually, there's > wasn't much left. Thanks. > On 2017-11-14 09:52 PM, Simon Marchi wrote: >> On 2017-11-13 12:58 PM, Sergio Durigan Junior wrote: >>> This patch converts the generic probe interface (gdb/probe.[ch]) to >>> C++, and also performs some cleanups that were on my TODO list for a >>> while. >>> >>> The main changes were the conversion of 'struct probe' to 'class >>> probe', and 'struct probe_ops' to 'class static_probe_ops'. The >>> former now contains all the "dynamic", generic methods that act on a >>> probe + the generic data related to it; the latter encapsulates a >>> bunch of "static" methods that relate to the probe type, but not to a >>> specific probe itself. >> >> Personally I'm fine with this. Maybe there would be a better C++-ish >> design, but I'm not very good at that. If others have suggestions, I'd >> like to hear them. > > Given your description, I think "class probe_type" would be a good name > instead of static_probe_ops. You know, "class probe_type" was one of the many names that crossed my mind. I didn't like it because it doesn't convey the meaning that I want here, which is that this class is "generic". I still think "static_probe_ops" is a better fit. >>> -extern const struct probe_ops probe_ops_any; >>> + /* Return true if the probe can be enabled; false otherwise. */ >>> + virtual bool can_enable () const >>> + { >>> + return false; >>> + } > > Should this be in the static_probe_ops? Is the fact that a probe can be > enabled/disabled a property of the probe, or the probe type? You're right, it should be on static_probe_ops indeed. I'll move it there. Thanks, -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/