Work around some odd instruction single-step behavior on macOS.
authorJim Ingham <jingham@apple.com>
Tue, 22 May 2018 00:06:55 +0000 (00:06 +0000)
committerJim Ingham <jingham@apple.com>
Tue, 22 May 2018 00:06:55 +0000 (00:06 +0000)
commita435d73349eb53a1a11703fa94f97c677629c84c
tree7b199186a5417f00c81025a0af89d9979ef30a0e
parent17a870f07cf41372fe85c603e2338f605b3f196b
Work around some odd instruction single-step behavior on macOS.

We've seen some cases on macOS where you go to instruction single
step (over a breakpoint), and single step returns but the instruction
hasn't been executed (and the pc hasn't moved.)  The ThreadPlanStepOverBreakpoint
used to handle this case by accident, but the patches to handle two adjacent
breakpoints broke that accident.

This patch fixes the logic of ExplainsStop to explicitly handle the case where
the pc didn't move.  It also adds a WillPop that re-enables the breakpoint we
were stepping over.  We never want an unexpected path through the plan to
fool us into not doing that.

I have no idea how to make this bug happen.  It is very inconsistent when it
occurs IRL.  We really need a full MockProcess Plugin before we can start to write
tests for this sort of system hiccup.

<rdar://problem/38505726>

llvm-svn: 332922
lldb/include/lldb/Target/ThreadPlanStepOverBreakpoint.h
lldb/lldb.xcodeproj/xcshareddata/xcschemes/desktop.xcscheme
lldb/source/Target/ThreadPlanStepOverBreakpoint.cpp