From b4ceace28084125ffbac795974319eaffa758147 Mon Sep 17 00:00:00 2001 From: fche Date: Tue, 18 Oct 2005 02:28:00 +0000 Subject: 2005-10-17 Frank Ch. Eigler 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. --- parse.cxx | 58 +++++++++++++++++++++++++--------------------------------- 1 file changed, 25 insertions(+), 33 deletions(-) (limited to 'parse.cxx') diff --git a/parse.cxx b/parse.cxx index bbb209b8..dc9024c9 100644 --- a/parse.cxx +++ b/parse.cxx @@ -563,35 +563,28 @@ parser::parse_probe (std::vector & 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; -- cgit