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 | baf769d322d9bbdcd5a5be3481ba90a664a84b8e (patch) | |
| tree | 930013c289b14595b36d6fa88dd2d766fec474f4 /lldb/source/API | |
| parent | b3cc321cb2ee851f5d9ca7a65977e8c6a55a1f3d (diff) | |
| download | bcm5719-llvm-baf769d322d9bbdcd5a5be3481ba90a664a84b8e.tar.gz bcm5719-llvm-baf769d322d9bbdcd5a5be3481ba90a664a84b8e.zip | |
[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
llvm-svn: 373725
Diffstat (limited to 'lldb/source/API')
| -rw-r--r-- | lldb/source/API/SBProcess.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lldb/source/API/SBProcess.cpp b/lldb/source/API/SBProcess.cpp index 4226ff77ecd..59e9608b76f 100644 --- a/lldb/source/API/SBProcess.cpp +++ b/lldb/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); |

