summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhizhou Yang <zhizhouy@google.com>2019-02-05 13:46:07 -0800
committerZhizhou Yang <zhizhouy@google.com>2019-02-05 13:46:07 -0800
commitbc08e7b94c9fe1f70aa207fb0216998abd0889eb (patch)
treeebf7088fe7dfd3a59c1eaf1998714fa3cad47d1d
parent2a615abee9fb7c56458ce2ee58390c39ba9ccec4 (diff)
downloadgdb-bc08e7b94c9fe1f70aa207fb0216998abd0889eb.tar.gz
Make libthread-db.h file only be compiled with Cndk-r20bndk-r20-beta3ndk-r20-beta2ndk-r20-beta1ndk-r20ndk-release-r20
GDB 8.2 will use C++ to compile in Android, and it will cause the problem that extern variables from libthread_db will be compiled into C++ symbols and cause a linker error. Fixed this by adding a macro to check whether we are using C++. Bug: 123031421 Test: GDB 8.2 linked correctly. Change-Id: I660147a4199e88f394ad0fbe365960f4691678d8
-rw-r--r--gdb-8.2/gdb/nat/glibc_thread_db.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/gdb-8.2/gdb/nat/glibc_thread_db.h b/gdb-8.2/gdb/nat/glibc_thread_db.h
index 97423a44f..0bfba3753 100644
--- a/gdb-8.2/gdb/nat/glibc_thread_db.h
+++ b/gdb-8.2/gdb/nat/glibc_thread_db.h
@@ -27,6 +27,9 @@
#include <sys/types.h>
#include <sys/procfs.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
/* Error codes of the library. */
typedef enum
@@ -455,4 +458,8 @@ extern td_err_e td_thr_dbsuspend (const td_thrhandle_t *__th);
/* Resume execution of thread TH. */
extern td_err_e td_thr_dbresume (const td_thrhandle_t *__th);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* thread_db.h */