summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2014-05-13 22:02:48 +0000
committerJason Molenda <jmolenda@apple.com>2014-05-13 22:02:48 +0000
commitb4892cd266dfafb9c6986ee46a8025c8031c3792 (patch)
tree5b127dbb778899f9efbdd51026ef74edeceefbd1 /lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
parent1b91aa2cf5141ee3dc4cbbf2e6bdb931b51411ff (diff)
downloadbcm5719-llvm-b4892cd266dfafb9c6986ee46a8025c8031c3792.tar.gz
bcm5719-llvm-b4892cd266dfafb9c6986ee46a8025c8031c3792.zip
Add a new SBThread::SafeToCallFunctions API; this calls over to
the SystemRuntime to check if a thread will have any problems performing an inferior function call so the driver can skip making that function call on that thread. Often the function call can be executed on another thread instead. <rdar://problem/16777874> llvm-svn: 208732
Diffstat (limited to 'lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp')
-rw-r--r--lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
index 7ff14fc5e09..f3f1fa31cd7 100644
--- a/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
+++ b/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
@@ -214,6 +214,21 @@ SystemRuntimeMacOSX::GetQueueKind (addr_t dispatch_queue_addr)
return kind;
}
+bool
+SystemRuntimeMacOSX::SafeToCallFunctionsOnThisThread (ThreadSP thread_sp)
+{
+ if (thread_sp && thread_sp->GetStackFrameCount() > 0 && thread_sp->GetFrameWithConcreteFrameIndex(0))
+ {
+ const SymbolContext sym_ctx (thread_sp->GetFrameWithConcreteFrameIndex(0)->GetSymbolContext (eSymbolContextSymbol));
+ static ConstString g_select_symbol ("__select");
+ if (sym_ctx.GetFunctionName() == g_select_symbol)
+ {
+ return false;
+ }
+ }
+ return true;
+}
+
lldb::queue_id_t
SystemRuntimeMacOSX::GetQueueIDFromThreadQAddress (lldb::addr_t dispatch_qaddr)
{
OpenPOWER on IntegriCloud