aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2006-12-31 20:20:13 +0000
committerDaniel Jacobowitz <drow@false.org>2006-12-31 20:20:13 +0000
commit59f80f10887fdfa0299b22f33b11efa4ec069fee (patch)
tree0a34fbd27be9ade6b1081bbab5c3ea4efce4d344
parent2fa63963cdcc84d690264e4dcf8dd3d7fbacf7d6 (diff)
downloadfsf-binutils-gdb-59f80f10887fdfa0299b22f33b11efa4ec069fee.zip
fsf-binutils-gdb-59f80f10887fdfa0299b22f33b11efa4ec069fee.tar.gz
fsf-binutils-gdb-59f80f10887fdfa0299b22f33b11efa4ec069fee.tar.bz2
* 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.
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/config.in6
-rwxr-xr-xgdb/configure134
-rw-r--r--gdb/configure.ac29
-rw-r--r--gdb/linux-thread-db.c12
5 files changed, 182 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 675206d..c24ebc6 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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
diff --git a/gdb/config.in b/gdb/config.in
index a73bf25..52176b9 100644
--- a/gdb/config.in
+++ b/gdb/config.in
@@ -548,6 +548,12 @@
/* 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
diff --git a/gdb/configure b/gdb/configure
index 0d331c3..c2199f9 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -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
@@ -20863,6 +20973,20 @@ cat >>confdefs.h <<\_ACEOF
_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
echo "$as_me:$LINENO: checking whether <sys/syscall.h> has __NR_tkill" >&5
@@ -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;
}
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 4deb4f5b..0f6a1c9 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -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
diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c
index fe75a83..4b0aef7 100644
--- a/gdb/linux-thread-db.c
+++ b/gdb/linux-thread-db.c
@@ -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;