summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2016-07-14 10:43:21 +0000
committerPavel Labath <labath@google.com>2016-07-14 10:43:21 +0000
commitfa3d652d269b96e2e82e306e9eb8da5c3f25690e (patch)
tree0db1e820752c0dff19a61c2de7598e3ced40d99a /lldb/packages/Python/lldbsuite/test
parent6cf195b6d5e15ac0abeb2be1aa5d34361b475c7e (diff)
downloadbcm5719-llvm-fa3d652d269b96e2e82e306e9eb8da5c3f25690e.tar.gz
bcm5719-llvm-fa3d652d269b96e2e82e306e9eb8da5c3f25690e.zip
[test] [linux] define PR_SET_PTRACER constants if the system does not provide them
Android API <= 16 header do not have these symbols defined, but the kernel does support the relevant calls. And in general, since these calls are on a best-effort basis, it won't hurt even if we try to run in on a really ancient kernel. llvm-svn: 275393
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r--lldb/packages/Python/lldbsuite/test/make/test_common.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/make/test_common.h b/lldb/packages/Python/lldbsuite/test/make/test_common.h
index 92c3cd2bc8f..b0151afb892 100644
--- a/lldb/packages/Python/lldbsuite/test/make/test_common.h
+++ b/lldb/packages/Python/lldbsuite/test/make/test_common.h
@@ -26,7 +26,14 @@
#if defined(__linux__)
#include <sys/prctl.h>
-#if defined(PR_SET_PTRACER) && defined(PR_SET_PTRACER_ANY)
+// Android API <= 16 does not have these defined.
+#ifndef PR_SET_PTRACER
+#define PR_SET_PTRACER 0x59616d61
+#endif
+#ifndef PR_SET_PTRACER_ANY
+#define PR_SET_PTRACER_ANY ((unsigned long)-1)
+#endif
+
// For now we execute on best effort basis. If this fails for some reason, so be it.
#define lldb_enable_attach() \
do \
@@ -35,8 +42,6 @@
(void)prctl_result; \
} while (0)
-#endif
-
#else // not linux
#define lldb_enable_attach()
OpenPOWER on IntegriCloud