Debian Codegraph @

doc/SystemTap_Beginners_Guide/testsuite/systemtap.base/at_var_lvalue.exp

raw
1 set test "at_var_lvalue"
2 set testpath "$srcdir/$subdir"
3 set exefile "[pwd]/$test"
4
5 # Test that @var("var") can be used as an lvalue in guru mode.
6 set ::result_string {0: @var("foo")->bar: 41
7 0: @var("foo@at_var_lvalue.c")->bar: 40
8 1: @var("foo@at_var_lvalue.c", @1)->bar: 37
9 2: @var("foo@at_var_lvalue.c", @1)->bar: 34}
10
11 # Only run on make installcheck and uprobes present.
12 if {! [installtest_p]} { untested "$test"; return }
13
14 set res [target_compile ${testpath}/${test}.c ${test} executable "additional_flags=-O2 additional_flags=-g"]
15 if { $res != "" } {
16 verbose "target_compile failed: $res" 2
17 fail "unable to compile ${test}.c"
18 }
19
20 foreach runtime [get_runtime_list] {
21 if {$runtime != ""} {
22 stap_run3 "$test ($runtime)" $srcdir/$subdir/$test.stp -c ./${test} -g $exefile \
23 --runtime=$runtime
24
25 } elseif {[uprobes_p]} {
26 stap_run3 $test $srcdir/$subdir/$test.stp -c ./${test} -g $exefile
27
28 } else {
29 untested "$test"
30 }
31 }
32
33 # Cleanup
34 if { $verbose == 0 } { catch { exec rm -f $test } }