diff options
author | Alex Langford <apl@fb.com> | 2019-06-21 19:43:07 +0000 |
---|---|---|
committer | Alex Langford <apl@fb.com> | 2019-06-21 19:43:07 +0000 |
commit | 7f9c9f2264235f94b5496281cadcc4a9775dbd8f (patch) | |
tree | f3818af590c4ba9fa489cd7608295d057673e250 /lldb/source/Core/PluginManager.cpp | |
parent | 4649a051bf0b80732ebe805c65a40756e883df6a (diff) | |
download | bcm5719-llvm-7f9c9f2264235f94b5496281cadcc4a9775dbd8f.tar.gz bcm5719-llvm-7f9c9f2264235f94b5496281cadcc4a9775dbd8f.zip |
[Target] Decouple ObjCLanguageRuntime from LanguageRuntime
Summary:
ObjCLanguageRuntime was being pulled into LanguageRuntime because of
Breakpoint Preconditions. If we move BreakpointPrecondition out of Breakpoint,
we can extend the LanguageRuntime plugin interface so that LanguageRuntimes
can give us a BreakpointPrecondition for exceptions.
Differential Revision: https://reviews.llvm.org/D63181
llvm-svn: 364098
Diffstat (limited to 'lldb/source/Core/PluginManager.cpp')
-rw-r--r-- | lldb/source/Core/PluginManager.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lldb/source/Core/PluginManager.cpp b/lldb/source/Core/PluginManager.cpp index cf940dd7034..24cadcd85bf 100644 --- a/lldb/source/Core/PluginManager.cpp +++ b/lldb/source/Core/PluginManager.cpp @@ -828,6 +828,7 @@ struct LanguageRuntimeInstance { std::string description; LanguageRuntimeCreateInstance create_callback; LanguageRuntimeGetCommandObject command_callback; + LanguageRuntimeGetExceptionPrecondition precondition_callback; }; typedef std::vector<LanguageRuntimeInstance> LanguageRuntimeInstances; @@ -845,7 +846,8 @@ static LanguageRuntimeInstances &GetLanguageRuntimeInstances() { bool PluginManager::RegisterPlugin( ConstString name, const char *description, LanguageRuntimeCreateInstance create_callback, - LanguageRuntimeGetCommandObject command_callback) { + LanguageRuntimeGetCommandObject command_callback, + LanguageRuntimeGetExceptionPrecondition precondition_callback) { if (create_callback) { LanguageRuntimeInstance instance; assert((bool)name); @@ -854,6 +856,7 @@ bool PluginManager::RegisterPlugin( instance.description = description; instance.create_callback = create_callback; instance.command_callback = command_callback; + instance.precondition_callback = precondition_callback; std::lock_guard<std::recursive_mutex> guard(GetLanguageRuntimeMutex()); GetLanguageRuntimeInstances().push_back(instance); } @@ -895,6 +898,15 @@ PluginManager::GetLanguageRuntimeGetCommandObjectAtIndex(uint32_t idx) { return nullptr; } +LanguageRuntimeGetExceptionPrecondition +PluginManager::GetLanguageRuntimeGetExceptionPreconditionAtIndex(uint32_t idx) { + std::lock_guard<std::recursive_mutex> guard(GetLanguageRuntimeMutex()); + LanguageRuntimeInstances &instances = GetLanguageRuntimeInstances(); + if (idx < instances.size()) + return instances[idx].precondition_callback; + return nullptr; +} + LanguageRuntimeCreateInstance PluginManager::GetLanguageRuntimeCreateCallbackForPluginName( ConstString name) { |