summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--elaborate.cxx23
2 files changed, 27 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index cde76f43..e2823687 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-11-27 David Smith <dsmith@redhat.com>
+
+ PR 5377.
+ * elaborate.cxx (match_node::find_and_build): Handle wildcards in
+ probe points correctly.
+
2007-11-26 Frank Ch. Eigler <fche@elastic.org>
* elaborate.cxx (derived_probe ctor): Don't duplicate condition
diff --git a/elaborate.cxx b/elaborate.cxx
index c277d8d5..0ac0f4da 100644
--- a/elaborate.cxx
+++ b/elaborate.cxx
@@ -357,16 +357,35 @@ match_node::find_and_build (systemtap_session& s,
if (match.globmatch(subkey))
{
- // recurse
+ if (s.verbose > 2)
+ clog << "wildcard '" << loc->components[pos]->functor
+ << "' matched '" << subkey.name << "'" << endl;
+
+ // When we have a wildcard, we need to create a copy of
+ // the probe point. Then we'll create a copy of the
+ // wildcard component, and substitute the non-wildcard
+ // functor.
+ probe_point *non_wildcard_pp = new probe_point(*loc);
+ probe_point::component *non_wildcard_component
+ = new probe_point::component(*loc->components[pos]);
+ non_wildcard_component->functor = subkey.name;
+ non_wildcard_pp->components[pos] = non_wildcard_component;
+
+ // recurse (with the non-wildcard probe point)
try
{
- subnode->find_and_build (s, p, loc, pos+1, results);
+ subnode->find_and_build (s, p, non_wildcard_pp, pos+1,
+ results);
}
catch (const semantic_error& e)
{
// Ignore semantic_errors while expanding wildcards.
// If we get done and nothing was expanded, the code
// following the loop will complain.
+
+ // If this wildcard didn't match, cleanup.
+ delete non_wildcard_pp;
+ delete non_wildcard_component;
}
}
}