[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 May 18 02:38:17 PDT 2020


fallkrum created this revision.
fallkrum added reviewers: clayborg, jingham.
fallkrum added a project: LLDB.

Encountered the following situation: Let we started thread T1 and it hit breakpoint on B1 <https://reviews.llvm.org/B1> location.  We suspended T1 and continued the process. Then we started thread T2 which hit for example the same location B1 <https://reviews.llvm.org/B1>. This time in a breakpoint callback we decided not to stop returning false.

Expected result: process continues (as if T2 did not hit breakpoint) its workflow with T1 still suspended.
Real result: process do stops (as if T2 callback returned true).

Solution: We need somehow invalidate StopInfo for threads that was previously suspended just because something that is already inactive can not be the reason of stop.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80112

Files:
  lldb/source/Target/Thread.cpp


Index: lldb/source/Target/Thread.cpp
===================================================================
--- lldb/source/Target/Thread.cpp
+++ lldb/source/Target/Thread.cpp
@@ -378,7 +378,8 @@
     const uint32_t process_stop_id = process_sp->GetStopID();
     if (m_stop_info_stop_id != process_stop_id) {
       if (m_stop_info_sp) {
-        if (m_stop_info_sp->IsValid() || IsStillAtLastBreakpointHit() ||
+        if (m_stop_info_sp->IsValid() ||
+            (IsStillAtLastBreakpointHit() && m_resume_state != eStateSuspended) ||
             GetCurrentPlan()->IsVirtualStep())
           SetStopInfo(m_stop_info_sp);
         else


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80112.264561.patch
Type: text/x-patch
Size: 638 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200518/39d157c0/attachment.bin>


More information about the lldb-commits mailing list