Debian Codegraph @

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

raw
1 #!/usr/bin/expect
2
3 set test "multisym"
4 set testpath "$srcdir/$subdir"
5 set script "$testpath/multisym.stp"
6
7 # Test that two functions with the same name in the symbol table are
8 # both found even when no DWARF information is available
9 # As the resolution of the probes occur during pass 2, we don't need to go
10 # all the way to pass 5
11 # We need the number of resolutions during pass 2.
12
13 set cmd [concat stap {-p 2 } $script]
14
15 set res [target_compile ${testpath}/${test}_baz.c ${test}_baz.o object ""]
16 if { $res != "" } {
17 verbose "target_compile failed: $res" 2
18 fail "unable to compile ${test}_baz.c"
19 }
20
21 set res [target_compile ${testpath}/${test}_main.c ${test}_main.o object ""]
22 if { $res != "" } {
23 verbose "target_compile failed: $res" 2
24 fail "unable to compile ${test}_main.c"
25 }
26
27 set res [target_compile "${test}_baz.o ${test}_main.o" ${test} executable ""]
28 if { $res != "" } {
29 verbose "target_compile failed: $res" 2
30 fail "unable to compile ${test}"
31 }
32
33 eval spawn $cmd
34 set results 0
35 expect {
36 -re {process\([a-z\/\"]+\)*} { incr results 1; exp_continue}
37 }
38 catch close
39 set res [wait -i $spawn_id]
40 set res [lindex $res 3]
41
42 if {$res == 0 && $results == 4} {
43 pass "$test succeeded"
44 } else {
45 fail "$test failed"
46 }