aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/API/SBProcess.cpp
diff options
context:
space:
mode:
authorKuba Brecka <kuba.brecka@gmail.com>2014-10-11 01:59:32 +0000
committerKuba Brecka <kuba.brecka@gmail.com>2014-10-11 01:59:32 +0000
commit6392754839ebf14b8e2044da19d23a158db77207 (patch)
treed789774e9d55202114fb265ae60029c9b0c05e51 /lldb/source/API/SBProcess.cpp
parent19c2e631bd0264cdb48dcdefa0186913e55b72fb (diff)
downloadllvm-6392754839ebf14b8e2044da19d23a158db77207.zip
llvm-6392754839ebf14b8e2044da19d23a158db77207.tar.gz
llvm-6392754839ebf14b8e2044da19d23a158db77207.tar.bz2
Add a IsInstrumentationRuntimePresent SB API
Reviewed at http://reviews.llvm.org/D5738 This adds an SB API into SBProcess: bool SBProcess::IsInstrumentationRuntimePresent(InstrumentationRuntimeType type); which simply tells whether a particular InstrumentationRuntime (read "ASan") plugin is present and active. llvm-svn: 219560
Diffstat (limited to 'lldb/source/API/SBProcess.cpp')
-rw-r--r--lldb/source/API/SBProcess.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/lldb/source/API/SBProcess.cpp b/lldb/source/API/SBProcess.cpp
index 7b519b1..5231b4b 100644
--- a/lldb/source/API/SBProcess.cpp
+++ b/lldb/source/API/SBProcess.cpp
@@ -1394,3 +1394,18 @@ SBProcess::GetHistoryThreads (addr_t addr)
}
return threads;
}
+
+bool
+SBProcess::IsInstrumentationRuntimePresent(InstrumentationRuntimeType type)
+{
+ ProcessSP process_sp(GetSP());
+ if (! process_sp)
+ return false;
+
+ InstrumentationRuntimeSP runtime_sp = process_sp->GetInstrumentationRuntime(type);
+
+ if (! runtime_sp.get())
+ return false;
+
+ return runtime_sp->IsActive();
+}