[Lldb-commits] [PATCH] D28945: Add completed_plan_stack to LLDB ThreadStateCheckpoint

Boris Ulasevich via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Jan 20 04:32:09 PST 2017


boris.ulasevich created this revision.
boris.ulasevich added a project: LLDB.

Here is a fix for Ubuntu tests fails after the recent change https://reviews.llvm.org/D26497 (https://reviews.llvm.org/D26497). The cause of those fails is in internal call to mmap fuction which destroys completed_plan_stack content which in its turn leads to incorrect stop reason discovering.

The solution is to save/restore completed_plan_stack along with existing ThreadStateCheckpoint functionality.


Repository:
  rL LLVM

https://reviews.llvm.org/D28945

Files:
  lldb/include/lldb/Target/Thread.h
  lldb/source/Target/Thread.cpp


Index: lldb/source/Target/Thread.cpp
===================================================================
--- lldb/source/Target/Thread.cpp
+++ lldb/source/Target/Thread.cpp
@@ -540,6 +540,7 @@
   if (process_sp)
     saved_state.orig_stop_id = process_sp->GetStopID();
   saved_state.current_inlined_depth = GetCurrentInlinedDepth();
+  saved_state.m_completed_plan_stack = m_completed_plan_stack;
 
   return true;
 }
@@ -573,6 +574,7 @@
   SetStopInfo(saved_state.stop_info_sp);
   GetStackFrameList()->SetCurrentInlinedDepth(
       saved_state.current_inlined_depth);
+  m_completed_plan_stack = saved_state.m_completed_plan_stack;
   return true;
 }
 
Index: lldb/include/lldb/Target/Thread.h
===================================================================
--- lldb/include/lldb/Target/Thread.h
+++ lldb/include/lldb/Target/Thread.h
@@ -126,6 +126,7 @@
                            // bit of data.
     lldb::StopInfoSP stop_info_sp; // You have to restore the stop info or you
                                    // might continue with the wrong signals.
+    std::vector<lldb::ThreadPlanSP> m_completed_plan_stack;
     lldb::RegisterCheckpointSP
         register_backup_sp; // You need to restore the registers, of course...
     uint32_t current_inlined_depth;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28945.85115.patch
Type: text/x-patch
Size: 1274 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20170120/aa8ad87f/attachment.bin>


More information about the lldb-commits mailing list