From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 8FD30393BC38 for ; Mon, 30 Nov 2020 19:58:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8FD30393BC38 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-539-sdpsvDaGOWCllEE5L4Qxgg-1; Mon, 30 Nov 2020 14:58:47 -0500 X-MC-Unique: sdpsvDaGOWCllEE5L4Qxgg-1 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 475121005E4A for ; Mon, 30 Nov 2020 19:58:46 +0000 (UTC) Received: from localhost.localdomain (ovpn-114-226.phx2.redhat.com [10.3.114.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id EA1F95D6A8; Mon, 30 Nov 2020 19:58:45 +0000 (UTC) From: Tom Stellard To: systemtap@sourceware.org Subject: [PATCH 6/8] Fix -Woverloaded-virtual warnings when building with clang Date: Mon, 30 Nov 2020 19:58:39 +0000 Message-Id: <20201130195841.26142-7-tstellar@redhat.com> In-Reply-To: <20201130195841.26142-1-tstellar@redhat.com> References: <20201130195841.26142-1-tstellar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" X-Spam-Status: No, score=-15.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: systemtap@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Systemtap mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Nov 2020 19:58:50 -0000 --- elaborate.cxx | 8 +++++++- elaborate.h | 3 ++- main.cxx | 2 +- tapsets.cxx | 15 +++++++++------ 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/elaborate.cxx b/elaborate.cxx index b069fb5ba..28cd326d6 100644 --- a/elaborate.cxx +++ b/elaborate.cxx @@ -78,10 +78,16 @@ derived_probe::derived_probe (probe *p, probe_point *l, bool rewrite_loc): this->locations.push_back (l); } +void +derived_probe::printsig_nonest (ostream& o) const +{ + probe::printsig (o); +} void -derived_probe::printsig (ostream& o, bool nest) const +derived_probe::printsig (ostream& o) const { + bool nest = true; probe::printsig (o); if (nest) diff --git a/elaborate.h b/elaborate.h index 860068620..935027f40 100644 --- a/elaborate.h +++ b/elaborate.h @@ -203,7 +203,8 @@ struct derived_probe: public probe virtual void join_group (systemtap_session& s) = 0; virtual probe_point* sole_location () const; virtual probe_point* script_location () const; - virtual void printsig (std::ostream &o, bool nest=true) const; + virtual void printsig (std::ostream &o) const override; + void printsig_nonest (std::ostream &o) const; // return arguments of probe if there virtual void getargs (std::list &) const {} void printsig_nested (std::ostream &o) const; diff --git a/main.cxx b/main.cxx index f3a0d9830..b41cb58a6 100644 --- a/main.cxx +++ b/main.cxx @@ -177,7 +177,7 @@ printscript(systemtap_session& s, ostream& o) { // We want to print the probe point signature (without the nested components). std::ostringstream sig; - p->printsig(sig, false); + p->printsig_nonest(sig); if (s.dump_mode == systemtap_session::dump_matched_probes_vars && isatty(STDOUT_FILENO)) o << s.colorize(sig.str(), "source"); diff --git a/tapsets.cxx b/tapsets.cxx index 52c59fa50..b235e72fd 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -559,7 +559,7 @@ struct dwarf_derived_probe: public generic_kprobe_derived_probe interned_string user_lib; bool access_vars; - void printsig (std::ostream &o, bool nest=true) const; + void printsig (std::ostream &o) const; virtual void join_group (systemtap_session& s); void emit_probe_local_init(systemtap_session& s, translator_output * o); void getargs(std::list &arg_set) const; @@ -5320,8 +5320,9 @@ dwarf_atvar_expanding_visitor::visit_atvar_op (atvar_op* e) void -dwarf_derived_probe::printsig (ostream& o, bool nest) const +dwarf_derived_probe::printsig (ostream& o) const { + bool nest = true; // Instead of just printing the plain locations, we add a PC value // as a comment as a way of telling e.g. apart multiple inlined // function instances. This is distinct from the verbose/clog @@ -10191,7 +10192,7 @@ struct kprobe_derived_probe: public generic_kprobe_derived_probe string path; string library; bool access_var; - void printsig (std::ostream &o, bool nest=true) const; + void printsig (std::ostream &o) const; void join_group (systemtap_session& s); }; @@ -10320,8 +10321,9 @@ kprobe_derived_probe::kprobe_derived_probe (systemtap_session& sess, this->sole_location()->components = comps; } -void kprobe_derived_probe::printsig (ostream& o, bool nest) const +void kprobe_derived_probe::printsig (ostream& o) const { + bool nest = true; sole_location()->print (o); o << " /* " << " name = " << symbol_name << "*/"; @@ -10553,7 +10555,7 @@ struct hwbkpt_derived_probe: public derived_probe string symbol_name; unsigned int hwbkpt_access,hwbkpt_len; - void printsig (std::ostream &o, bool nest) const; + void printsig (std::ostream &o) const; void join_group (systemtap_session& s); }; @@ -10620,8 +10622,9 @@ hwbkpt_derived_probe::hwbkpt_derived_probe (probe *base, this->sole_location()->components = comps; } -void hwbkpt_derived_probe::printsig (ostream& o, bool nest) const +void hwbkpt_derived_probe::printsig (ostream& o) const { + bool nest = true; sole_location()->print (o); if (nest) -- 2.26.2