PR build/11881: LIBTHREAD_DB_SO can be undefined.
authorPedro Alves <palves@redhat.com>
Tue, 16 Apr 2013 18:12:14 +0000 (18:12 +0000)
committerPedro Alves <palves@redhat.com>
Tue, 16 Apr 2013 18:12:14 +0000 (18:12 +0000)
This patch:

 http://sourceware.org/ml/gdb-patches/2009-04/msg00115.html

Changed behaviour by only defining LIBTHREAD_DB_SO if thread_db.h exists. The
definition of LIBTHREAD_DB_SO and LIBTHREAD_DB_SEARCH_PATH should be moved
outside of #ifdef HAVE_THREAD_DB_H.

This is based on a patch attached to the PR, however, it needed a
tweak, as it was it broke the HAVE_THREAD_DB_H path.

2013-04-16  Will Newton  <will.newton@gmail.com>
    Pedro Alves  <palves@redhat.com>

PR build/11881

* common/gdb_thread_db.h (LIBTHREAD_DB_SO)
(LIBTHREAD_DB_SEARCH_PATH): Move outside of #ifdef
HAVE_THREAD_DB_H.

gdb/ChangeLog
gdb/common/gdb_thread_db.h

index 5e7d14f91d304635ea4e669bc821b2c4e9c8e814..48d5ac065cbc580bcbc6ed7ce8ffc9e47ef7f5d5 100644 (file)
@@ -1,3 +1,12 @@
+2013-04-16  Will Newton  <will.newton@gmail.com>
+           Pedro Alves  <palves@redhat.com>
+
+       PR build/11881
+
+       * common/gdb_thread_db.h (LIBTHREAD_DB_SO)
+       (LIBTHREAD_DB_SEARCH_PATH): Move outside of #ifdef
+       HAVE_THREAD_DB_H.
+
 2013-04-16  Pedro Alves  <palves@redhat.com>
            Eli Zaretskii  <eliz@gnu.org>
 
index c95aa776fce0ddac653c6bbda177b6324ef95486..5c6f6cf28a0bb42c34e9d59e77e4f43b7cf48ebd 100644 (file)
@@ -1,17 +1,5 @@
 #ifdef HAVE_THREAD_DB_H
 #include <thread_db.h>
-
-#ifndef LIBTHREAD_DB_SO
-#define LIBTHREAD_DB_SO "libthread_db.so.1"
-#endif
-
-#ifndef LIBTHREAD_DB_SEARCH_PATH
-/* $sdir appears before $pdir for some minimal security protection:
-   we trust the system libthread_db.so a bit more than some random
-   libthread_db associated with whatever libpthread the app is using.  */
-#define LIBTHREAD_DB_SEARCH_PATH "$sdir:$pdir"
-#endif
-
 #else
 
 /* Copyright (C) 1999-2013 Free Software Foundation, Inc.
@@ -453,3 +441,14 @@ extern td_err_e td_thr_dbresume (const td_thrhandle_t *__th);
 #endif /* thread_db.h */
 
 #endif /* HAVE_THREAD_DB_H */
+
+#ifndef LIBTHREAD_DB_SO
+#define LIBTHREAD_DB_SO "libthread_db.so.1"
+#endif
+
+#ifndef LIBTHREAD_DB_SEARCH_PATH
+/* $sdir appears before $pdir for some minimal security protection:
+   we trust the system libthread_db.so a bit more than some random
+   libthread_db associated with whatever libpthread the app is using.  */
+#define LIBTHREAD_DB_SEARCH_PATH "$sdir:$pdir"
+#endif