diff options
author | Mark Wielaard <mjw@redhat.com> | 2009-11-16 21:41:13 +0100 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2009-11-16 21:41:13 +0100 |
commit | 5409e5bf98ddc994931754d0cb1cae36ba9a08fd (patch) | |
tree | 7c0be46d2a2bb69882104987fef3aa3692265fcb /testsuite/systemtap.base/externalvar.stp | |
parent | a295050e60affe0bb55fc2d46637314c0822f35d (diff) | |
download | systemtap-steved-5409e5bf98ddc994931754d0cb1cae36ba9a08fd.tar.gz systemtap-steved-5409e5bf98ddc994931754d0cb1cae36ba9a08fd.tar.xz systemtap-steved-5409e5bf98ddc994931754d0cb1cae36ba9a08fd.zip |
Add testcase for retrieving $global vars from execs and shared libs.
Explicit testcase for PR10010 and PR10622.
* testsuite/systemtap.base/externalvar.c: New file.
* testsuite/systemtap.base/externalvar.exp: New file.
* testsuite/systemtap.base/externalvar.stp: New file.
* testsuite/systemtap.base/externalvar_lib.c: New file.
Diffstat (limited to 'testsuite/systemtap.base/externalvar.stp')
-rw-r--r-- | testsuite/systemtap.base/externalvar.stp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/testsuite/systemtap.base/externalvar.stp b/testsuite/systemtap.base/externalvar.stp new file mode 100644 index 00000000..7d4b69bb --- /dev/null +++ b/testsuite/systemtap.base/externalvar.stp @@ -0,0 +1,39 @@ +probe process("externalvar").function("main_call") +{ + printf("exevar_c = %d\n", $exevar_c); + printf("exevar_i = %d\n", $exevar_i); + printf("exevar_l = %d\n", $exevar_l); + + printf("exe_s->i = %d\n", $exe_s->i); + printf("exe_s->l = %d\n", $exe_s->l); + printf("exe_s->c = %d\n", $exe_s->c); + + printf("exe_s->s1 = 0x%x\n", $exe_s->s1); + if ($exe_s == $exe_s->s2) + { + printf("exe_s == exe_s->s2\n"); + } + else + { + printf("exe_s != exe_s->s2\n"); + } +} + +probe process("libexternalvar.so").function("lib_call") +{ + printf("libvar = %d\n", $libvar); + + printf("lib_s->i = %d\n", $lib_s->i); + printf("lib_s->l = %d\n", $lib_s->l); + printf("lib_s->c = %d\n", $lib_s->c); + + if ($lib_s == $lib_s->s1) + { + printf("lib_s == lib_s->s1\n"); + } + else + { + printf("lib_s != lib_s->s2\n"); + } + printf("lib_s->s2 = 0x%x\n", $lib_s->s2); +} |