From 808462c906ccbab27dd05c16bd502a4dadcd2cfd Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Fri, 25 Jan 2008 14:04:39 -0500 Subject: PR 5672: fix generated dwarf probe point names from wildcards 2008-01-25 Frank Ch. Eigler PR 5672. * staptree.cxx (probe_point copy ctor): New function. * staptree.h: Declare it. * tapsets.cxx (dwarf_derived_probe ctor): Call it to shallow-copy incoming base probe location before recomputing/overwriting it. --- ChangeLog | 8 ++++++++ staptree.cxx | 8 ++++++++ staptree.h | 1 + tapsets.cxx | 2 +- 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 6a2b8c27..3097675e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-01-25 Frank Ch. Eigler + + PR 5672. + * staptree.cxx (probe_point copy ctor): New function. + * staptree.h: Declare it. + * tapsets.cxx (dwarf_derived_probe ctor): Call it to shallow-copy + incoming base probe location before recomputing/overwriting it. + 2008-01-25 David Smith * configure.ac: Compressed the two perfmon options into one. diff --git a/staptree.cxx b/staptree.cxx index 173314ee..6d001375 100644 --- a/staptree.cxx +++ b/staptree.cxx @@ -82,6 +82,14 @@ probe_point::probe_point (std::vector const & comps, { } +// NB: shallow-copy of compoonents & condition! +probe_point::probe_point (const probe_point& pp): + components(pp.components), tok(pp.tok), optional (pp.optional), sufficient (pp.sufficient), + condition (pp.condition) +{ +} + + probe_point::probe_point (): tok (0), optional (false), sufficient (false), condition (0) { diff --git a/staptree.h b/staptree.h index 5b4b56cd..54194c7b 100644 --- a/staptree.h +++ b/staptree.h @@ -577,6 +577,7 @@ struct probe_point expression* condition; void print (std::ostream& o) const; probe_point (); + probe_point(const probe_point& pp); probe_point(std::vector const & comps,const token * t); std::string str(); }; diff --git a/tapsets.cxx b/tapsets.cxx index 06aa73aa..5b69373b 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -3635,7 +3635,7 @@ dwarf_derived_probe::dwarf_derived_probe(const string& funcname, Dwarf_Addr addr, dwarf_query& q, Dwarf_Die* scope_die /* may be null */) - : derived_probe (q.base_probe, q.base_loc /* NB: base_loc.components will be overwritten */ ), + : derived_probe (q.base_probe, new probe_point(*q.base_loc) /* .components soon rewritten */ ), module (module), section (section), addr (addr), has_return (q.has_return), has_maxactive (q.has_maxactive), -- cgit