[Lldb-commits] [PATCH] D24764: Refactor NativeRegisterContextLinux_x86_64 code.

Valentina Giusti via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 20 09:40:51 PDT 2016

valentinagiusti marked an inline comment as done.
valentinagiusti added a comment.

Thanks for your review! Please find my answers inline.

Comment at: source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp:807
@@ -827,2 +806,3 @@
+  if (m_xstate_type == XStateType::Invalid) {
     if (const_cast<NativeRegisterContextLinux_x86_64 *>(this)->ReadFPR().Fail())
       return false;
labath wrote:
> I don't think the `const_cast` here is a good idea. How about we just make this functions non-const ?
IsCPUFeatureAvailable must also be called by IsRegisterSetAvailable, which is also const...

Comment at: source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp:818
@@ +817,3 @@
+      return true;
+  case RegSet::mpx: // Check if CPU has MPX and if there is kernel support, by
+                    // reading in the XCR0 area of XSAVE.
zturner wrote:
> Is the AVX case supposed to fall-through to the mpx case?
good catch, it's not supposed to fall-through


More information about the lldb-commits mailing list