From b7aedf26f105793793c66c39c85abe76e1510e66 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 25 Feb 2010 16:20:50 -0800 Subject: 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. --- testsuite/semok/thirtysix.stp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'testsuite/semok') 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(); } -- cgit