[Lldb-commits] [lldb] r302027 - Don't attempt to use mpx registers on unsupported platforms
Francis Ricci via lldb-commits
lldb-commits at lists.llvm.org
Wed May 3 08:00:04 PDT 2017
Author: fjricci
Date: Wed May 3 10:00:04 2017
New Revision: 302027
URL: http://llvm.org/viewvc/llvm-project?rev=302027&view=rev
Log:
Don't attempt to use mpx registers on unsupported platforms
Summary:
The existing cpp-level checks using PR_MPX_ENABLE_MANAGEMENT aren't sufficient,
as this isn't defined for linux kernel versions below 3.19.
Reviewers: valentinagiusti, zturner, labath
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D32719
Modified:
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/main.cpp
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/main.cpp
Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/main.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/main.cpp?rev=302027&r1=302026&r2=302027&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/main.cpp (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/main.cpp Wed May 3 10:00:04 2017
@@ -14,6 +14,11 @@
int
main(int argc, char const *argv[])
{
+// PR_MPX_ENABLE_MANAGEMENT won't be defined on linux kernel versions below 3.19
+#ifndef PR_MPX_ENABLE_MANAGEMENT
+ return -1;
+#endif
+
// This call returns 0 only if the CPU and the kernel support Intel(R) MPX.
if (prctl(PR_MPX_ENABLE_MANAGEMENT, 0, 0, 0, 0) != 0)
return -1;
Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/main.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/main.cpp?rev=302027&r1=302026&r2=302027&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/main.cpp (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/main.cpp Wed May 3 10:00:04 2017
@@ -29,6 +29,11 @@ main(int argc, char const *argv[])
unsigned int rax, rbx, rcx, rdx;
int array[5];
+// PR_MPX_ENABLE_MANAGEMENT won't be defined on linux kernel versions below 3.19
+#ifndef PR_MPX_ENABLE_MANAGEMENT
+ return -1;
+#endif
+
// This call returns 0 only if the CPU and the kernel support Intel(R) MPX.
if (prctl(PR_MPX_ENABLE_MANAGEMENT, 0, 0, 0, 0) != 0)
return -1;
More information about the lldb-commits
mailing list