Make hit point counts reliable for architectures that stop before evaluation.
authorJim Ingham <jingham@apple.com>
Wed, 13 Jul 2022 01:34:24 +0000 (18:34 -0700)
committerJim Ingham <jingham@apple.com>
Mon, 18 Jul 2022 21:36:32 +0000 (14:36 -0700)
commit5778ada8e54edb2bc2869505b88a959d1915c02f
treeb8c36bc422776517dd2bc5c74a67db43f4cbe4b1
parent8d0383eb694e13a999c9c95adc4b56771429e551
Make hit point counts reliable for architectures that stop before evaluation.

Since we want to present the "new & old" values for watchpoint hits, on architectures,
including the ARM family, that stop before the triggering instruction is run, we need
to single step over the instruction before stopping for realz.  This was incorrectly
done directly in the StopInfoWatchpoint::ShouldStop.  That causes problems if more than
one thread stops "for a reason" at the same time as the watchpoint, since the other actions
didn't expect the process to make progress in this part of the execution control machinery.

The correct way to do this is to schedule the step over using ThreadPlans, and then to restore
the stop info after that plan stops, so that the rest of the stop info actions can happen when
all the other threads have handled their immediate actions as well.

Differential Revision: https://reviews.llvm.org/D129814
15 files changed:
lldb/include/lldb/Breakpoint/Watchpoint.h
lldb/include/lldb/Target/StopInfo.h
lldb/source/Target/StopInfo.cpp
lldb/test/API/commands/watchpoints/watchpoint_commands/condition/TestWatchpointConditionCmd.py
lldb/test/API/functionalities/thread/concurrent_events/TestConcurrentDelayWatchBreak.py
lldb/test/API/functionalities/thread/concurrent_events/TestConcurrentManyWatchpoints.py
lldb/test/API/functionalities/thread/concurrent_events/TestConcurrentNWatchNBreak.py
lldb/test/API/functionalities/thread/concurrent_events/TestConcurrentSignalNWatchNBreak.py
lldb/test/API/functionalities/thread/concurrent_events/TestConcurrentSignalWatch.py
lldb/test/API/functionalities/thread/concurrent_events/TestConcurrentSignalWatchBreak.py
lldb/test/API/functionalities/thread/concurrent_events/TestConcurrentTwoWatchpointThreads.py
lldb/test/API/functionalities/thread/concurrent_events/TestConcurrentTwoWatchpointsOneBreakpoint.py
lldb/test/API/functionalities/thread/concurrent_events/TestConcurrentTwoWatchpointsOneDelayBreakpoint.py
lldb/test/API/functionalities/thread/concurrent_events/TestConcurrentTwoWatchpointsOneSignal.py
lldb/test/API/functionalities/thread/concurrent_events/TestConcurrentWatchBreak.py