From af4f40c376f5f05ec1b7cc72840518e917eaf091 Mon Sep 17 00:00:00 2001 From: Muhammad Omair Javaid Date: Wed, 19 Aug 2020 12:29:16 +0500 Subject: [LLDB] NativeThreadLinux invalidate register cache on stop In our discussion 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. Reviewed By: labath Differential Revision: https://reviews.llvm.org/D84501 --- lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp') diff --git a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp index 14eea2df3810..5aec98bdeca6 100644 --- a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp @@ -241,9 +241,6 @@ Status NativeThreadLinux::Resume(uint32_t signo) { 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(data)); } @@ -265,9 +262,6 @@ Status NativeThreadLinux::SingleStep(uint32_t signo) { 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 @@ void NativeThreadLinux::SetStopped() { if (m_state == StateType::eStateStepping) m_step_workaround.reset(); + // On every stop, clear any cached register data structures + GetRegisterContext().InvalidateAllRegisters(); + const StateType new_state = StateType::eStateStopped; MaybeLogStateChange(new_state); m_state = new_state; -- cgit v1.2.3