From fe3d01fa89a373b8f930689cf2375cc04cb57b74 Mon Sep 17 00:00:00 2001 From: fche Date: Mon, 1 Aug 2005 19:39:05 +0000 Subject: 2005-08-01 Frank Ch. Eigler * elaborate.cxx (derive_probes, semantic_pass_symbols): Improve error message specificity. * translate.cxx (emit_module_init): Compact partial registration recovery code. (emit_module_exit): Invert deregistration sequence. * testsuite/buildok/four.stp: Some module() test case. --- elaborate.cxx | 69 ++++++++++++++++++++++++++++------------------------------- 1 file changed, 33 insertions(+), 36 deletions(-) (limited to 'elaborate.cxx') diff --git a/elaborate.cxx b/elaborate.cxx index 90de32c7..54d102ec 100644 --- a/elaborate.cxx +++ b/elaborate.cxx @@ -359,27 +359,35 @@ symresolution_info::derive_probes (match_node * root, map param_map; vector re_expand; - derived_probe_builder * builder = - root->find_builder(loc->components, 0, param_vec); - - if (!builder) - throw semantic_error ("no match for probe point family"); - - param_vec_to_map(param_vec, param_map); - - unsigned num_atbegin = dps.size(); - builder->build(session, p, loc, param_map, re_expand, dps); - - // Recursively expand any further-expanding results - if (!re_expand.empty()) - { - for (unsigned j = 0; j < re_expand.size(); ++j) - derive_probes(root, re_expand[j], dps); - } - - unsigned num_atend = dps.size(); - if (num_atbegin == num_atend) // nothing new derived! - throw semantic_error ("no match for probe point"); + try + { + derived_probe_builder * builder = + root->find_builder(loc->components, 0, param_vec); + + if (!builder) + throw semantic_error ("no match for probe point family"); + + param_vec_to_map(param_vec, param_map); + + unsigned num_atbegin = dps.size(); + builder->build(session, p, loc, param_map, re_expand, dps); + + // Recursively expand any further-expanding results + if (!re_expand.empty()) + { + for (unsigned j = 0; j < re_expand.size(); ++j) + derive_probes(root, re_expand[j], dps); + } + + unsigned num_atend = dps.size(); + if (num_atbegin == num_atend) // nothing new derived! + throw semantic_error ("no match for probe point"); + } + catch (const semantic_error& e) + { + session.print_error (e); + cerr << " while: resolving probe point " << *loc << endl; + } } } @@ -612,20 +620,9 @@ semantic_pass_symbols (systemtap_session& s) probe* p = dome->probes [i]; vector dps; - try - { - // much magic happens here: probe alias expansion, - // provider identification - sym.derive_probes (s.pattern_root, p, dps); - } - catch (const semantic_error& e) - { - cerr << "while resolving probe point list:" << endl; - for (unsigned k=0; klocations.size(); k++) - cerr << " " << *p->locations[k] << endl; - s.print_error (e); - // dps.erase (dps.begin(), dps.end()); - } + // much magic happens here: probe alias expansion, + // provider identification + sym.derive_probes (s.pattern_root, p, dps); for (unsigned j=0; j