Index: lldb/source/API/SystemInitializerFull.cpp =================================================================== --- lldb/source/API/SystemInitializerFull.cpp +++ lldb/source/API/SystemInitializerFull.cpp @@ -63,8 +63,7 @@ #include "Plugins/Language/ObjC/ObjCLanguage.h" #include "Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.h" #include "Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h" -#include "Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h" -#include "Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h" +#include "Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h" #include "Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h" #include "Plugins/MemoryHistory/asan/MemoryHistoryASan.h" #include "Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h" @@ -244,8 +243,7 @@ SymbolFileDWARFDebugMap::Initialize(); ItaniumABILanguageRuntime::Initialize(); - AppleObjCRuntimeV2::Initialize(); - AppleObjCRuntimeV1::Initialize(); + AppleObjCRuntime::Initialize(); SystemRuntimeMacOSX::Initialize(); RenderScriptRuntime::Initialize(); @@ -337,8 +335,7 @@ SymbolFileDWARFDebugMap::Terminate(); ItaniumABILanguageRuntime::Terminate(); - AppleObjCRuntimeV2::Terminate(); - AppleObjCRuntimeV1::Terminate(); + AppleObjCRuntime::Terminate(); SystemRuntimeMacOSX::Terminate(); RenderScriptRuntime::Terminate(); Index: lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h =================================================================== --- lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h +++ lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h @@ -31,6 +31,10 @@ static char ID; + static void Initialize(); + + static void Terminate(); + bool isA(const void *ClassID) const override { return ClassID == &ID || ObjCLanguageRuntime::isA(ClassID); } @@ -84,7 +88,7 @@ bool ExceptionBreakpointsExplainStop(lldb::StopInfoSP stop_reason) override; lldb::SearchFilterSP CreateExceptionSearchFilter() override; - + static std::tuple GetExceptionThrowLocation(); lldb::ValueObjectSP GetExceptionObjectForThread( @@ -97,7 +101,7 @@ virtual void GetValuesForGlobalCFBooleans(lldb::addr_t &cf_true, lldb::addr_t &cf_false); - + virtual bool IsTaggedPointer (lldb::addr_t addr) { return false; } protected: Index: lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp =================================================================== --- lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp +++ lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp @@ -8,10 +8,12 @@ //===----------------------------------------------------------------------===// #include "AppleObjCRuntime.h" +#include "AppleObjCRuntimeV1.h" +#include "AppleObjCRuntimeV2.h" #include "AppleObjCTrampolineHandler.h" - -#include "clang/AST/Type.h" - +#include "Plugins/Language/ObjC/NSString.h" +#include "Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.h" +#include "Plugins/Process/Utility/HistoryThread.h" #include "lldb/Breakpoint/BreakpointLocation.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleList.h" @@ -35,10 +37,7 @@ #include "lldb/Utility/Scalar.h" #include "lldb/Utility/Status.h" #include "lldb/Utility/StreamString.h" - -#include "Plugins/Process/Utility/HistoryThread.h" -#include "Plugins/Language/ObjC/NSString.h" -#include "Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.h" +#include "clang/AST/Type.h" #include @@ -55,6 +54,16 @@ ReadObjCLibraryIfNeeded(process->GetTarget().GetImages()); } +void AppleObjCRuntime::Initialize() { + AppleObjCRuntimeV2::Initialize(); + AppleObjCRuntimeV1::Initialize(); +} + +void AppleObjCRuntime::Terminate() { + AppleObjCRuntimeV2::Terminate(); + AppleObjCRuntimeV1::Terminate(); +} + bool AppleObjCRuntime::GetObjectDescription(Stream &str, ValueObject &valobj) { CompilerType compiler_type(valobj.GetCompilerType()); bool is_signed; @@ -479,7 +488,7 @@ auto descriptor = GetClassDescriptor(*cpp_exception); if (!descriptor || !descriptor->IsValid()) return ValueObjectSP(); - + while (descriptor) { ConstString class_name(descriptor->GetClassName()); if (class_name == "NSException") Index: lldb/tools/lldb-test/SystemInitializerTest.cpp =================================================================== --- lldb/tools/lldb-test/SystemInitializerTest.cpp +++ lldb/tools/lldb-test/SystemInitializerTest.cpp @@ -53,8 +53,7 @@ #include "Plugins/Language/ObjC/ObjCLanguage.h" #include "Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.h" #include "Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h" -#include "Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h" -#include "Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h" +#include "Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h" #include "Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h" #include "Plugins/MemoryHistory/asan/MemoryHistoryASan.h" #include "Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h" @@ -226,8 +225,7 @@ SymbolFileDWARFDebugMap::Initialize(); ItaniumABILanguageRuntime::Initialize(); - AppleObjCRuntimeV2::Initialize(); - AppleObjCRuntimeV1::Initialize(); + AppleObjCRuntime::Initialize(); SystemRuntimeMacOSX::Initialize(); RenderScriptRuntime::Initialize(); @@ -324,8 +322,7 @@ SymbolFileDWARFDebugMap::Terminate(); ItaniumABILanguageRuntime::Terminate(); - AppleObjCRuntimeV2::Terminate(); - AppleObjCRuntimeV1::Terminate(); + AppleObjCRuntime::Terminate(); SystemRuntimeMacOSX::Terminate(); RenderScriptRuntime::Terminate();