summaryrefslogtreecommitdiffstats
path: root/testsuite/semok/badvar_undefined.stp
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2010-03-18 15:39:42 -0700
committerJosh Stone <jistone@redhat.com>2010-03-18 15:48:06 -0700
commit9fab2262961c9cd1ab3efea5d362b8a6a1c0c7c3 (patch)
tree4710c7737f853cc7d921e21ff1f9136ef32e991d /testsuite/semok/badvar_undefined.stp
parent8fb91f5fe6cdcab379144f4ebddae6f72816f2c3 (diff)
downloadsystemtap-steved-9fab2262961c9cd1ab3efea5d362b8a6a1c0c7c3.tar.gz
systemtap-steved-9fab2262961c9cd1ab3efea5d362b8a6a1c0c7c3.tar.xz
systemtap-steved-9fab2262961c9cd1ab3efea5d362b8a6a1c0c7c3.zip
PR11346: Move the skip-badvars logic into const-folding
The const_folder is where we prune constant expressions, like conditionals based on a @defined($foo), so we want to give this a chance to work before skip-badvars comes in and throws a warning. As an added bonus, this makes skip-badvars more generic, so it will work even for non-dwarf $target variables. * elaborate.cxx (const_folder::visit_target_symbol): Enact skip-badvars. * tapsets.cxx (dwarf_var_expanding_visitor::visit_target_symbol): Don't worry about badvars here anymore. Save the error now, clean up later. * testsuite/semok/badvar_undefined.stp: Test that @defined with skip-badvars doesn't throw any warnings.
Diffstat (limited to 'testsuite/semok/badvar_undefined.stp')
-rwxr-xr-xtestsuite/semok/badvar_undefined.stp7
1 files changed, 7 insertions, 0 deletions
diff --git a/testsuite/semok/badvar_undefined.stp b/testsuite/semok/badvar_undefined.stp
new file mode 100755
index 00000000..05023ef0
--- /dev/null
+++ b/testsuite/semok/badvar_undefined.stp
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+# PR11346: We shouldn't even see a warning when a would-be skip-badvars
+# replacement is masked by a @defined condition.
+
+stap -W -p2 --skip-badvars -e 'probe kernel.function("sys_getxattr")
+{ printf("%s\n", user_string(@defined($pathname) ? $pathname : $path)) }'