[Lldb-commits] [lldb] r275393 - [test] [linux] define PR_SET_PTRACER constants if the system does not provide them

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Thu Jul 14 03:43:21 PDT 2016


Author: labath
Date: Thu Jul 14 05:43:21 2016
New Revision: 275393

URL: http://llvm.org/viewvc/llvm-project?rev=275393&view=rev
Log:
[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.

Modified:
    lldb/trunk/packages/Python/lldbsuite/test/make/test_common.h

Modified: lldb/trunk/packages/Python/lldbsuite/test/make/test_common.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/make/test_common.h?rev=275393&r1=275392&r2=275393&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/make/test_common.h (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/make/test_common.h Thu Jul 14 05:43:21 2016
@@ -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()




More information about the lldb-commits mailing list