]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* configure.ac: Add tests for TD_VERSION and TD_NOTLS.
authorDaniel Jacobowitz <drow@false.org>
Sun, 31 Dec 2006 20:20:13 +0000 (20:20 +0000)
committerDaniel Jacobowitz <drow@false.org>
Sun, 31 Dec 2006 20:20:13 +0000 (20:20 +0000)
* linux-thread-db.c (thread_db_err_str): Recognize TD_NOTALLOC,
TD_VERSION, and TD_NOTLS.
* configure, config.in: Regenerated.

gdb/ChangeLog
gdb/config.in
gdb/configure
gdb/configure.ac
gdb/linux-thread-db.c

index 675206d6a859eb6bdbed66edaa9ef3b44cd78e14..c24ebc65cb582a246347f4e50e9c69bd3ba66b59 100644 (file)
@@ -1,3 +1,10 @@
+2006-12-31  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * configure.ac: Add tests for TD_VERSION and TD_NOTLS.
+       * linux-thread-db.c (thread_db_err_str): Recognize TD_NOTALLOC,
+       TD_VERSION, and TD_NOTLS.
+       * configure, config.in: Regenerated.
+
 2006-12-31  Joel Brobecker  <brobecker@adacore.com>
 
        * i386-tdep.c (i386_analyze_stack_align): Add handling of two
index a73bf25704859469fb3ec405f280e370e58184d0..52176b97025c2438803b7725de28c98e298f0ffe 100644 (file)
 /* Define if <thread_db.h> has the TD_NOTALLOC error code. */
 #undef THREAD_DB_HAS_TD_NOTALLOC
 
+/* Define if <thread_db.h> has the TD_NOTLS error code. */
+#undef THREAD_DB_HAS_TD_NOTLS
+
+/* Define if <thread_db.h> has the TD_VERSION error code. */
+#undef THREAD_DB_HAS_TD_VERSION
+
 /* Define to 1 if the regex included in libiberty should be used. */
 #undef USE_INCLUDED_REGEX
 
index 0d331c33a33ce7df5bdbb46f1d06fd72a60852e5..c2199f9d51cb3de53fc0c1c5fc9c141a00ea019d 100755 (executable)
@@ -20855,6 +20855,116 @@ rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $gdb_cv_thread_db_h_has_td_notalloc" >&5
 echo "${ECHO_T}$gdb_cv_thread_db_h_has_td_notalloc" >&6
+   echo "$as_me:$LINENO: checking whether <thread_db.h> has TD_VERSION" >&5
+echo $ECHO_N "checking whether <thread_db.h> has TD_VERSION... $ECHO_C" >&6
+if test "${gdb_cv_thread_db_h_has_td_version+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <thread_db.h>
+int
+main ()
+{
+int i = TD_VERSION;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  gdb_cv_thread_db_h_has_td_version=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+gdb_cv_thread_db_h_has_td_version=no
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:$LINENO: result: $gdb_cv_thread_db_h_has_td_version" >&5
+echo "${ECHO_T}$gdb_cv_thread_db_h_has_td_version" >&6
+   echo "$as_me:$LINENO: checking whether <thread_db.h> has TD_NOTLS" >&5
+echo $ECHO_N "checking whether <thread_db.h> has TD_NOTLS... $ECHO_C" >&6
+if test "${gdb_cv_thread_db_h_has_td_notls+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <thread_db.h>
+int
+main ()
+{
+int i = TD_NOTLS;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  gdb_cv_thread_db_h_has_td_notls=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+gdb_cv_thread_db_h_has_td_notls=no
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:$LINENO: result: $gdb_cv_thread_db_h_has_td_notls" >&5
+echo "${ECHO_T}$gdb_cv_thread_db_h_has_td_notls" >&6
 fi
 if test "x$gdb_cv_thread_db_h_has_td_notalloc" = "xyes"; then
 
@@ -20862,6 +20972,20 @@ cat >>confdefs.h <<\_ACEOF
 #define THREAD_DB_HAS_TD_NOTALLOC 1
 _ACEOF
 
+fi
+if test "x$gdb_cv_thread_db_h_has_td_version" = "xyes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define THREAD_DB_HAS_TD_VERSION 1
+_ACEOF
+
+fi
+if test "x$gdb_cv_thread_db_h_has_td_notls" = "xyes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define THREAD_DB_HAS_TD_NOTLS 1
+_ACEOF
+
 fi
 
 if test "x$ac_cv_header_sys_syscall_h" = "xyes"; then
@@ -22341,7 +22465,7 @@ ac_x_header_dirs='
 /usr/openwin/share/include'
 
 if test "$ac_x_includes" = no; then
-  # Guess where to find include files, by looking for Xlib.h.
+  # Guess where to find include files, by looking for Intrinsic.h.
   # First, try using that file with no special directory specified.
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -22349,7 +22473,7 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <X11/Xlib.h>
+#include <X11/Intrinsic.h>
 _ACEOF
 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
@@ -22376,7 +22500,7 @@ else
 sed 's/^/| /' conftest.$ac_ext >&5
 
   for ac_dir in $ac_x_header_dirs; do
-  if test -r "$ac_dir/X11/Xlib.h"; then
+  if test -r "$ac_dir/X11/Intrinsic.h"; then
     ac_x_includes=$ac_dir
     break
   fi
@@ -22397,11 +22521,11 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <X11/Xlib.h>
+#include <X11/Intrinsic.h>
 int
 main ()
 {
-XrmInitialize ()
+XtMalloc (0)
   ;
   return 0;
 }
index 4deb4f5b43c14af83337cdbfc52c488e9488fbb5..0f6a1c91b5fa5a65fcd234612d1dbbb2423fb6f6 100644 (file)
@@ -1024,7 +1024,8 @@ if test ${build} = ${host} -a ${host} = ${target} ; then
    AC_SUBST(CONFIG_LDFLAGS)
 fi
 
-dnl See if we have a thread_db header file that has TD_NOTALLOC.
+dnl See if we have a thread_db header file that has TD_NOTALLOC and
+dnl other error codes.
 if test "x$ac_cv_header_thread_db_h" = "xyes"; then
    AC_CACHE_CHECK([whether <thread_db.h> has TD_NOTALLOC],
                   gdb_cv_thread_db_h_has_td_notalloc,
@@ -1035,11 +1036,37 @@ if test "x$ac_cv_header_thread_db_h" = "xyes"; then
        gdb_cv_thread_db_h_has_td_notalloc=no
      )
    )
+   AC_CACHE_CHECK([whether <thread_db.h> has TD_VERSION],
+                  gdb_cv_thread_db_h_has_td_version,
+     AC_TRY_COMPILE(
+       [#include <thread_db.h>],
+       [int i = TD_VERSION;],
+       gdb_cv_thread_db_h_has_td_version=yes,
+       gdb_cv_thread_db_h_has_td_version=no
+     )
+   )
+   AC_CACHE_CHECK([whether <thread_db.h> has TD_NOTLS],
+                  gdb_cv_thread_db_h_has_td_notls,
+     AC_TRY_COMPILE(
+       [#include <thread_db.h>],
+       [int i = TD_NOTLS;],
+       gdb_cv_thread_db_h_has_td_notls=yes,
+       gdb_cv_thread_db_h_has_td_notls=no
+     )
+   )
 fi
 if test "x$gdb_cv_thread_db_h_has_td_notalloc" = "xyes"; then
   AC_DEFINE(THREAD_DB_HAS_TD_NOTALLOC, 1,
             [Define if <thread_db.h> has the TD_NOTALLOC error code.])
 fi
+if test "x$gdb_cv_thread_db_h_has_td_version" = "xyes"; then
+  AC_DEFINE(THREAD_DB_HAS_TD_VERSION, 1,
+            [Define if <thread_db.h> has the TD_VERSION error code.])
+fi
+if test "x$gdb_cv_thread_db_h_has_td_notls" = "xyes"; then
+  AC_DEFINE(THREAD_DB_HAS_TD_NOTLS, 1,
+            [Define if <thread_db.h> has the TD_NOTLS error code.])
+fi
 
 dnl See if we have a sys/syscall header file that has __NR_tkill.
 if test "x$ac_cv_header_sys_syscall_h" = "xyes"; then
index fe75a8331f7faf9d20fadc41b33401ba1e4bdc06..4b0aef7951f670da77314b8cca53c0fea7489133 100644 (file)
@@ -209,6 +209,18 @@ thread_db_err_str (td_err_e err)
       return "only part of register set was written/read";
     case TD_NOXREGS:
       return "X register set not available for this thread";
+#ifdef THREAD_DB_HAS_TD_NOTALLOC
+    case TD_NOTALLOC:
+      return "thread has not yet allocated TLS for given module";
+#endif
+#ifdef THREAD_DB_HAS_TD_VERSION
+    case TD_VERSION:
+      return "versions of libpthread and libthread_db do not match";
+#endif
+#ifdef THREAD_DB_HAS_TD_NOTLS
+    case TD_NOTLS:
+      return "there is no TLS segment in the given module";
+#endif
     default:
       snprintf (buf, sizeof (buf), "unknown thread_db error '%d'", err);
       return buf;