summaryrefslogtreecommitdiffstats
path: root/testsuite/semko
diff options
context:
space:
mode:
authorfche <fche>2008-01-18 13:07:13 +0000
committerfche <fche>2008-01-18 13:07:13 +0000
commit5d23847db6a2b8ccacc992f76a1e387898047236 (patch)
tree2ef39e93d085222699019ca65a4b04fe5d598407 /testsuite/semko
parentc7bcf4514f821aafb8540ebe60f308c0bad1f2b6 (diff)
downloadsystemtap-steved-5d23847db6a2b8ccacc992f76a1e387898047236.tar.gz
systemtap-steved-5d23847db6a2b8ccacc992f76a1e387898047236.tar.xz
systemtap-steved-5d23847db6a2b8ccacc992f76a1e387898047236.zip
PR 4936: probe pont conditions part 2; reorg in prep for full rewriting
2008-01-17 Frank Ch. Eigler <fche@elastic.org> PR 4935. Reorganize probe condition implementation. * elaborate.cxx (add_condition): New function. (derived_probe): Remove condition member. (derived_probe ctors): Assert non-null incoming probe/location ptrs. (insert_condition_statement): Remove; turn into ... (semantic_pass_conditions): New pass-2 subpass. (semantic_pass_symbols, visit_symbol, visit_functioncall, find_var): Detect some condition-related error cases. (match_key): Change type to exp_type from tok_type. Update callers. (alias_expansion_builder): Propagate probe conditions. * staptree.cxx (probe): Remove condition field and related functions. * tapsets.cxx (dwarf_derived_probe ctor): Compute replacement wildcard-expanded probe_point preserving more of the original location. (mark_derived_probe ctor): Make similar to others - take location rather than condition parameters. * translate.cxx (emit_common_header): Tweak ordering of tmpcounter traversal and hashkey expression generation. * elaborate.h: Corresponding changes. 2008-01-17 Frank Ch. Eigler <fche@elastic.org> PR 4935. * semko/forty.stp, fortyone.stp, fortytwo.stp: New tests. * semok/twentynine.stp: Weaken test since condition expressions have become more tightly constrained.
Diffstat (limited to 'testsuite/semko')
-rwxr-xr-xtestsuite/semko/forty.stp4
-rwxr-xr-xtestsuite/semko/fortyone.stp3
-rwxr-xr-xtestsuite/semko/fortytwo.stp10
3 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/semko/forty.stp b/testsuite/semko/forty.stp
new file mode 100755
index 00000000..f7721a47
--- /dev/null
+++ b/testsuite/semko/forty.stp
@@ -0,0 +1,4 @@
+#! stap -p2
+
+global x
+probe kernel.function("sys_open") if (x = 1) { } # bad side-effect
diff --git a/testsuite/semko/fortyone.stp b/testsuite/semko/fortyone.stp
new file mode 100755
index 00000000..e9b986df
--- /dev/null
+++ b/testsuite/semko/fortyone.stp
@@ -0,0 +1,3 @@
+#! stap -p2
+
+probe kernel.function("sys_open") if (x > 1) { } # not a global
diff --git a/testsuite/semko/fortytwo.stp b/testsuite/semko/fortytwo.stp
new file mode 100755
index 00000000..17dacb1c
--- /dev/null
+++ b/testsuite/semko/fortytwo.stp
@@ -0,0 +1,10 @@
+#! stap -p2
+
+probe kernel.function("sys_open") if (foo(2)) { } # must not call functions
+
+function foo(x) { return x }
+
+# NB: If this condition is relaxed, then this will have to be blocked:
+# global y function foo () { return y++ } # since global y is written-to
+# but this one would be fine:
+# function foo () { return y++ } # since y is written-to