diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | tapsets.cxx | 5 | ||||
-rwxr-xr-x | testsuite/semko/thirtyfour.stp | 3 |
3 files changed, 14 insertions, 1 deletions
@@ -1,5 +1,12 @@ 2006-01-10 Frank Ch. Eigler <fche@redhat.com> + PR 1972. + * tapsets.cxx (var_expanding_copy_visitor::visit_target_symbol): + Produce error message for $var access within .return probes. + * testsuite/semko/thirtyfour.stp: New test. + +2006-01-10 Frank Ch. Eigler <fche@redhat.com> + PR 2060. * buildrun.cxx (compile_pass): Add "V=1" to kbuild if verbose. * translate.cxx (translator_output): For output-file constructor, diff --git a/tapsets.cxx b/tapsets.cxx index 57429cbd..0ad6d5cf 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -2616,12 +2616,15 @@ var_expanding_copy_visitor::visit_target_symbol (target_symbol *e) bool lvalue = is_active_lvalue(e); if (lvalue && !q.sess.guru_mode) - throw semantic_error("Illegal target variable access", e->tok); + throw semantic_error("write to target variable not permitted", e->tok); string fname = (string(lvalue ? "set" : "get") + "_" + e->base_name.substr(1) + "_" + lex_cast<string>(tick++)); + if (q.has_return) + throw semantic_error ("target variables not available to .return probes"); + try { ec->code = q.dw.literal_stmt_for_local (scope_die, diff --git a/testsuite/semko/thirtyfour.stp b/testsuite/semko/thirtyfour.stp new file mode 100755 index 00000000..6d9a67d1 --- /dev/null +++ b/testsuite/semko/thirtyfour.stp @@ -0,0 +1,3 @@ +#! stap -p2 + +probe kernel.function("sys_open").return { $filename } |