summaryrefslogtreecommitdiffstats
path: root/elaborate.cxx
diff options
context:
space:
mode:
authordsmith <dsmith>2007-11-27 21:07:46 +0000
committerdsmith <dsmith>2007-11-27 21:07:46 +0000
commitddfc759e7aac0c23571916e5e2ed6ec6778c5ab1 (patch)
treed285cc853a7b9081503aab083b45c1a312c16412 /elaborate.cxx
parent80342244a32145487eacb1391cad9df5884ced9d (diff)
downloadsystemtap-steved-ddfc759e7aac0c23571916e5e2ed6ec6778c5ab1.tar.gz
systemtap-steved-ddfc759e7aac0c23571916e5e2ed6ec6778c5ab1.tar.xz
systemtap-steved-ddfc759e7aac0c23571916e5e2ed6ec6778c5ab1.zip
2007-11-27 David Smith <dsmith@redhat.com>
PR 5377. * elaborate.cxx (match_node::find_and_build): Handle wildcards in probe points correctly.
Diffstat (limited to 'elaborate.cxx')
-rw-r--r--elaborate.cxx23
1 files changed, 21 insertions, 2 deletions
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;
}
}
}