summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.base/stmtvars.exp
blob: c0099f2d8283167b78348ce3fefb452c6fe5808b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
set test "stmtvars"
# PR 5787

set pc 0
set vars ""
spawn stap -e "probe kernel.function(\"do_sys_open\") {\$foo}" -p4 -vv -u
expect {
    -re {probe do_sys_open[^\r\n]*pc=(0x[^\r\n]*)\r\n} { set pc $expect_out(1,string); exp_continue }
    -re {alternatives: ([^\r\n]*)\): identifier [^\r\n]*\r\n} { set vars $expect_out(1,string); exp_continue }
    timeout { fail "$test (timeout)" }
    eof
    }
wait
verbose -log "pc=$pc vars=$vars"
if {$pc != 0 && $vars != ""} { pass "$test - .function" } { fail "$test - .function" }

set pc2 0
set vars2 ""
spawn stap -e "probe kernel.statement($pc) {\$foo}" -p4 -vv -u
expect {
    -re {probe do_sys_open[^\r\n]*pc=(0x[^\r\n]*)\r\n} { set pc2 $expect_out(1,string); exp_continue }
    -re {alternatives: ([^\r\n]*)\): identifier [^\r\n]*\r\n} { set vars2 $expect_out(1,string); exp_continue }
    timeout { fail "$test (timeout)" }
    eof
    }
wait

verbose -log "pc2=$pc2 vars2=$vars2"
if {$pc == $pc2 && $vars == $vars2} { pass $test } { fail $test }