summaryrefslogtreecommitdiffstats
path: root/elaborate.cxx
diff options
context:
space:
mode:
authorWenji Huang <wenji.huang@oracle.com>2009-05-05 19:26:38 -0400
committerWenji Huang <wenji.huang@oracle.com>2009-05-05 19:26:38 -0400
commit74efda8d847591a2146601ad085e6411340f3e98 (patch)
tree9651552dc89a0bc2b7a14ffe3f344d01c693e087 /elaborate.cxx
parent88462544ccc86c37e85d2cf9e88b8a0106d78a14 (diff)
downloadsystemtap-steved-74efda8d847591a2146601ad085e6411340f3e98.tar.gz
systemtap-steved-74efda8d847591a2146601ad085e6411340f3e98.tar.xz
systemtap-steved-74efda8d847591a2146601ad085e6411340f3e98.zip
PR10102: tolerate the failure related to optional probe
This patch will make stap silently accept the failure related to optional probe. It puts try/catch around find_and_build which can cover most probe types. The specific treatment for dwarf_derived_probe in commit ed82b7c902d6a2e26452ec51c9cdb9665dbf9e97 is reverted.
Diffstat (limited to 'elaborate.cxx')
-rw-r--r--elaborate.cxx16
1 files changed, 12 insertions, 4 deletions
diff --git a/elaborate.cxx b/elaborate.cxx
index 53f2a8f6..6fb3f197 100644
--- a/elaborate.cxx
+++ b/elaborate.cxx
@@ -406,9 +406,6 @@ match_node::find_and_build (systemtap_session& s,
sub_map_iterator_t i = sub.find (match);
if (i == sub.end()) // no match
{
- if (loc->optional) /* PR10102: to tolerate mismatched optional probe */
- return;
-
string alternatives;
for (sub_map_iterator_t i = sub.begin(); i != sub.end(); i++)
alternatives += string(" ") + i->first.str();
@@ -633,7 +630,18 @@ derive_probes (systemtap_session& s,
// and set a flag on the copy permanently.
bool old_loc_opt = loc->optional;
loc->optional = loc->optional || optional;
- s.pattern_root->find_and_build (s, p, loc, 0, dps); // <-- actual derivation!
+ try
+ {
+ s.pattern_root->find_and_build (s, p, loc, 0, dps); // <-- actual derivation!
+ }
+ catch (const semantic_error& e)
+ {
+ if (!loc->optional)
+ throw semantic_error(e);
+ else /* tolerate failure for optional probe */
+ continue;
+ }
+
loc->optional = old_loc_opt;
unsigned num_atend = dps.size();