Index: lldb/trunk/include/lldb/Target/CPPLanguageRuntime.h =================================================================== --- lldb/trunk/include/lldb/Target/CPPLanguageRuntime.h +++ lldb/trunk/include/lldb/Target/CPPLanguageRuntime.h @@ -39,12 +39,22 @@ ~CPPLanguageRuntime() override; + static char ID; + + bool isA(const void *ClassID) const override { + return ClassID == &ID || LanguageRuntime::isA(ClassID); + } + + static bool classof(const LanguageRuntime *runtime) { + return runtime->isA(&ID); + } + lldb::LanguageType GetLanguageType() const override { return lldb::eLanguageTypeC_plus_plus; } static CPPLanguageRuntime *GetCPPLanguageRuntime(Process &process) { - return static_cast( + return llvm::cast_or_null( process.GetLanguageRuntime(lldb::eLanguageTypeC_plus_plus)); } Index: lldb/trunk/include/lldb/Target/LanguageRuntime.h =================================================================== --- lldb/trunk/include/lldb/Target/LanguageRuntime.h +++ lldb/trunk/include/lldb/Target/LanguageRuntime.h @@ -175,6 +175,9 @@ return LLDB_INVALID_ADDRESS; } + virtual bool isA(const void *ClassID) const { return ClassID == &ID; } + static char ID; + protected: // Classes that inherit from LanguageRuntime can see and modify these Index: lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h =================================================================== --- lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h +++ lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h @@ -189,6 +189,16 @@ ~ObjCLanguageRuntime() override; + static char ID; + + bool isA(const void *ClassID) const override { + return ClassID == &ID || LanguageRuntime::isA(ClassID); + } + + static bool classof(const LanguageRuntime *runtime) { + return runtime->isA(&ID); + } + virtual TaggedPointerVendor *GetTaggedPointerVendor() { return nullptr; } typedef std::shared_ptr EncodingToTypeSP; Index: lldb/trunk/source/Plugins/Language/ObjC/CF.cpp =================================================================== --- lldb/trunk/source/Plugins/Language/ObjC/CF.cpp +++ lldb/trunk/source/Plugins/Language/ObjC/CF.cpp @@ -50,9 +50,7 @@ if (!process_sp) return false; - ObjCLanguageRuntime *runtime = - (ObjCLanguageRuntime *)process_sp->GetLanguageRuntime( - lldb::eLanguageTypeObjC); + ObjCLanguageRuntime *runtime = process_sp->GetObjCLanguageRuntime(); if (!runtime) return false; @@ -114,9 +112,7 @@ if (!process_sp) return false; - ObjCLanguageRuntime *runtime = - (ObjCLanguageRuntime *)process_sp->GetLanguageRuntime( - lldb::eLanguageTypeObjC); + ObjCLanguageRuntime *runtime = process_sp->GetObjCLanguageRuntime(); if (!runtime) return false; @@ -236,9 +232,7 @@ if (!process_sp) return false; - ObjCLanguageRuntime *runtime = - (ObjCLanguageRuntime *)process_sp->GetLanguageRuntime( - lldb::eLanguageTypeObjC); + ObjCLanguageRuntime *runtime = process_sp->GetObjCLanguageRuntime(); if (!runtime) return false; Index: lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp =================================================================== --- lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp +++ lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp @@ -43,9 +43,7 @@ if (!process_sp) return false; - ObjCLanguageRuntime *runtime = - (ObjCLanguageRuntime *)process_sp->GetLanguageRuntime( - lldb::eLanguageTypeObjC); + ObjCLanguageRuntime *runtime = process_sp->GetObjCLanguageRuntime(); if (!runtime) return false; @@ -93,9 +91,7 @@ if (!process_sp) return false; - ObjCLanguageRuntime *runtime = - (ObjCLanguageRuntime *)process_sp->GetLanguageRuntime( - lldb::eLanguageTypeObjC); + ObjCLanguageRuntime *runtime = process_sp->GetObjCLanguageRuntime(); if (!runtime) return false; @@ -140,9 +136,7 @@ if (!process_sp) return false; - ObjCLanguageRuntime *runtime = - (ObjCLanguageRuntime *)process_sp->GetLanguageRuntime( - lldb::eLanguageTypeObjC); + ObjCLanguageRuntime *runtime = process_sp->GetObjCLanguageRuntime(); if (!runtime) return false; @@ -187,9 +181,7 @@ if (!process_sp) return false; - ObjCLanguageRuntime *runtime = - (ObjCLanguageRuntime *)process_sp->GetLanguageRuntime( - lldb::eLanguageTypeObjC); + ObjCLanguageRuntime *runtime = process_sp->GetObjCLanguageRuntime(); if (!runtime) return false; @@ -235,9 +227,7 @@ if (!process_sp) return false; - ObjCLanguageRuntime *runtime = - (ObjCLanguageRuntime *)process_sp->GetLanguageRuntime( - lldb::eLanguageTypeObjC); + ObjCLanguageRuntime *runtime = process_sp->GetObjCLanguageRuntime(); if (!runtime) return false; @@ -426,9 +416,7 @@ if (!process_sp) return false; - ObjCLanguageRuntime *runtime = - (ObjCLanguageRuntime *)process_sp->GetLanguageRuntime( - lldb::eLanguageTypeObjC); + ObjCLanguageRuntime *runtime = process_sp->GetObjCLanguageRuntime(); if (!runtime) return false; @@ -679,9 +667,7 @@ if (!process_sp) return false; - ObjCLanguageRuntime *runtime = - (ObjCLanguageRuntime *)process_sp->GetLanguageRuntime( - lldb::eLanguageTypeObjC); + ObjCLanguageRuntime *runtime = process_sp->GetObjCLanguageRuntime(); if (!runtime) return false; @@ -795,9 +781,7 @@ if (!process_sp) return false; - ObjCLanguageRuntime *runtime = - (ObjCLanguageRuntime *)process_sp->GetLanguageRuntime( - lldb::eLanguageTypeObjC); + ObjCLanguageRuntime *runtime = process_sp->GetObjCLanguageRuntime(); if (!runtime) return false; @@ -892,9 +876,7 @@ if (!process_sp) return false; - ObjCLanguageRuntime *runtime = - (ObjCLanguageRuntime *)process_sp->GetLanguageRuntime( - lldb::eLanguageTypeObjC); + ObjCLanguageRuntime *runtime = process_sp->GetObjCLanguageRuntime(); if (!runtime) return false; @@ -953,9 +935,7 @@ if (!process_sp) return false; - ObjCLanguageRuntime *runtime = - (ObjCLanguageRuntime *)process_sp->GetLanguageRuntime( - lldb::eLanguageTypeObjC); + ObjCLanguageRuntime *runtime = process_sp->GetObjCLanguageRuntime(); if (!runtime) return false; @@ -1054,8 +1034,8 @@ if (!process_sp) return false; - if (AppleObjCRuntime *objc_runtime = - (AppleObjCRuntime *)process_sp->GetObjCLanguageRuntime()) { + if (AppleObjCRuntime *objc_runtime = llvm::dyn_cast_or_null( + process_sp->GetObjCLanguageRuntime())) { lldb::addr_t cf_true = LLDB_INVALID_ADDRESS, cf_false = LLDB_INVALID_ADDRESS; objc_runtime->GetValuesForGlobalCFBooleans(cf_true, cf_false); Index: lldb/trunk/source/Plugins/Language/ObjC/NSArray.cpp =================================================================== --- lldb/trunk/source/Plugins/Language/ObjC/NSArray.cpp +++ lldb/trunk/source/Plugins/Language/ObjC/NSArray.cpp @@ -344,9 +344,7 @@ if (!process_sp) return false; - ObjCLanguageRuntime *runtime = - (ObjCLanguageRuntime *)process_sp->GetLanguageRuntime( - lldb::eLanguageTypeObjC); + ObjCLanguageRuntime *runtime = process_sp->GetObjCLanguageRuntime(); if (!runtime) return false; Index: lldb/trunk/source/Plugins/Language/ObjC/NSDictionary.cpp =================================================================== --- lldb/trunk/source/Plugins/Language/ObjC/NSDictionary.cpp +++ lldb/trunk/source/Plugins/Language/ObjC/NSDictionary.cpp @@ -347,9 +347,7 @@ if (!process_sp) return false; - ObjCLanguageRuntime *runtime = - (ObjCLanguageRuntime *)process_sp->GetLanguageRuntime( - lldb::eLanguageTypeObjC); + ObjCLanguageRuntime *runtime = process_sp->GetObjCLanguageRuntime(); if (!runtime) return false; Index: lldb/trunk/source/Plugins/Language/ObjC/NSError.cpp =================================================================== --- lldb/trunk/source/Plugins/Language/ObjC/NSError.cpp +++ lldb/trunk/source/Plugins/Language/ObjC/NSError.cpp @@ -187,9 +187,7 @@ lldb::ProcessSP process_sp(valobj_sp->GetProcessSP()); if (!process_sp) return nullptr; - ObjCLanguageRuntime *runtime = - (ObjCLanguageRuntime *)process_sp->GetLanguageRuntime( - lldb::eLanguageTypeObjC); + ObjCLanguageRuntime *runtime = process_sp->GetObjCLanguageRuntime(); if (!runtime) return nullptr; Index: lldb/trunk/source/Plugins/Language/ObjC/NSException.cpp =================================================================== --- lldb/trunk/source/Plugins/Language/ObjC/NSException.cpp +++ lldb/trunk/source/Plugins/Language/ObjC/NSException.cpp @@ -179,9 +179,7 @@ lldb::ProcessSP process_sp(valobj_sp->GetProcessSP()); if (!process_sp) return nullptr; - ObjCLanguageRuntime *runtime = - (ObjCLanguageRuntime *)process_sp->GetLanguageRuntime( - lldb::eLanguageTypeObjC); + ObjCLanguageRuntime *runtime = process_sp->GetObjCLanguageRuntime(); if (!runtime) return nullptr; Index: lldb/trunk/source/Plugins/Language/ObjC/NSIndexPath.cpp =================================================================== --- lldb/trunk/source/Plugins/Language/ObjC/NSIndexPath.cpp +++ lldb/trunk/source/Plugins/Language/ObjC/NSIndexPath.cpp @@ -68,9 +68,7 @@ if (!process_sp) return false; - ObjCLanguageRuntime *runtime = - (ObjCLanguageRuntime *)process_sp->GetLanguageRuntime( - lldb::eLanguageTypeObjC); + ObjCLanguageRuntime *runtime = process_sp->GetObjCLanguageRuntime(); if (!runtime) return false; Index: lldb/trunk/source/Plugins/Language/ObjC/NSSet.cpp =================================================================== --- lldb/trunk/source/Plugins/Language/ObjC/NSSet.cpp +++ lldb/trunk/source/Plugins/Language/ObjC/NSSet.cpp @@ -225,9 +225,7 @@ if (!process_sp) return false; - ObjCLanguageRuntime *runtime = - (ObjCLanguageRuntime *)process_sp->GetLanguageRuntime( - lldb::eLanguageTypeObjC); + ObjCLanguageRuntime *runtime = process_sp->GetObjCLanguageRuntime(); if (!runtime) return false; @@ -304,9 +302,7 @@ lldb::ProcessSP process_sp(valobj_sp->GetProcessSP()); if (!process_sp) return nullptr; - ObjCLanguageRuntime *runtime = - (ObjCLanguageRuntime *)process_sp->GetLanguageRuntime( - lldb::eLanguageTypeObjC); + ObjCLanguageRuntime *runtime = process_sp->GetObjCLanguageRuntime(); if (!runtime) return nullptr; Index: lldb/trunk/source/Plugins/Language/ObjC/NSString.cpp =================================================================== --- lldb/trunk/source/Plugins/Language/ObjC/NSString.cpp +++ lldb/trunk/source/Plugins/Language/ObjC/NSString.cpp @@ -59,9 +59,7 @@ if (!process_sp) return false; - ObjCLanguageRuntime *runtime = - (ObjCLanguageRuntime *)process_sp->GetLanguageRuntime( - lldb::eLanguageTypeObjC); + ObjCLanguageRuntime *runtime = process_sp->GetObjCLanguageRuntime(); if (!runtime) return false; Index: lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h =================================================================== --- lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h +++ lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h @@ -36,6 +36,16 @@ static lldb_private::ConstString GetPluginNameStatic(); + static char ID; + + bool isA(const void *ClassID) const override { + return ClassID == &ID || CPPLanguageRuntime::isA(ClassID); + } + + static bool classof(const LanguageRuntime *runtime) { + return runtime->isA(&ID); + } + bool IsVTableName(const char *name) override; bool GetDynamicTypeAndAddress(ValueObject &in_value, @@ -86,9 +96,8 @@ ItaniumABILanguageRuntime(Process *process) : // Call CreateInstance instead. - lldb_private::CPPLanguageRuntime(process), - m_cxx_exception_bp_sp(), m_dynamic_type_map(), - m_dynamic_type_map_mutex() {} + lldb_private::CPPLanguageRuntime(process), m_cxx_exception_bp_sp(), + m_dynamic_type_map(), m_dynamic_type_map_mutex() {} lldb::BreakpointSP m_cxx_exception_bp_sp; DynamicTypeCache m_dynamic_type_map; Index: lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp =================================================================== --- lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp +++ lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp @@ -43,6 +43,8 @@ static const char *vtable_demangled_prefix = "vtable for "; +char ItaniumABILanguageRuntime::ID = 0; + bool ItaniumABILanguageRuntime::CouldHaveDynamicValue(ValueObject &in_value) { const bool check_cxx = true; const bool check_objc = false; Index: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h =================================================================== --- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h +++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h @@ -28,14 +28,14 @@ // because // you can't make an instance of this generic runtime. - static bool classof(const ObjCLanguageRuntime *runtime) { - switch (runtime->GetRuntimeVersion()) { - case ObjCRuntimeVersions::eAppleObjC_V1: - case ObjCRuntimeVersions::eAppleObjC_V2: - return true; - default: - return false; - } + static char ID; + + bool isA(const void *ClassID) const override { + return ClassID == &ID || ObjCLanguageRuntime::isA(ClassID); + } + + static bool classof(const LanguageRuntime *runtime) { + return runtime->isA(&ID); } // These are generic runtime functions: Index: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp =================================================================== --- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp +++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp @@ -45,6 +45,8 @@ using namespace lldb; using namespace lldb_private; +char AppleObjCRuntime::ID = 0; + AppleObjCRuntime::~AppleObjCRuntime() {} AppleObjCRuntime::AppleObjCRuntime(Process *process) Index: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h =================================================================== --- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h +++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h @@ -29,13 +29,14 @@ static lldb_private::ConstString GetPluginNameStatic(); - static bool classof(const ObjCLanguageRuntime *runtime) { - switch (runtime->GetRuntimeVersion()) { - case ObjCRuntimeVersions::eAppleObjC_V1: - return true; - default: - return false; - } + static char ID; + + bool isA(const void *ClassID) const override { + return ClassID == &ID || AppleObjCRuntime::isA(ClassID); + } + + static bool classof(const LanguageRuntime *runtime) { + return runtime->isA(&ID); } lldb::addr_t GetTaggedPointerObfuscator(); Index: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp =================================================================== --- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp +++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp @@ -37,6 +37,8 @@ using namespace lldb; using namespace lldb_private; +char AppleObjCRuntimeV1::ID = 0; + AppleObjCRuntimeV1::AppleObjCRuntimeV1(Process *process) : AppleObjCRuntime(process), m_hash_signature(), m_isa_hash_table_ptr(LLDB_INVALID_ADDRESS) {} Index: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h =================================================================== --- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h +++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h @@ -35,13 +35,14 @@ static lldb_private::ConstString GetPluginNameStatic(); - static bool classof(const ObjCLanguageRuntime *runtime) { - switch (runtime->GetRuntimeVersion()) { - case ObjCRuntimeVersions::eAppleObjC_V2: - return true; - default: - return false; - } + static char ID; + + bool isA(const void *ClassID) const override { + return ClassID == &ID || AppleObjCRuntime::isA(ClassID); + } + + static bool classof(const LanguageRuntime *runtime) { + return runtime->isA(&ID); } // These are generic runtime functions: Index: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp =================================================================== --- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp +++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp @@ -70,6 +70,8 @@ using namespace lldb; using namespace lldb_private; +char AppleObjCRuntimeV2::ID = 0; + static const char *g_get_dynamic_class_info_name = "__lldb_apple_objc_v2_get_dynamic_class_info"; // Testing using the new C++11 raw string literals. If this breaks GCC then we Index: lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h =================================================================== --- lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h +++ lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h @@ -314,6 +314,16 @@ static lldb_private::ConstString GetPluginNameStatic(); + static char ID; + + bool isA(const void *ClassID) const override { + return ClassID == &ID || CPPLanguageRuntime::isA(ClassID); + } + + static bool classof(const LanguageRuntime *runtime) { + return runtime->isA(&ID); + } + static bool IsRenderScriptModule(const lldb::ModuleSP &module_sp); static ModuleKind GetModuleKind(const lldb::ModuleSP &module_sp); Index: lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp =================================================================== --- lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp +++ lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp @@ -48,6 +48,8 @@ #define FMT_COORD "(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ")" +char RenderScriptRuntime::ID = 0; + namespace { // The empirical_type adds a basic level of validation to arbitrary data @@ -1123,9 +1125,9 @@ RuntimeHook *hook = (RuntimeHook *)baton; ExecutionContext exe_ctx(ctx->exe_ctx_ref); - RenderScriptRuntime *lang_rt = - (RenderScriptRuntime *)exe_ctx.GetProcessPtr()->GetLanguageRuntime( - eLanguageTypeExtRenderScript); + RenderScriptRuntime *lang_rt = llvm::cast( + exe_ctx.GetProcessPtr()->GetLanguageRuntime( + eLanguageTypeExtRenderScript)); lang_rt->HookCallback(hook, exe_ctx); @@ -4122,9 +4124,9 @@ ~CommandObjectRenderScriptRuntimeModuleDump() override = default; bool DoExecute(Args &command, CommandReturnObject &result) override { - RenderScriptRuntime *runtime = - (RenderScriptRuntime *)m_exe_ctx.GetProcessPtr()->GetLanguageRuntime( - eLanguageTypeExtRenderScript); + RenderScriptRuntime *runtime = llvm::cast( + m_exe_ctx.GetProcessPtr()->GetLanguageRuntime( + eLanguageTypeExtRenderScript)); runtime->DumpModules(result.GetOutputStream()); result.SetStatus(eReturnStatusSuccessFinishResult); return true; @@ -4157,9 +4159,9 @@ ~CommandObjectRenderScriptRuntimeKernelList() override = default; bool DoExecute(Args &command, CommandReturnObject &result) override { - RenderScriptRuntime *runtime = - (RenderScriptRuntime *)m_exe_ctx.GetProcessPtr()->GetLanguageRuntime( - eLanguageTypeExtRenderScript); + RenderScriptRuntime *runtime = llvm::cast( + m_exe_ctx.GetProcessPtr()->GetLanguageRuntime( + eLanguageTypeExtRenderScript)); runtime->DumpKernels(result.GetOutputStream()); result.SetStatus(eReturnStatusSuccessFinishResult); return true; @@ -4404,9 +4406,9 @@ return false; } - RenderScriptRuntime *runtime = - (RenderScriptRuntime *)m_exe_ctx.GetProcessPtr()->GetLanguageRuntime( - eLanguageTypeExtRenderScript); + RenderScriptRuntime *runtime = llvm::cast( + m_exe_ctx.GetProcessPtr()->GetLanguageRuntime( + eLanguageTypeExtRenderScript)); auto &outstream = result.GetOutputStream(); auto &target = m_exe_ctx.GetTargetSP(); @@ -4588,9 +4590,9 @@ ~CommandObjectRenderScriptRuntimeContextDump() override = default; bool DoExecute(Args &command, CommandReturnObject &result) override { - RenderScriptRuntime *runtime = - (RenderScriptRuntime *)m_exe_ctx.GetProcessPtr()->GetLanguageRuntime( - eLanguageTypeExtRenderScript); + RenderScriptRuntime *runtime = llvm::cast( + m_exe_ctx.GetProcessPtr()->GetLanguageRuntime( + eLanguageTypeExtRenderScript)); runtime->DumpContexts(result.GetOutputStream()); result.SetStatus(eReturnStatusSuccessFinishResult); return true; @@ -4980,9 +4982,9 @@ ~CommandObjectRenderScriptRuntimeStatus() override = default; bool DoExecute(Args &command, CommandReturnObject &result) override { - RenderScriptRuntime *runtime = - (RenderScriptRuntime *)m_exe_ctx.GetProcessPtr()->GetLanguageRuntime( - eLanguageTypeExtRenderScript); + RenderScriptRuntime *runtime = llvm::cast( + m_exe_ctx.GetProcessPtr()->GetLanguageRuntime( + eLanguageTypeExtRenderScript)); runtime->DumpStatus(result.GetOutputStream()); result.SetStatus(eReturnStatusSuccessFinishResult); return true; Index: lldb/trunk/source/Target/CPPLanguageRuntime.cpp =================================================================== --- lldb/trunk/source/Target/CPPLanguageRuntime.cpp +++ lldb/trunk/source/Target/CPPLanguageRuntime.cpp @@ -35,6 +35,8 @@ static ConstString g_this = ConstString("this"); +char CPPLanguageRuntime::ID = 0; + // Destructor CPPLanguageRuntime::~CPPLanguageRuntime() {} Index: lldb/trunk/source/Target/LanguageRuntime.cpp =================================================================== --- lldb/trunk/source/Target/LanguageRuntime.cpp +++ lldb/trunk/source/Target/LanguageRuntime.cpp @@ -17,6 +17,8 @@ using namespace lldb; using namespace lldb_private; +char LanguageRuntime::ID = 0; + ExceptionSearchFilter::ExceptionSearchFilter(const lldb::TargetSP &target_sp, lldb::LanguageType language, bool update_module_list) Index: lldb/trunk/source/Target/ObjCLanguageRuntime.cpp =================================================================== --- lldb/trunk/source/Target/ObjCLanguageRuntime.cpp +++ lldb/trunk/source/Target/ObjCLanguageRuntime.cpp @@ -28,6 +28,8 @@ using namespace lldb; using namespace lldb_private; +char ObjCLanguageRuntime::ID = 0; + // Destructor ObjCLanguageRuntime::~ObjCLanguageRuntime() {} Index: lldb/trunk/source/Target/Process.cpp =================================================================== --- lldb/trunk/source/Target/Process.cpp +++ lldb/trunk/source/Target/Process.cpp @@ -1602,10 +1602,7 @@ std::lock_guard guard(m_language_runtimes_mutex); LanguageRuntime *runtime = GetLanguageRuntime(eLanguageTypeObjC, retry_if_null); - if (!runtime) - return nullptr; - - return static_cast(runtime); + return llvm::cast_or_null(runtime); } bool Process::IsPossibleDynamicValue(ValueObject &in_value) {