From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4411 invoked by alias); 15 Nov 2017 03:25:56 -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 4399 invoked by uid 89); 15 Nov 2017 03:25:55 -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,SPF_PASS autolearn=no version=3.3.2 spammy=act, hear X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 15 Nov 2017 03:25:54 +0000 Received: from [10.0.0.11] (192-222-251-162.qc.cable.ebox.net [192.222.251.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 40C9A1E0A6; Tue, 14 Nov 2017 22:25:53 -0500 (EST) Subject: Re: [PATCH 1/3] Convert generic probe interface to C++ (and perform some cleanups) From: Simon Marchi To: Sergio Durigan Junior , GDB Patches References: <20171113175901.25367-1-sergiodj@redhat.com> <20171113175901.25367-2-sergiodj@redhat.com> <457199c5-ba70-d26b-7fcb-9471ad5c9d11@simark.ca> Message-ID: <668ed4e4-c53c-2658-5205-41c57a3e768e@simark.ca> Date: Wed, 15 Nov 2017 03:25:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <457199c5-ba70-d26b-7fcb-9471ad5c9d11@simark.ca> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-11/txt/msg00266.txt.bz2 Damn, I hit send too soon... here's review part 2. Actually, there's wasn't much left. 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. >> -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? Thanks! Simon