diff options
author | Raphael Isemann <teemperor@gmail.com> | 2019-10-04 09:54:58 +0000 |
---|---|---|
committer | Raphael Isemann <teemperor@gmail.com> | 2019-10-04 09:54:58 +0000 |
commit | 7d24ddf8dbe04a1ecdd21eb0f3288f6d79f9b1c1 (patch) | |
tree | 7f05f2ab5dbee40e63625be1e9d503ee8d85e0d1 /source | |
parent | 9e8bda5b1e37d8e3332e179300e112a7763e4dd4 (diff) | |
download | lldb-7d24ddf8dbe04a1ecdd21eb0f3288f6d79f9b1c1.tar.gz |
[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
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@373725 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'source')
-rw-r--r-- | source/API/SBProcess.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/API/SBProcess.cpp b/source/API/SBProcess.cpp index 4226ff77e..59e9608b7 100644 --- a/source/API/SBProcess.cpp +++ b/source/API/SBProcess.cpp @@ -1180,6 +1180,9 @@ bool SBProcess::IsInstrumentationRuntimePresent( if (!process_sp) return false; + std::lock_guard<std::recursive_mutex> guard( + process_sp->GetTarget().GetAPIMutex()); + InstrumentationRuntimeSP runtime_sp = process_sp->GetInstrumentationRuntime(type); |