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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
set test "minidebuginfo"
if {![installtest_p]} { untested $test; return }
if {![uprobes_p]} { untested $test; return }
catch { exec gcc -o binary -g $srcdir/$subdir/minidebug.c } err
if {$err == ""} then { pass "$test compile" } else { fail "$test compile $err" }
catch { exec $srcdir/$subdir/create-minidebug.sh } err
if {$err == ""} then { pass "$test create minidebug" } else { fail "$test create-minidebug.sh $err" }
spawn stap $srcdir/$subdir/minidebuginfo.stp -c "./binary.test"
set ok 0
expect {
-timeout 30
-re {[^\r\n]*main\r\n} { incr ok; exp_continue }
-re {[^\r\n]*bar\r\n} { incr ok; exp_continue }
-re {[^\r\n]*foo\r\n} { incr ok; exp_continue }
-re {[^\r\n]*return\r\n} { incr ok; exp_continue }
eof { }
timeout { fail "$test (timeout)" }
}
catch { close }; wait
if {$ok == 4} then { pass "$test ($ok)" } else { fail "$test ($ok)" }
catch { exec rm binary binary.dynsyms binary.funcsyms binary.keep_symbols binary.mini_debuginfo binary.strip binary.debug binary.mini_debuginfo.xz binary.test } err
set test "symtab-strip"
catch { exec gcc -o binary1 -g $srcdir/$subdir/minidebug.c } err
if {$err == ""} then { pass "$test compile" } else { fail "$test compile $err" }
catch { exec strip -g binary1 } err
if {$err == ""} then { pass "$test strip" } else { fail "$test strip $err" }
spawn stap $srcdir/$subdir/minidebuginfo.stp -c "./binary1"
set ok1 0
expect {
-timeout 30
-re {[^\r\n]*main\r\n} { incr ok1; exp_continue }
-re {[^\r\n]*bar\r\n} { incr ok1; exp_continue }
-re {[^\r\n]*foo\r\n} { incr ok1; exp_continue }
-re {[^\r\n]*return\r\n} { incr ok1; exp_continue }
eof { }
timeout { fail "$test (timeout)" }
}
catch { close }; wait
if {$ok1 == 4} then { pass "$test ($ok1)" } else { fail "$test ($ok1)" }
catch { exec rm binary1 } err
|