The issue is that
- breakpoint handler issues the breakpoint event and discards step plan (ThreadPlanBase::ShouldStop method)
- breakpoint event handler skips breakpoint (because its condition is false) and resumes the execution
Final fix includes:
- additional check for completed plans while discarding stale plans
- GetStopInfo algorithm rework
- reset StopInfo on breakpoint condition fail
You can do this check more compactly - and check that you stopped at the right breakpoint - with:
self.thread = lldbutil.get_one_thread_stopped_at_breakpoint(self.breakpoint_1)
self.assertIsNotNone(self.thread, "Didn't stop at breakpoint 1.")