[Lldb-commits] [PATCH] D80112: Check if thread was suspended during previous stop added.

Ilya Bukonkin via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jun 8 13:52:08 PDT 2020


fallkrum added a comment.

In D80112#2080516 <https://reviews.llvm.org/D80112#2080516>, @jingham wrote:

> I was suggesting something like having a Python breakpoint action that increments a Python variable.  Hit the breakpoint first on thread A.  That should increment it by one.  Then suspend thread A and run to hit the breakpoint on thread B.  If your fix is right, then only the thread B action is run, so the python variable will have a value of 2.  But if the suspended thread action also runs, the variable will have the value of 3.  That seems like a pretty easy test to write, and will ensure that the correct behavior is produced.


Can you please explain in more details what breakpoint actions you keep in mind? My investigations have led to the conclusion that all breakpoint actions (including callbacks) are executed inside StopInfoBreakpoint::PerformAction and only once per StopInfoBreakpoint breakpoint instance. I.e if we saved that StopInfoBreakpoint instance for whatever reason and it wrongly become the reason of stop (as in our case when thread was suspended)  the second time we call it's StopInfoBreakpoint::PerformAction it simply returns not performing any actions. Please take a look at it's implementation:

  void PerformAction(Event *event_ptr) override {
      if (!m_should_perform_action)
        return;
      m_should_perform_action = false;
        .
        .
        .


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80112/new/

https://reviews.llvm.org/D80112





More information about the lldb-commits mailing list