diff options
Diffstat (limited to 'lldb/source/Plugins/LanguageRuntime/ObjC')
3 files changed, 32 insertions, 13 deletions
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp index 8ca9ad7b843..7076959bee9 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp @@ -111,7 +111,10 @@ bool AppleObjCRuntime::GetObjectDescription(Stream &strm, Value &value, } } else { // If it is not a pointer, see if we can make it into a pointer. - ClangASTContext *ast_context = target->GetScratchClangASTContext(); + ClangASTContext *ast_context = ClangASTContext::GetScratch(*target); + if (!ast_context) + return false; + CompilerType opaque_type = ast_context->GetBasicType(eBasicTypeObjCID); if (!opaque_type) opaque_type = ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); @@ -123,7 +126,9 @@ bool AppleObjCRuntime::GetObjectDescription(Stream &strm, Value &value, arg_value_list.PushValue(value); // This is the return value: - ClangASTContext *ast_context = target->GetScratchClangASTContext(); + ClangASTContext *ast_context = ClangASTContext::GetScratch(*target); + if (!ast_context) + return false; CompilerType return_compiler_type = ast_context->GetCStringType(true); Value ret; @@ -494,9 +499,12 @@ ThreadSP AppleObjCRuntime::GetBacktraceThreadFromException( reserved_dict = reserved_dict->GetSyntheticValue(); if (!reserved_dict) return ThreadSP(); + ClangASTContext *clang_ast_context = + ClangASTContext::GetScratch(*exception_sp->GetTargetSP()); + if (!clang_ast_context) + return ThreadSP(); CompilerType objc_id = - exception_sp->GetTargetSP()->GetScratchClangASTContext()->GetBasicType( - lldb::eBasicTypeObjCID); + clang_ast_context->GetBasicType(lldb::eBasicTypeObjCID); ValueObjectSP return_addresses; auto objc_object_from_address = [&exception_sp, &objc_id](uint64_t addr, diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp index 750b6ce6b0c..c2d24edc8e4 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp @@ -1301,7 +1301,7 @@ AppleObjCRuntimeV2::UpdateISAToDescriptorMapDynamic( return DescriptorMapUpdateResult::Fail(); thread_sp->CalculateExecutionContext(exe_ctx); - ClangASTContext *ast = process->GetTarget().GetScratchClangASTContext(); + ClangASTContext *ast = ClangASTContext::GetScratch(process->GetTarget()); if (!ast) return DescriptorMapUpdateResult::Fail(); @@ -1563,7 +1563,7 @@ AppleObjCRuntimeV2::UpdateISAToDescriptorMapSharedCache() { return DescriptorMapUpdateResult::Fail(); thread_sp->CalculateExecutionContext(exe_ctx); - ClangASTContext *ast = process->GetTarget().GetScratchClangASTContext(); + ClangASTContext *ast = ClangASTContext::GetScratch(process->GetTarget()); if (!ast) return DescriptorMapUpdateResult::Fail(); @@ -2672,10 +2672,12 @@ class ObjCExceptionRecognizedStackFrame : public RecognizedStackFrame { const lldb::ABISP &abi = process_sp->GetABI(); if (!abi) return; - CompilerType voidstar = process_sp->GetTarget() - .GetScratchClangASTContext() - ->GetBasicType(lldb::eBasicTypeVoid) - .GetPointerType(); + ClangASTContext *clang_ast_context = + ClangASTContext::GetScratch(process_sp->GetTarget()); + if (!clang_ast_context) + return; + CompilerType voidstar = + clang_ast_context->GetBasicType(lldb::eBasicTypeVoid).GetPointerType(); ValueList args; Value input_value; diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp index 379ef3dca86..36f95c063b8 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp @@ -522,7 +522,10 @@ bool AppleObjCTrampolineHandler::AppleObjCVTables::RefreshTrampolines( const ABI *abi = process->GetABI().get(); ClangASTContext *clang_ast_context = - process->GetTarget().GetScratchClangASTContext(); + ClangASTContext::GetScratch(process->GetTarget()); + if (!clang_ast_context) + return false; + ValueList argument_values; Value input_value; CompilerType clang_void_ptr_type = @@ -802,7 +805,10 @@ AppleObjCTrampolineHandler::SetupDispatchFunction(Thread &thread, // Next make the runner function for our implementation utility function. ClangASTContext *clang_ast_context = - thread.GetProcess()->GetTarget().GetScratchClangASTContext(); + ClangASTContext::GetScratch(thread.GetProcess()->GetTarget()); + if (!clang_ast_context) + return LLDB_INVALID_ADDRESS; + CompilerType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); Status error; @@ -895,7 +901,10 @@ AppleObjCTrampolineHandler::GetStepThroughDispatchPlan(Thread &thread, TargetSP target_sp(thread.CalculateTarget()); - ClangASTContext *clang_ast_context = target_sp->GetScratchClangASTContext(); + ClangASTContext *clang_ast_context = ClangASTContext::GetScratch(*target_sp); + if (!clang_ast_context) + return ret_plan_sp; + ValueList argument_values; Value void_ptr_value; CompilerType clang_void_ptr_type = |