From bd0b450c6327b1666385f4e5fb5d23382cbffc86 Mon Sep 17 00:00:00 2001 From: Wenji Huang Date: Mon, 30 Mar 2009 17:29:20 -0400 Subject: [PATCH] PR9998: new config and test files * runtime/autoconf-x86-gs.c : New file. * testsuite/systemtap.base/x86_gs.exp : New test case. * testsuite/systemtap.base/x86_gs.stp : Ditto. --- runtime/autoconf-x86-gs.c | 5 +++++ testsuite/systemtap.base/x86_gs.exp | 12 ++++++++++++ testsuite/systemtap.base/x86_gs.stp | 10 ++++++++++ 3 files changed, 27 insertions(+) create mode 100644 runtime/autoconf-x86-gs.c create mode 100644 testsuite/systemtap.base/x86_gs.exp create mode 100644 testsuite/systemtap.base/x86_gs.stp diff --git a/runtime/autoconf-x86-gs.c b/runtime/autoconf-x86-gs.c new file mode 100644 index 000000000..f4dda7959 --- /dev/null +++ b/runtime/autoconf-x86-gs.c @@ -0,0 +1,5 @@ +#include + +#if defined (__i386__) +struct pt_regs regs = {.gs = 0x0}; +#endif diff --git a/testsuite/systemtap.base/x86_gs.exp b/testsuite/systemtap.base/x86_gs.exp new file mode 100644 index 000000000..98ab30512 --- /dev/null +++ b/testsuite/systemtap.base/x86_gs.exp @@ -0,0 +1,12 @@ +set test "x86_gs" +if {![installtest_p]} { untested $test; return } +set arch [exec uname -m] +if {$arch!="i686"} { untested $test; return } +spawn stap $srcdir/$subdir/x86_gs.stp +expect { + -timeout 60 + -re "0\r\n" { pass $test } + -re "140\r\n" { pass $test } + eof { fail $test } + timeout { fail "$test unexpected timeout" } +} diff --git a/testsuite/systemtap.base/x86_gs.stp b/testsuite/systemtap.base/x86_gs.stp new file mode 100644 index 000000000..68b58512b --- /dev/null +++ b/testsuite/systemtap.base/x86_gs.stp @@ -0,0 +1,10 @@ +#! stap + +# test x86 gs register + +probe begin { + if (!_stp_regs_registered) + _stp_register_regs() + printf("%d\n",test_x86_gs() * 100 + _reg_offsets["gs"]) /* 0 or 140 */ + exit() +} -- 2.43.5