diff options
author | fche <fche> | 2005-10-18 02:28:00 +0000 |
---|---|---|
committer | fche <fche> | 2005-10-18 02:28:00 +0000 |
commit | b4ceace28084125ffbac795974319eaffa758147 (patch) | |
tree | 2e7a2052f6e3d016860dce9f7d40b6824a295076 /parse.cxx | |
parent | 54efe513a4b01f433dba37f3106e4907028247f0 (diff) | |
download | systemtap-steved-b4ceace28084125ffbac795974319eaffa758147.tar.gz systemtap-steved-b4ceace28084125ffbac795974319eaffa758147.tar.xz systemtap-steved-b4ceace28084125ffbac795974319eaffa758147.zip |
2005-10-17 Frank Ch. Eigler <fche@elastic.org>
PR 1338.
* parse.cx (parse_probe): Unconditionally visit parse_probe_point.
(parse_probe_point): Accept "*" as component name.
* stapprobes.5.in: Document this.
* elaborate.cxx (derive_probes): Rewrite. Make top-level function.
(match_node::find_and_build): New function to replace
(find_builder): Removed.
(match_key operator <): Correct one nasty typo.
(match_node::bind): Refuse to bind "*" component names.
(derived_probe_builder::build): Remove recursion output param.
(alias_expandion_builder::build): Recurse to derive_probes instead.
* elaborate.h: Corresponding changes.
* tapsets.cxx: Ditto.
(query_cu): Elide prologue finding for uninteresting CUs.
* testsuite/semok/nineteen.stp: New test.
* testsuite/semko/twentythree.stp: New test.
* testsuite/semko/twentyone/two.stp: Fix -p2.
Diffstat (limited to 'parse.cxx')
-rw-r--r-- | parse.cxx | 58 |
1 files changed, 25 insertions, 33 deletions
@@ -563,35 +563,28 @@ parser::parse_probe (std::vector<probe *> & probe_ret, while (1) { - const token *t = peek (); - if (t && t->type == tok_identifier) - { - probe_point * pp = parse_probe_point (); - - t = peek (); - if (equals_ok && t - && t->type == tok_operator && t->content == "=") - { - aliases.push_back(pp); - next (); - continue; - } - else if (t && t->type == tok_operator && t->content == ",") - { - locations.push_back(pp); - equals_ok = false; - next (); - continue; - } - else if (t && t->type == tok_operator && t->content == "{") - { - locations.push_back(pp); - break; - } - else - throw parse_error ("expected ',' or '{'"); - // XXX: unify logic with that in parse_symbol() - } + probe_point * pp = parse_probe_point (); + + const token* t = peek (); + if (equals_ok && t + && t->type == tok_operator && t->content == "=") + { + aliases.push_back(pp); + next (); + continue; + } + else if (t && t->type == tok_operator && t->content == ",") + { + locations.push_back(pp); + equals_ok = false; + next (); + continue; + } + else if (t && t->type == tok_operator && t->content == "{") + { + locations.push_back(pp); + break; + } else throw parse_error ("expected probe point specifier"); } @@ -838,13 +831,12 @@ parser::parse_probe_point () { probe_point* pl = new probe_point; - // XXX: add support for probe point aliases - // e.g. probe alias = foo { ... } while (1) { const token* t = next (); - if (t->type != tok_identifier) - throw parse_error ("expected identifier"); + if (! (t->type == tok_identifier || + (t->type == tok_operator && t->content == "*"))) + throw parse_error ("expected identifier or '*'"); if (pl->tok == 0) pl->tok = t; |