* 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.
This commit is contained in:
Daniel Jacobowitz 2006-12-31 20:20:13 +00:00
parent 2fa63963cd
commit 59f80f1088
5 changed files with 182 additions and 6 deletions

View 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

View file

@ -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

134
gdb/configure vendored
View file

@ -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;
}

View 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

View 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;