diff options
| author | Muhammad Omair Javaid <omair.javaid@linaro.org> | 2020-08-19 12:29:16 +0500 |
|---|---|---|
| committer | Muhammad Omair Javaid <omair.javaid@linaro.org> | 2020-08-19 12:30:38 +0500 |
| commit | af4f40c376f5f05ec1b7cc72840518e917eaf091 (patch) | |
| tree | 6bc6e2bda07d8c6cdc21022de3120338b2f6698a /lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp | |
| parent | 090306fc80dbf3e524d0ce4a7c39e0852f0ba144 (diff) | |
[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
Diffstat (limited to 'lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp')
| -rw-r--r-- | lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
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<void *>(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; |
