diff options
author | fche <fche> | 2006-06-05 19:45:56 +0000 |
---|---|---|
committer | fche <fche> | 2006-06-05 19:45:56 +0000 |
commit | a971b891bbdd51e2f1111a41ffff9dfd5e171ab4 (patch) | |
tree | c0c7d41819755dd744e7845684f56fe965373306 /elaborate.cxx | |
parent | cedd10f4eeda74861f6ee61a50241e05eb27b500 (diff) | |
download | systemtap-steved-a971b891bbdd51e2f1111a41ffff9dfd5e171ab4.tar.gz systemtap-steved-a971b891bbdd51e2f1111a41ffff9dfd5e171ab4.tar.xz systemtap-steved-a971b891bbdd51e2f1111a41ffff9dfd5e171ab4.zip |
2006-06-05 Frank Ch. Eigler <fche@elastic.org>
PR 2645 cont'd.
* elaborate.cxx (derive_probes): Pass down optional flag
from alias reference to expansion.
* testsuite/semok/twentytwo.stp: Test passing-down.
* stapprobes.5.in: Specify passing-down property of optional flag.
Diffstat (limited to 'elaborate.cxx')
-rw-r--r-- | elaborate.cxx | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/elaborate.cxx b/elaborate.cxx index e24d26ff..b6d0f226 100644 --- a/elaborate.cxx +++ b/elaborate.cxx @@ -480,28 +480,33 @@ derive_probes (systemtap_session& s, for (unsigned i = 0; i < p->locations.size(); ++i) { probe_point *loc = p->locations[i]; - + + // Pass down optional flag from e.g. alias reference to each + // probe_point instance. We do this by temporarily overriding + // the probe_point optional flag. We could instead deep-copy + // and set a flag on the copy permanently. + + bool old_loc_opt = loc->optional; + loc->optional = loc->optional || optional; + try { unsigned num_atbegin = dps.size(); s.pattern_root->find_and_build (s, p, loc, 0, dps); unsigned num_atend = dps.size(); - if (! optional && ! loc->optional && // something required, but + if (! loc->optional && // something required, but num_atbegin == num_atend) // nothing new derived! throw semantic_error ("no match for probe point"); - - // XXX: perhaps "optional" should operate at the outside - // loop (probe) level. } catch (const semantic_error& e) { // XXX: prefer not to print_error at every nest/unroll level s.print_error (e); cerr << "while: resolving probe point " << *loc << endl; - // if (! exc_outermost) - // throw; } + + loc->optional = old_loc_opt; } } @@ -869,8 +874,8 @@ semantic_pass_symbols (systemtap_session& s) probe* p = dome->probes [i]; vector<derived_probe*> dps; - // much magic happens here: probe alias expansion, - // provider identification + // much magic happens here: probe alias expansion, wildcard + // matching, low-level derived_probe construction. derive_probes (s, p, dps); for (unsigned j=0; j<dps.size(); j++) |