Debian Codegraph @

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

raw
1 set test "ptridx"
2
3 for {set i 0} {$i < [all_compile_flags]} {incr i} {
4 set extra_flag [all_compile_flag $i]
5 set extra_name [all_compile_flag_name $i]
6 set test_flags "additional_flags=-g $extra_flag"
7 set res [target_compile $srcdir/$subdir/$test.c $test.exe executable "$test_flags"]
8 if { $res != "" } {
9 verbose "target_compile failed: $res" 2
10 fail "$test-$test_name compile"
11 untested "$test-$extra_name"
12 continue
13 } else {
14 pass "$test-$extra_name compile"
15 }
16
17 if {[catch {exec stap -L {process("./ptridx.exe").function("*").label("*")}}]} {
18 fail "$test-$extra_name (list labels)"
19 untested "$test-$extra_name"
20 } else {
21 pass "$test-$extra_name (list labels)"
22 if {[installtest_p] && [uprobes_p]} {
23 set ok 0
24 spawn stap $srcdir/$subdir/$test.stp -c ./$test.exe -w
25 expect {
26 -timeout 60
27 -re {failed to retrieve location attribute} {
28 # the variables may have no location
29 setup_kfail GCC *-*-*
30 }
31 -re {^17, 23\r\n} {
32 # output from ptridx.exe itself
33 exp_continue }
34 -re {^[ap] (0x[0-9a-f]+ => )?17, 23\r\n} { incr ok; exp_continue }
35 timeout {
36 fail "$test-$extra_name (timeout)"
37 kill -INT -[exp_pid]
38 }
39 eof { }
40 }
41 kill -INT -[exp_pid] 2
42 catch { close }; catch { wait }
43
44 if {$ok == 2} {
45 pass "$test-$extra_name"
46 } else {
47 fail "$test-$extra_name ($ok)"
48 }
49 } else {
50 untested "$test-$extra_name"
51 }
52 }
53 catch {exec rm -f $test.exe}
54 }