| 1 |
set test "stmtvars" |
| 2 |
# PR 5787 |
| 3 |
|
| 4 |
set pc 0 |
| 5 |
set vars "" |
| 6 |
spawn stap -e "probe kernel.function(\"do_sys_open\") {\$foo}" -p4 -vv -u |
| 7 |
expect { |
| 8 |
-re {probe do_sys_open[^\r\n]*pc=(0x[^\r\n]*)\r\n} { set pc $expect_out(1,string); exp_continue } |
| 9 |
-re {alternatives: ([^\r\n]*)\): identifier [^\r\n]*\r\n} { set vars $expect_out(1,string); exp_continue } |
| 10 |
timeout { fail "$test (timeout)" } |
| 11 |
eof |
| 12 |
} |
| 13 |
catch {close}; catch {wait} |
| 14 |
|
| 15 |
verbose -log "pc=$pc vars=$vars" |
| 16 |
if {$pc != 0 && $vars != ""} { pass "$test - .function" } { fail "$test - .function" } |
| 17 |
|
| 18 |
set pc2 0 |
| 19 |
set vars2 "" |
| 20 |
spawn stap -e "probe kernel.statement($pc) {\$foo}" -p4 -vv -u |
| 21 |
expect { |
| 22 |
-re {probe do_sys_open[^\r\n]*pc=(0x[^\r\n]*)\r\n} { set pc2 $expect_out(1,string); exp_continue } |
| 23 |
-re {alternatives: ([^\r\n]*)\): identifier [^\r\n]*\r\n} { set vars2 $expect_out(1,string); exp_continue } |
| 24 |
timeout { fail "$test (timeout)" } |
| 25 |
eof |
| 26 |
} |
| 27 |
catch {close}; catch {wait} |
| 28 |
|
| 29 |
verbose -log "pc2=$pc2 vars2=$vars2" |
| 30 |
if {$pc == $pc2 && $vars == $vars2} { pass $test } { fail $test } |