From 8775fd2d8dbaec2ffe735081cce31e259c3b0d44 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Mon, 2 Jul 2012 20:31:09 +0000 Subject: [PATCH] gdb/ * config.in: Regenerate. * configure: Regenerate. * configure.ac: Remove check for gnu/libc-version.h. * linux-thread-db.c : Remove include of gnu/libc-version.h. (enable_thread_event_reporting) : Remove variables libc_version, libc_major and libc_minor. Replace sscanf by inferior_has_bug. Extend the comment. --- gdb/ChangeLog | 11 +++++++++++ gdb/config.in | 3 --- gdb/configure | 2 +- gdb/configure.ac | 2 +- gdb/linux-thread-db.c | 23 +++++++---------------- 5 files changed, 20 insertions(+), 21 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7186f5cd244..c07c8678dad 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,14 @@ +2012-07-02 Jan Kratochvil + + * config.in: Regenerate. + * configure: Regenerate. + * configure.ac: Remove check for gnu/libc-version.h. + * linux-thread-db.c : Remove include of + gnu/libc-version.h. + (enable_thread_event_reporting) : Remove + variables libc_version, libc_major and libc_minor. Replace sscanf by + inferior_has_bug. Extend the comment. + 2012-07-02 Jan Kratochvil * linux-thread-db.c (inferior_has_bug): New function. diff --git a/gdb/config.in b/gdb/config.in index 74f5888282a..0f795c65b29 100644 --- a/gdb/config.in +++ b/gdb/config.in @@ -168,9 +168,6 @@ /* Define to 1 if you have the `getuid' function. */ #undef HAVE_GETUID -/* Define to 1 if you have the header file. */ -#undef HAVE_GNU_LIBC_VERSION_H - /* Define if has gregset_t. */ #undef HAVE_GREGSET_T diff --git a/gdb/configure b/gdb/configure index e8fa8c276de..819967d5234 100755 --- a/gdb/configure +++ b/gdb/configure @@ -8850,7 +8850,7 @@ fi # FIXME: kettenis/20030102: In most cases we include these (ctype.h, time.h) # unconditionally, so what's the point in checking these? for ac_header in nlist.h machine/reg.h poll.h sys/poll.h proc_service.h \ - thread_db.h gnu/libc-version.h signal.h stddef.h \ + thread_db.h signal.h stddef.h \ stdlib.h string.h memory.h strings.h sys/fault.h \ sys/file.h sys/filio.h sys/ioctl.h sys/param.h \ sys/resource.h sys/procfs.h sys/ptrace.h ptrace.h \ diff --git a/gdb/configure.ac b/gdb/configure.ac index d52bd15d33d..f3d75b16af4 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -1022,7 +1022,7 @@ AC_HEADER_STDC # FIXME: kettenis/20030102: In most cases we include these (ctype.h, time.h) # unconditionally, so what's the point in checking these? AC_CHECK_HEADERS([nlist.h machine/reg.h poll.h sys/poll.h proc_service.h \ - thread_db.h gnu/libc-version.h signal.h stddef.h \ + thread_db.h signal.h stddef.h \ stdlib.h string.h memory.h strings.h sys/fault.h \ sys/file.h sys/filio.h sys/ioctl.h sys/param.h \ sys/resource.h sys/procfs.h sys/ptrace.h ptrace.h \ diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c index dff8fc2598c..5073d7e1ead 100644 --- a/gdb/linux-thread-db.c +++ b/gdb/linux-thread-db.c @@ -46,10 +46,6 @@ #include #include -#ifdef HAVE_GNU_LIBC_VERSION_H -#include -#endif - /* GNU/Linux libthread_db support. libthread_db is a library, provided along with libpthread.so, which @@ -612,10 +608,6 @@ enable_thread_event_reporting (void) { td_thr_events_t events; td_err_e err; -#ifdef HAVE_GNU_LIBC_VERSION_H - const char *libc_version; - int libc_major, libc_minor; -#endif struct thread_db_info *info; info = get_thread_db_info (GET_PID (inferior_ptid)); @@ -632,14 +624,13 @@ enable_thread_event_reporting (void) td_event_emptyset (&events); td_event_addset (&events, TD_CREATE); -#ifdef HAVE_GNU_LIBC_VERSION_H - /* The event reporting facility is broken for TD_DEATH events in - glibc 2.1.3, so don't enable it if we have glibc but a lower - version. */ - libc_version = gnu_get_libc_version (); - if (sscanf (libc_version, "%d.%d", &libc_major, &libc_minor) == 2 - && (libc_major > 2 || (libc_major == 2 && libc_minor > 1))) -#endif + /* There is a bug fixed between linuxthreads 2.1.3 and 2.2 by + commit 2e4581e4fba917f1779cd0a010a45698586c190a + * manager.c (pthread_exited): Correctly report event as TD_REAP + instead of TD_DEATH. Fix comments. + where event reporting facility is broken for TD_DEATH events, + so don't enable it if we have glibc but a lower version. */ + if (!inferior_has_bug ("__linuxthreads_version", 2, 2)) td_event_addset (&events, TD_DEATH); err = info->td_ta_set_event_p (info->thread_agent, &events); -- 2.30.2