Skip to content

Commit af4f40c

Browse files
committed
[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
1 parent 090306f commit af4f40c

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,6 @@ Status NativeThreadLinux::Resume(uint32_t signo) {
241241
if (signo != LLDB_INVALID_SIGNAL_NUMBER)
242242
data = signo;
243243

244-
// Before thread resumes, clear any cached register data structures
245-
GetRegisterContext().InvalidateAllRegisters();
246-
247244
return NativeProcessLinux::PtraceWrapper(PTRACE_CONT, GetID(), nullptr,
248245
reinterpret_cast<void *>(data));
249246
}
@@ -265,9 +262,6 @@ Status NativeThreadLinux::SingleStep(uint32_t signo) {
265262
if (signo != LLDB_INVALID_SIGNAL_NUMBER)
266263
data = signo;
267264

268-
// Before thread resumes, clear any cached register data structures
269-
GetRegisterContext().InvalidateAllRegisters();
270-
271265
// If hardware single-stepping is not supported, we just do a continue. The
272266
// breakpoint on the next instruction has been setup in
273267
// NativeProcessLinux::Resume.
@@ -325,6 +319,9 @@ void NativeThreadLinux::SetStopped() {
325319
if (m_state == StateType::eStateStepping)
326320
m_step_workaround.reset();
327321

322+
// On every stop, clear any cached register data structures
323+
GetRegisterContext().InvalidateAllRegisters();
324+
328325
const StateType new_state = StateType::eStateStopped;
329326
MaybeLogStateChange(new_state);
330327
m_state = new_state;

0 commit comments

Comments
 (0)