[Lldb-commits] [PATCH] D67831: [lldb] Get the TargetAPI lock in SBProcess::IsInstrumentationRuntimePresen

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Sep 20 06:16:31 PDT 2019


teemperor created this revision.
teemperor added a reviewer: jingham.
Herald added subscribers: lldb-commits, JDevlieghere.
Herald added a project: LLDB.

We should get the TargetAPI lock here to prevent the process of being destroyed while we are in the function. Thanks Jim for explaining what's going on.

Fixes rdar://54424754


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D67831

Files:
  lldb/source/API/SBProcess.cpp


Index: lldb/source/API/SBProcess.cpp
===================================================================
--- lldb/source/API/SBProcess.cpp
+++ lldb/source/API/SBProcess.cpp
@@ -1180,6 +1180,9 @@
   if (!process_sp)
     return false;
 
+  std::lock_guard<std::recursive_mutex> guard(
+      process_sp->GetTarget().GetAPIMutex());
+
   InstrumentationRuntimeSP runtime_sp =
       process_sp->GetInstrumentationRuntime(type);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67831.221011.patch
Type: text/x-patch
Size: 428 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190920/1fdaf383/attachment.bin>


More information about the lldb-commits mailing list