omjavaid created this revision.
omjavaid added a reviewer: labath.
Herald added a reviewer: rengolin.

In our discussion D79699 <https://reviews.llvm.org/D79699> SVE ptrace register 
access support we decide to
invalidate register context cached data on every stop instead of doing
at before Step/Resume.

      

InvalidateAllRegisters was added to facilitate flushing of SVE register
context configuration and cached register values. It now makes more
sense to move invalidation after every stop where we initiate SVE
configuration update if needed by calling ConfigureRegisterContext.


https://reviews.llvm.org/D84501

Files:
  lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp


Index: lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
===================================================================
--- lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
+++ lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
@@ -241,9 +241,6 @@
   if (signo != LLDB_INVALID_SIGNAL_NUMBER)
     data = signo;
 
-  // Before thread resumes, clear any cached register data structures
-  GetRegisterContext().InvalidateAllRegisters();
-
   return NativeProcessLinux::PtraceWrapper(PTRACE_CONT, GetID(), nullptr,
                                            reinterpret_cast<void *>(data));
 }
@@ -265,9 +262,6 @@
   if (signo != LLDB_INVALID_SIGNAL_NUMBER)
     data = signo;
 
-  // Before thread resumes, clear any cached register data structures
-  GetRegisterContext().InvalidateAllRegisters();
-
   // If hardware single-stepping is not supported, we just do a continue. The
   // breakpoint on the next instruction has been setup in
   // NativeProcessLinux::Resume.
@@ -325,6 +319,9 @@
   if (m_state == StateType::eStateStepping)
     m_step_workaround.reset();
 
+  // Before thread resumes, clear any cached register data structures
+  GetRegisterContext().InvalidateAllRegisters();
+
   const StateType new_state = StateType::eStateStopped;
   MaybeLogStateChange(new_state);
   m_state = new_state;


Index: lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
===================================================================
--- lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
+++ lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
@@ -241,9 +241,6 @@
   if (signo != LLDB_INVALID_SIGNAL_NUMBER)
     data = signo;
 
-  // Before thread resumes, clear any cached register data structures
-  GetRegisterContext().InvalidateAllRegisters();
-
   return NativeProcessLinux::PtraceWrapper(PTRACE_CONT, GetID(), nullptr,
                                            reinterpret_cast<void *>(data));
 }
@@ -265,9 +262,6 @@
   if (signo != LLDB_INVALID_SIGNAL_NUMBER)
     data = signo;
 
-  // Before thread resumes, clear any cached register data structures
-  GetRegisterContext().InvalidateAllRegisters();
-
   // If hardware single-stepping is not supported, we just do a continue. The
   // breakpoint on the next instruction has been setup in
   // NativeProcessLinux::Resume.
@@ -325,6 +319,9 @@
   if (m_state == StateType::eStateStepping)
     m_step_workaround.reset();
 
+  // Before thread resumes, clear any cached register data structures
+  GetRegisterContext().InvalidateAllRegisters();
+
   const StateType new_state = StateType::eStateStopped;
   MaybeLogStateChange(new_state);
   m_state = new_state;
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
  • [Lldb-commits] [PAT... Muhammad Omair Javaid via Phabricator via lldb-commits

Reply via email to