Fix a problem with "watchpoint triggers before" watchpoint handling.
authorJim Ingham <jingham@apple.com>
Mon, 20 Mar 2023 22:12:38 +0000 (15:12 -0700)
committerJim Ingham <jingham@apple.com>
Mon, 20 Mar 2023 22:17:15 +0000 (15:17 -0700)
commit8d024a79ea783ed3fbb5691aeaf186ad3f0a4ae9
treede53dc7c717c7244682fe22672ad4bc718078c84
parentb333f3393934937e1d857873934325ae0a9af30e
Fix a problem with "watchpoint triggers before" watchpoint handling.

We need to step the watchpoint instruction in these cases, but the
when we queued the ThreadPlanStepOverWatchpoint to do this, we didn't
make it a Controlling plan.  So if you are stepping, this plan returns as
though it were a utility plan, and the stepping plan keeps going.

This only partially fixes the problem on Darwin; there's another bug
with reporting a watchpoint when we're instruction single stepping over
an instruction that triggers a watchpoint.  The kernel reports the
"single step completed" but not the watchpoint hit.  So this commit
also refactors the test into a part that works (at least on Darwin) and
a part that still fails.

We may have to adjust the test result expectations for other systems after
this fix.

Differential Revision: https://reviews.llvm.org/D146337
lldb/include/lldb/Target/Process.h
lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp
lldb/source/Target/StopInfo.cpp
lldb/source/Target/Thread.cpp
lldb/test/API/commands/watchpoints/step_over_watchpoint/TestStepOverWatchpoint.py
lldb/test/API/commands/watchpoints/step_over_watchpoint/main.c