* runtime/autoconf-x86-gs.c : New file.
* testsuite/systemtap.base/x86_gs.exp : New test case.
* testsuite/systemtap.base/x86_gs.stp : Ditto.
--- /dev/null
+#include <asm/ptrace.h>
+
+#if defined (__i386__)
+struct pt_regs regs = {.gs = 0x0};
+#endif
--- /dev/null
+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" }
+}
--- /dev/null
+#! 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()
+}