diff options
author | Josh Stone <jistone@redhat.com> | 2010-02-25 16:20:50 -0800 |
---|---|---|
committer | Josh Stone <jistone@redhat.com> | 2010-02-25 16:20:50 -0800 |
commit | b7aedf26f105793793c66c39c85abe76e1510e66 (patch) | |
tree | e38acbbc143220e87a2226b55832264d970fc144 /testsuite/semok | |
parent | 70208613b8f9f2584aee89197705f3fddae6a0e4 (diff) | |
download | systemtap-steved-b7aedf26f105793793c66c39c85abe76e1510e66.tar.gz systemtap-steved-b7aedf26f105793793c66c39c85abe76e1510e66.tar.xz systemtap-steved-b7aedf26f105793793c66c39c85abe76e1510e66.zip |
Expand @defined to support more cases
* tapsets.cxx (var_expanding_visitor::visit_defined_op): If no error was
raised or replacement made on a target_symbol, then its @defined state
is still indeterminate. Some later pass (like @cast) might handle it.
* elaborate.cxx (const_folder::visit_defined_op): Squash any escapees.
* testsuite/semok/thirtysix.stp: Add more variants.
Diffstat (limited to 'testsuite/semok')
-rwxr-xr-x | testsuite/semok/thirtysix.stp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/testsuite/semok/thirtysix.stp b/testsuite/semok/thirtysix.stp index e31a51ce..5965a7df 100755 --- a/testsuite/semok/thirtysix.stp +++ b/testsuite/semok/thirtysix.stp @@ -19,3 +19,16 @@ probe process("stap").syscall { println(@defined($argZZ)?$argZZ:0) } # invalid probe process("stap").syscall.return { println(@defined($nosuchvar)?$nosuchvar:0) } # invalid probe process("stap").syscall.return { println(@defined($syscall)?$syscall:0) } # valid %) + +probe begin,end,error,never { println(@defined($nosuchvar)?$nosuchvar:0) } # invalid +probe timer.s(1),timer.jiffies(1) { println(@defined($nosuchvar)?$nosuchvar:0) } # invalid +probe timer.profile { println(@defined($nosuchvar)?$nosuchvar:0) } # invalid + +probe begin { println(@defined(@cast(0, "task_struct")->foo)?$nosuchvar:0) } # invalid +probe begin { println(@defined(@cast(0, "task_struct")->pid)?1:0) } # valid +probe kernel.function("sys_open") { println(@defined(@cast(0, "task_struct")->foo)?$nosuchvar:0) } # invalid +probe kernel.function("sys_open") { println(@defined(@cast(0, "task_struct")->pid)?1:0) } # valid + +function foo1() { println(@defined(@cast(0, "task_struct")->foo)?$nosuchvar:0) } # invalid +function foo2() { println(@defined(@cast(0, "task_struct")->pid)?1:0) } # valid +probe begin { foo1(); foo2(); } |