From a477f3f17daab73993ce765900e95cddc3463586 Mon Sep 17 00:00:00 2001 From: dsmith Date: Wed, 24 May 2006 18:37:50 +0000 Subject: 2006-05-24 David Smith * elaborate.cxx (isglob): New function. (match_key::globmatch): New function. (match_node::find_and_build): Uses isglob() and match_key::globmatch() to provide support for wildcards such as "kernel.syscall.*read*" (Bugzilla #1928). * elaborate.h (match_key::globmatch): Added function declaration. * parse.cxx (parser::parse_probe_point): Collects one or more tokens into a single probe-point functor string. * testsuite/parseko/twentytwo.stp: New file. * testsuite/parseok/sixteen.stp: New file. --- parse.cxx | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'parse.cxx') diff --git a/parse.cxx b/parse.cxx index afa5a3ad..0e0d1682 100644 --- a/parse.cxx +++ b/parse.cxx @@ -1129,7 +1129,28 @@ parser::parse_probe_point () pl->components.push_back (c); // NB though we still may add c->arg soon + const token* last_t = t; t = peek (); + + // We need to keep going until we find something other than a + // '*' or identifier, since a probe point wildcard can be + // something like "*a", "*a*", "a*b", "a*b*", etc. + while (t && + // case 1: '*{identifier}' + ((last_t->type == tok_operator && last_t->content == "*" + && (t->type == tok_identifier || t->type == tok_keyword)) + // case 2: '{identifier}*' + || ((last_t->type == tok_identifier + || last_t->type == tok_keyword) + && t->type == tok_operator && t->content == "*"))) + { + c->functor += t->content; + next (); // consume the identifier or '*' + + last_t = t; + t = peek (); + } + if (t && t->type == tok_operator && (t->content == "{" || t->content == "," || t->content == "=" || t->content == "+=" )) -- cgit