[lldb-dev] Race condition in lldb-mi
gclayton at apple.com
Fri Mar 13 11:34:16 PDT 2015
You are doing the right thing. As Jim said any eStateStopped event must check for GetRestartedFromEvent() just in case.
> On Mar 13, 2015, at 10:30 AM, Abid, Hafiz <Hafiz_Abid at mentor.com> wrote:
> Hi Greg,
> I have been trying to track down some race condition in lldb-mi which causes tests to fails randomly on buildbots. It seems that problems occurs due to the stop at entry breakpoint. LLDB-mi gets its notification and its starts getting information about frame. But the target has run again and lldb-mi may end up creating a garbage stack frame which persists because lldb clears frame in resume. When it stops at the real breakpoint (say at main), it ends up showing the same garbage stack frame. I tried to look into normal lldb to see how it deal with the entry breakpoint and it seems that GetRestartedFromEvent() does some magic.
> I put the following code in the lldb-mi event handler and the problem seems to go away.
> if (lldb::SBProcess::GetRestartedFromEvent (vEvent))
> return true;
> But I am not sure what GetRestartedFromEvent() actually means. What will be the best way to ignore the event that comes when entry breakpoint is hit?
More information about the lldb-dev