Update configure machinery to detect PTRACE_GETREGS
Using #ifdef PTRACE_GETREGS gives difficulties as in some
platforms (e.g. mips) PTRACE_GETREGS is not defined as a
preprocessor symbols unless linux/ptrace.h is included.
However, including linux/ptrace.h causes compilation error on some
other platforms

=> better detect that PTRACE_GETREGS can be used using the
configure machinery.

This should make vgdb PTRACE_GETREGS working again on
various platforms (x86/amd64/mips/...) as PTRACE_GETREGS
was disabled on all of these following r13471



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13482 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/configure.in b/configure.in
index 232ddcb..6ac32b0 100644
--- a/configure.in
+++ b/configure.in
@@ -1040,6 +1040,25 @@
 
 AM_CONDITIONAL([HAVE_GNU_STPNCPY], [test x$ac_have_gnu_stpncpy = xyes])
 
+# Check for PTRACE_GETREGS
+
+AC_MSG_CHECKING([for PTRACE_GETREGS])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <stddef.h>
+#include <sys/ptrace.h>
+#include <sys/user.h>
+]], [[
+  void *p;
+  long res = ptrace (PTRACE_GETREGS, 0, p, p);
+]])], [
+AC_MSG_RESULT([yes])
+AC_DEFINE([HAVE_PTRACE_GETREGS], 1,
+          [Define to 1 if you have the `PTRACE_GETREGS' ptrace request.])
+], [
+AC_MSG_RESULT([no])
+])
+
+
 # Check for CLOCK_MONOTONIC
 
 AC_MSG_CHECKING([for CLOCK_MONOTONIC])