summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2010-04-01 15:15:45 -0700
committerJosh Stone <jistone@redhat.com>2010-04-01 15:15:45 -0700
commitcba1d02def7a84d79dc8b40506b661db0973ccf5 (patch)
tree3c998be5a8f4fe244df58925204e6ed6c0a1144d
parent7ddf5daac0d632ec2a1868d8c0e69bee086f25ee (diff)
downloadsystemtap-steved-cba1d02def7a84d79dc8b40506b661db0973ccf5.tar.gz
systemtap-steved-cba1d02def7a84d79dc8b40506b661db0973ccf5.tar.xz
systemtap-steved-cba1d02def7a84d79dc8b40506b661db0973ccf5.zip
PR9958: Let embedded-C assert guru mode
* staptree.cxx (varuse_collecting_visitor::visit_embeddedcode): Don't allow calling /* guru */ functions unless guru mode is active.
-rw-r--r--staptree.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/staptree.cxx b/staptree.cxx
index bb8b6249..4e57ac18 100644
--- a/staptree.cxx
+++ b/staptree.cxx
@@ -1825,6 +1825,11 @@ varuse_collecting_visitor::visit_embeddedcode (embeddedcode *s)
throw semantic_error ("function may not be used when --unprivileged is specified",
current_function->tok);
+ // Don't allow /* guru */ functions unless -g is active.
+ if (!session.guru_mode && s->code.find ("/* guru */") != string::npos)
+ throw semantic_error ("function may not be used unless -g is specified",
+ current_function->tok);
+
// We want to elide embedded-C functions when possible. For
// example, each $target variable access is expanded to an
// embedded-C function call. Yet, for safety reasons, we should