[Lldb-commits] [lldb] r373725 - [lldb] Get the TargetAPI lock in SBProcess::IsInstrumentationRuntimePresent

Raphael Isemann via lldb-commits lldb-commits at lists.llvm.org
Fri Oct 4 02:54:58 PDT 2019


Author: teemperor
Date: Fri Oct  4 02:54:58 2019
New Revision: 373725

URL: http://llvm.org/viewvc/llvm-project?rev=373725&view=rev
Log:
[lldb] Get the TargetAPI lock in SBProcess::IsInstrumentationRuntimePresent

Summary:
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

Reviewers: jingham

Reviewed By: jingham

Subscribers: JDevlieghere, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D67831

Modified:
    lldb/trunk/source/API/SBProcess.cpp

Modified: lldb/trunk/source/API/SBProcess.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBProcess.cpp?rev=373725&r1=373724&r2=373725&view=diff
==============================================================================
--- lldb/trunk/source/API/SBProcess.cpp (original)
+++ lldb/trunk/source/API/SBProcess.cpp Fri Oct  4 02:54:58 2019
@@ -1180,6 +1180,9 @@ bool SBProcess::IsInstrumentationRuntime
   if (!process_sp)
     return false;
 
+  std::lock_guard<std::recursive_mutex> guard(
+      process_sp->GetTarget().GetAPIMutex());
+
   InstrumentationRuntimeSP runtime_sp =
       process_sp->GetInstrumentationRuntime(type);
 




More information about the lldb-commits mailing list