diff options
author | Dave Brolley <brolley@redhat.com> | 2009-11-10 14:26:34 -0500 |
---|---|---|
committer | Dave Brolley <brolley@redhat.com> | 2009-11-10 14:26:34 -0500 |
commit | b513cd75dac185ac258dc8260a01891c30be6251 (patch) | |
tree | b8e44de21178425a34e3b0d2f749b730f20d9610 | |
parent | fd212bd5d99abc3518cf523eb7af2fea5ae206ba (diff) | |
parent | f94baaeed17aba11aa46e9b46f0564217fc9978c (diff) | |
download | systemtap-steved-b513cd75dac185ac258dc8260a01891c30be6251.tar.gz systemtap-steved-b513cd75dac185ac258dc8260a01891c30be6251.tar.xz systemtap-steved-b513cd75dac185ac258dc8260a01891c30be6251.zip |
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
-rw-r--r-- | coveragedb.cxx | 8 | ||||
-rw-r--r-- | doc/langref.tex | 10 | ||||
-rw-r--r-- | elaborate.cxx | 11 | ||||
-rw-r--r-- | parse.cxx | 8 | ||||
-rw-r--r-- | staptree.cxx | 9 | ||||
-rw-r--r-- | staptree.h | 4 | ||||
-rw-r--r-- | tapset-procfs.cxx | 12 | ||||
-rw-r--r-- | tapset-utrace.cxx | 3 | ||||
-rw-r--r-- | tapsets.cxx | 4 |
9 files changed, 29 insertions, 40 deletions
diff --git a/coveragedb.cxx b/coveragedb.cxx index 452041fc..ae88f24d 100644 --- a/coveragedb.cxx +++ b/coveragedb.cxx @@ -33,7 +33,7 @@ void print_coverage_info(systemtap_session &s) for (unsigned j=0; j<used_probe_list.size(); ++j) { for (unsigned k=0; k< used_probe_list[j]->locations.size(); ++k) clog << "probe: " - << used_probe_list[j]->locations[k]->tok->location << endl; + << used_probe_list[j]->locations[k]->components.front()->tok->location << endl; } clog << "----" << endl; @@ -56,7 +56,7 @@ void print_coverage_info(systemtap_session &s) for (unsigned j=0; j<unused_probe_list.size(); ++j) { for (unsigned k=0; k< unused_probe_list[j]->locations.size(); ++k) clog << "probe: " - << unused_probe_list[j]->locations[k]->tok->location << endl; + << unused_probe_list[j]->locations[k]->components.front()->tok->location << endl; } } @@ -202,7 +202,7 @@ sql_update_used_probes(sqlite3 *db, systemtap_session &s) s.probes[i]->collect_derivation_chain(used_probe_list); for (unsigned j=0; j<used_probe_list.size(); ++j) { for (unsigned k=0; k< used_probe_list[j]->locations.size(); ++k){ - struct source_loc place = used_probe_list[j]->locations[k]->tok->location; + struct source_loc place = used_probe_list[j]->locations[k]->components.front()->tok->location; coverage_element x(place); x.type = db_type_probe; @@ -246,7 +246,7 @@ sql_update_unused_probes(sqlite3 *db, systemtap_session &s) for (unsigned j=0; j<unused_probe_list.size(); ++j) { for (unsigned k=0; k< unused_probe_list[j]->locations.size(); ++k) { - struct source_loc place = unused_probe_list[j]->locations[k]->tok->location; + struct source_loc place = unused_probe_list[j]->locations[k]->components.front()->tok->location; coverage_element x(place); x.type = db_type_probe; diff --git a/doc/langref.tex b/doc/langref.tex index 3afe6128..d034c7e7 100644 --- a/doc/langref.tex +++ b/doc/langref.tex @@ -1876,16 +1876,6 @@ delete SCALAR \end{verbatim} \end{vindent} -\subsection{do} -\index{do} -The \texttt{do} statement has the same syntax and semantics as in C. - -\begin{vindent} -\begin{verbatim} -do STMT while (EXP) -\end{verbatim} -\end{vindent} - \subsection{EXP (expression)} \index{expression} An \texttt{expression} executes a string- or integer-valued expression and diff --git a/elaborate.cxx b/elaborate.cxx index 626db280..c1465e97 100644 --- a/elaborate.cxx +++ b/elaborate.cxx @@ -372,7 +372,7 @@ match_node::find_and_build (systemtap_session& s, throw semantic_error (string("probe point truncated at position ") + lex_cast (pos) + - " (follow:" + alternatives + ")", loc->tok); + " (follow:" + alternatives + ")", loc->components.back()->tok); } map<string, literal *> param_map; @@ -452,7 +452,7 @@ match_node::find_and_build (systemtap_session& s, lex_cast (pos) + " (alternatives:" + alternatives + ")" + " didn't find any wildcard matches", - loc->tok); + loc->components[pos]->tok); } } else @@ -465,10 +465,11 @@ match_node::find_and_build (systemtap_session& s, for (sub_map_iterator_t i = sub.begin(); i != sub.end(); i++) alternatives += string(" ") + i->first.str(); + throw semantic_error (string("probe point mismatch at position ") + lex_cast (pos) + " (alternatives:" + alternatives + ")", - loc->tok); + loc->components[pos]->tok); } match_node* subnode = i->second; @@ -534,7 +535,7 @@ alias_expansion_builder // Don't build the alias expansion if infinite recursion is detected. if (checkForRecursiveExpansion (use)) { stringstream msg; - msg << "Recursive loop in alias expansion of " << *location << " at " << location->tok->location; + msg << "Recursive loop in alias expansion of " << *location << " at " << location->components.front()->tok->location; // semantic_errors thrown here are ignored. sess.print_error (semantic_error (msg.str())); return; @@ -558,7 +559,7 @@ alias_expansion_builder } // the token location of the alias, - n->tok = location->tok; + n->tok = location->components.front()->tok; // and statements representing the concatenation of the alias' // body with the use's. @@ -1085,7 +1085,7 @@ parser::parse_probe (std::vector<probe *> & probe_ret, && t->type == tok_operator && t->content == "=") { if (pp->optional || pp->sufficient) - throw parse_error ("probe point alias name cannot be optional nor sufficient", pp->tok); + throw parse_error ("probe point alias name cannot be optional nor sufficient", pp->components.front()->tok); aliases.push_back(pp); next (); continue; @@ -1094,7 +1094,7 @@ parser::parse_probe (std::vector<probe *> & probe_ret, && t->type == tok_operator && t->content == "+=") { if (pp->optional || pp->sufficient) - throw parse_error ("probe point alias name cannot be optional nor sufficient", pp->tok); + throw parse_error ("probe point alias name cannot be optional nor sufficient", pp->components.front()->tok); aliases.push_back(pp); epilogue_alias = 1; next (); @@ -1402,10 +1402,10 @@ parser::parse_probe_point () || t->type == tok_keyword)) throw parse_error ("expected identifier or '*'"); - if (pl->tok == 0) pl->tok = t; probe_point::component* c = new probe_point::component; c->functor = t->content; + c->tok = t; pl->components.push_back (c); // NB we may add c->arg soon @@ -1430,7 +1430,7 @@ parser::parse_probe_point () continue; } - // We only fall through here at the end of a probe point (past + // We only fall through here at the end of a probe point (past // all the dotted/parametrized components). if (t && t->type == tok_operator && diff --git a/staptree.cxx b/staptree.cxx index bc552454..4c3b3090 100644 --- a/staptree.cxx +++ b/staptree.cxx @@ -76,23 +76,22 @@ symboldecl::~symboldecl () { } -probe_point::probe_point (std::vector<component*> const & comps, - const token * t): - components(comps), tok(t), optional (false), sufficient (false), +probe_point::probe_point (std::vector<component*> const & comps): + components(comps), optional (false), sufficient (false), condition (0) { } // NB: shallow-copy of compoonents & condition! probe_point::probe_point (const probe_point& pp): - components(pp.components), tok(pp.tok), optional (pp.optional), sufficient (pp.sufficient), + components(pp.components), optional (pp.optional), sufficient (pp.sufficient), condition (pp.condition) { } probe_point::probe_point (): - tok (0), optional (false), sufficient (false), condition (0) + optional (false), sufficient (false), condition (0) { } @@ -630,17 +630,17 @@ struct probe_point std::string functor; literal* arg; // optional component (); + const token* tok; // points to component's functor component(std::string const & f, literal * a = NULL); }; std::vector<component*> components; - const token* tok; // points to first component's functor bool optional; bool sufficient; expression* condition; void print (std::ostream& o) const; probe_point (); probe_point(const probe_point& pp); - probe_point(std::vector<component*> const & comps,const token * t); + probe_point(std::vector<component*> const & comps); std::string str(); }; diff --git a/tapset-procfs.cxx b/tapset-procfs.cxx index fd8ad62a..aa75af42 100644 --- a/tapset-procfs.cxx +++ b/tapset-procfs.cxx @@ -479,30 +479,30 @@ procfs_builder::build(systemtap_session & sess, // Make sure it doesn't start with '/'. if (end_pos == 0) throw semantic_error ("procfs path cannot start with a '/'", - location->tok); + location->components.front()->tok); component = path.substr(start_pos, end_pos - start_pos); // Make sure it isn't empty. if (component.size() == 0) throw semantic_error ("procfs path component cannot be empty", - location->tok); + location->components.front()->tok); // Make sure it isn't relative. else if (component == "." || component == "..") - throw semantic_error ("procfs path cannot be relative (and contain '.' or '..')", location->tok); + throw semantic_error ("procfs path cannot be relative (and contain '.' or '..')", location->components.front()->tok); start_pos = end_pos + 1; } component = path.substr(start_pos); // Make sure it doesn't end with '/'. if (component.size() == 0) - throw semantic_error ("procfs path cannot end with a '/'", location->tok); + throw semantic_error ("procfs path cannot end with a '/'", location->components.front()->tok); // Make sure it isn't relative. else if (component == "." || component == "..") - throw semantic_error ("procfs path cannot be relative (and contain '.' or '..')", location->tok); + throw semantic_error ("procfs path cannot be relative (and contain '.' or '..')", location->components.front()->tok); } if (!(has_read ^ has_write)) - throw semantic_error ("need read/write component", location->tok); + throw semantic_error ("need read/write component", location->components.front()->tok); finished_results.push_back(new procfs_derived_probe(sess, base, location, path, has_write)); diff --git a/tapset-utrace.cxx b/tapset-utrace.cxx index 4bd4ecc1..795d88b7 100644 --- a/tapset-utrace.cxx +++ b/tapset-utrace.cxx @@ -379,7 +379,6 @@ utrace_var_expanding_visitor::visit_target_symbol_cached (target_symbol* e) else pp->components.push_back(base_loc->components[c]); } - pp->tok = e->tok; pp->optional = base_loc->optional; add_probe->locations.push_back(pp); @@ -644,7 +643,7 @@ struct utrace_builder: public derived_probe_builder // We can't probe 'init' (pid 1). XXX: where does this limitation come from? if (pid < 2) throw semantic_error ("process pid must be greater than 1", - location->tok); + location->components.front()->tok); // XXX: could we use /proc/$pid/exe in unwindsym_modules and elsewhere? } diff --git a/tapsets.cxx b/tapsets.cxx index 2a893c95..21eeabbe 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -2775,7 +2775,7 @@ dwarf_derived_probe::dwarf_derived_probe(const string& funcname, if (has_maxactive && (maxactive_val < 0 || maxactive_val > USHRT_MAX)) throw semantic_error ("maxactive value out of range [0," + lex_cast(USHRT_MAX) + "]", - q.base_loc->tok); + q.base_loc->components.front()->tok); // Expand target variables in the probe body if (!null_die(scope_die)) @@ -2947,7 +2947,7 @@ dwarf_derived_probe::saveargs(dwarf_query& q, Dwarf_Die* scope_die, dwarf_var_ex /* trick from visit_target_symbol_context */ target_symbol *tsym = new target_symbol; - tsym->tok = q.base_loc->tok; + tsym->tok = q.base_loc->components.front()->tok; tsym->base_name = "$"; tsym->base_name += arg_name; |