diff options
Diffstat (limited to 'lldb/source/Plugins/LanguageRuntime/ObjC')
4 files changed, 55 insertions, 55 deletions
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp index 1f3f4e0ca3f..b21d76ca660 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp @@ -81,10 +81,10 @@ AppleObjCRuntime::GetObjectDescription (Stream &strm, Value &value, ExecutionCon return false; Target *target = exe_ctx.GetTargetPtr(); - if (value.GetClangType()) + ClangASTType clang_type = value.GetClangType(); + if (clang_type) { - clang::QualType value_type = clang::QualType::getFromOpaquePtr (value.GetClangType()); - if (!value_type->isObjCObjectPointerType()) + if (!clang_type.IsObjCObjectPointerType()) { strm.Printf ("Value doesn't point to an ObjC object.\n"); return false; @@ -94,10 +94,11 @@ AppleObjCRuntime::GetObjectDescription (Stream &strm, Value &value, ExecutionCon { // If it is not a pointer, see if we can make it into a pointer. ClangASTContext *ast_context = target->GetScratchClangASTContext(); - void *opaque_type_ptr = ast_context->GetBuiltInType_objc_id(); - if (opaque_type_ptr == NULL) - opaque_type_ptr = ast_context->GetVoidPtrType(false); - value.SetContext(Value::eContextTypeClangType, opaque_type_ptr); + ClangASTType opaque_type = ast_context->GetBasicType(eBasicTypeObjCID); + if (!opaque_type) + opaque_type = ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); + //value.SetContext(Value::eContextTypeClangType, opaque_type_ptr); + value.SetClangType (opaque_type); } ValueList arg_value_list; @@ -106,9 +107,10 @@ AppleObjCRuntime::GetObjectDescription (Stream &strm, Value &value, ExecutionCon // This is the return value: ClangASTContext *ast_context = target->GetScratchClangASTContext(); - void *return_qualtype = ast_context->GetCStringType(true); + ClangASTType return_clang_type = ast_context->GetCStringType(true); Value ret; - ret.SetContext(Value::eContextTypeClangType, return_qualtype); +// ret.SetContext(Value::eContextTypeClangType, return_clang_type); + ret.SetClangType (return_clang_type); if (exe_ctx.GetFramePtr() == NULL) { @@ -126,8 +128,7 @@ AppleObjCRuntime::GetObjectDescription (Stream &strm, Value &value, ExecutionCon // Now we're ready to call the function: ClangFunction func (*exe_ctx.GetBestExecutionContextScope(), - ast_context, - return_qualtype, + return_clang_type, *function_address, arg_value_list); @@ -221,10 +222,9 @@ AppleObjCRuntime::GetPrintForDebuggerAddr() bool AppleObjCRuntime::CouldHaveDynamicValue (ValueObject &in_value) { - return ClangASTContext::IsPossibleDynamicType(in_value.GetClangAST(), in_value.GetClangType(), - NULL, - false, // do not check C++ - true); // check ObjC + return in_value.GetClangType().IsPossibleDynamicType (NULL, + false, // do not check C++ + true); // check ObjC } bool diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp index 6d3d4fd5f8d..16ffe0b042a 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp @@ -178,13 +178,14 @@ AppleObjCRuntimeV1::CreateObjectChecker(const char *name) //ObjCLanguageRuntime::ObjCISA //AppleObjCRuntimeV1::GetISA(ValueObject& valobj) //{ -//// if (ClangASTType::GetMinimumLanguage(valobj.GetClangAST(),valobj.GetClangType()) != eLanguageTypeObjC) +// ClangASTType valobj_clang_type = valobj.GetClangType(); +//// if (valobj_clang_type.GetMinimumLanguage() != eLanguageTypeObjC) //// return 0; // // // if we get an invalid VO (which might still happen when playing around // // with pointers returned by the expression parser, don't consider this // // a valid ObjC object) -// if (valobj.GetValue().GetContextType() == Value::eContextTypeInvalid) +// if (!valobj.GetClangType().IsValid()) // return 0; // // addr_t isa_pointer = valobj.GetPointerValue(); diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp index 683645a47af..23a0e23e7c5 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp @@ -1613,7 +1613,7 @@ AppleObjCRuntimeV2::GetClassDescriptor (ValueObject& valobj) // if we get an invalid VO (which might still happen when playing around // with pointers returned by the expression parser, don't consider this // a valid ObjC object) - if (valobj.GetValue().GetContextType() != Value::eContextTypeInvalid) + if (valobj.GetClangType().IsValid()) { addr_t isa_pointer = valobj.GetPointerValue(); @@ -1719,8 +1719,8 @@ AppleObjCRuntimeV2::UpdateISAToDescriptorMapDynamic(RemoteNXMapTable &hash_table } // Make some types for our arguments - clang_type_t clang_uint32_t_type = ast->GetBuiltinTypeForEncodingAndBitSize(eEncodingUint, 32); - clang_type_t clang_void_pointer_type = ast->CreatePointerType(ast->GetBuiltInType_void()); + ClangASTType clang_uint32_t_type = ast->GetBuiltinTypeForEncodingAndBitSize(eEncodingUint, 32); + ClangASTType clang_void_pointer_type = ast->GetBasicType(eBasicTypeVoid).GetPointerType(); if (!m_get_class_info_code.get()) { @@ -1749,19 +1749,17 @@ AppleObjCRuntimeV2::UpdateISAToDescriptorMapDynamic(RemoteNXMapTable &hash_table { Value value; value.SetValueType (Value::eValueTypeScalar); - value.SetContext (Value::eContextTypeClangType, clang_void_pointer_type); +// value.SetContext (Value::eContextTypeClangType, clang_void_pointer_type); + value.SetClangType (clang_void_pointer_type); arguments.PushValue (value); - - value.SetValueType (Value::eValueTypeScalar); - value.SetContext (Value::eContextTypeClangType, clang_void_pointer_type); arguments.PushValue (value); value.SetValueType (Value::eValueTypeScalar); - value.SetContext (Value::eContextTypeClangType, clang_uint32_t_type); +// value.SetContext (Value::eContextTypeClangType, clang_uint32_t_type); + value.SetClangType (clang_uint32_t_type); arguments.PushValue (value); m_get_class_info_function.reset(new ClangFunction (*m_process, - ast, clang_uint32_t_type, function_address, arguments)); @@ -1827,7 +1825,8 @@ AppleObjCRuntimeV2::UpdateISAToDescriptorMapDynamic(RemoteNXMapTable &hash_table Value return_value; return_value.SetValueType (Value::eValueTypeScalar); - return_value.SetContext (Value::eContextTypeClangType, clang_uint32_t_type); + //return_value.SetContext (Value::eContextTypeClangType, clang_uint32_t_type); + return_value.SetClangType (clang_uint32_t_type); return_value.GetScalar() = 0; errors.Clear(); @@ -1971,8 +1970,8 @@ AppleObjCRuntimeV2::UpdateISAToDescriptorMapSharedCache() } // Make some types for our arguments - clang_type_t clang_uint32_t_type = ast->GetBuiltinTypeForEncodingAndBitSize(eEncodingUint, 32); - clang_type_t clang_void_pointer_type = ast->CreatePointerType(ast->GetBuiltInType_void()); + ClangASTType clang_uint32_t_type = ast->GetBuiltinTypeForEncodingAndBitSize(eEncodingUint, 32); + ClangASTType clang_void_pointer_type = ast->GetBasicType(eBasicTypeVoid).GetPointerType(); if (!m_get_shared_cache_class_info_code.get()) { @@ -2001,19 +2000,17 @@ AppleObjCRuntimeV2::UpdateISAToDescriptorMapSharedCache() { Value value; value.SetValueType (Value::eValueTypeScalar); - value.SetContext (Value::eContextTypeClangType, clang_void_pointer_type); + //value.SetContext (Value::eContextTypeClangType, clang_void_pointer_type); + value.SetClangType (clang_void_pointer_type); arguments.PushValue (value); - - value.SetValueType (Value::eValueTypeScalar); - value.SetContext (Value::eContextTypeClangType, clang_void_pointer_type); arguments.PushValue (value); value.SetValueType (Value::eValueTypeScalar); - value.SetContext (Value::eContextTypeClangType, clang_uint32_t_type); + //value.SetContext (Value::eContextTypeClangType, clang_uint32_t_type); + value.SetClangType (clang_uint32_t_type); arguments.PushValue (value); m_get_shared_cache_class_info_function.reset(new ClangFunction (*m_process, - ast, clang_uint32_t_type, function_address, arguments)); @@ -2079,7 +2076,8 @@ AppleObjCRuntimeV2::UpdateISAToDescriptorMapSharedCache() Value return_value; return_value.SetValueType (Value::eValueTypeScalar); - return_value.SetContext (Value::eContextTypeClangType, clang_uint32_t_type); + //return_value.SetContext (Value::eContextTypeClangType, clang_uint32_t_type); + return_value.SetClangType (clang_uint32_t_type); return_value.GetScalar() = 0; errors.Clear(); diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp index a76326eba19..b7c5df200c0 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp @@ -512,9 +512,11 @@ AppleObjCTrampolineHandler::AppleObjCVTables::RefreshTrampolines (void *baton, ClangASTContext *clang_ast_context = process->GetTarget().GetScratchClangASTContext(); ValueList argument_values; Value input_value; - void *clang_void_ptr_type = clang_ast_context->GetVoidPtrType(false); + ClangASTType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); + input_value.SetValueType (Value::eValueTypeScalar); - input_value.SetContext (Value::eContextTypeClangType, clang_void_ptr_type); + //input_value.SetContext (Value::eContextTypeClangType, clang_void_ptr_type); + input_value.SetClangType (clang_void_ptr_type); argument_values.PushValue(input_value); bool success = abi->GetArgumentValues (exe_ctx.GetThreadRef(), argument_values); @@ -525,7 +527,6 @@ AppleObjCTrampolineHandler::AppleObjCVTables::RefreshTrampolines (void *baton, Error error; DataExtractor data; error = argument_values.GetValueAtIndex(0)->GetValueAsData (&exe_ctx, - clang_ast_context->getASTContext(), data, 0, NULL); @@ -783,13 +784,12 @@ AppleObjCTrampolineHandler::SetupDispatchFunction (Thread &thread, ValueList &di // Next make the runner function for our implementation utility function. if (!m_impl_function.get()) { - ClangASTContext *clang_ast_context = thread.GetProcess()->GetTarget().GetScratchClangASTContext(); - lldb::clang_type_t clang_void_ptr_type = clang_ast_context->GetVoidPtrType(false); - m_impl_function.reset(new ClangFunction (thread, - clang_ast_context, - clang_void_ptr_type, - impl_code_address, - dispatch_values)); + ClangASTContext *clang_ast_context = thread.GetProcess()->GetTarget().GetScratchClangASTContext(); + ClangASTType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); + m_impl_function.reset(new ClangFunction (thread, + clang_void_ptr_type, + impl_code_address, + dispatch_values)); errors.Clear(); unsigned num_errors = m_impl_function->CompileFunction(errors); @@ -887,9 +887,10 @@ AppleObjCTrampolineHandler::GetStepThroughDispatchPlan (Thread &thread, bool sto ClangASTContext *clang_ast_context = target_sp->GetScratchClangASTContext(); ValueList argument_values; Value void_ptr_value; - lldb::clang_type_t clang_void_ptr_type = clang_ast_context->GetVoidPtrType(false); + ClangASTType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); void_ptr_value.SetValueType (Value::eValueTypeScalar); - void_ptr_value.SetContext (Value::eContextTypeClangType, clang_void_ptr_type); + //void_ptr_value.SetContext (Value::eContextTypeClangType, clang_void_ptr_type); + void_ptr_value.SetClangType (clang_void_ptr_type); int obj_index; int sel_index; @@ -949,14 +950,14 @@ AppleObjCTrampolineHandler::GetStepThroughDispatchPlan (Thread &thread, bool sto Value super_value(*(argument_values.GetValueAtIndex(obj_index))); super_value.GetScalar() += process->GetAddressByteSize(); - super_value.ResolveValue (&exe_ctx, clang_ast_context->getASTContext()); + super_value.ResolveValue (&exe_ctx); if (super_value.GetScalar().IsValid()) { // isa_value now holds the class pointer. The second word of the class pointer is the super-class pointer: super_value.GetScalar() += process->GetAddressByteSize(); - super_value.ResolveValue (&exe_ctx, clang_ast_context->getASTContext()); + super_value.ResolveValue (&exe_ctx); if (super_value.GetScalar().IsValid()) isa_addr = super_value.GetScalar().ULongLong(); else @@ -979,7 +980,7 @@ AppleObjCTrampolineHandler::GetStepThroughDispatchPlan (Thread &thread, bool sto Value super_value(*(argument_values.GetValueAtIndex(obj_index))); super_value.GetScalar() += process->GetAddressByteSize(); - super_value.ResolveValue (&exe_ctx, clang_ast_context->getASTContext()); + super_value.ResolveValue (&exe_ctx); if (super_value.GetScalar().IsValid()) { @@ -1006,7 +1007,7 @@ AppleObjCTrampolineHandler::GetStepThroughDispatchPlan (Thread &thread, bool sto Value isa_value(*(argument_values.GetValueAtIndex(obj_index))); isa_value.SetValueType(Value::eValueTypeLoadAddress); - isa_value.ResolveValue(&exe_ctx, clang_ast_context->getASTContext()); + isa_value.ResolveValue(&exe_ctx); if (isa_value.GetScalar().IsValid()) { isa_addr = isa_value.GetScalar().ULongLong(); @@ -1068,10 +1069,10 @@ AppleObjCTrampolineHandler::GetStepThroughDispatchPlan (Thread &thread, bool sto dispatch_values.PushValue (*(argument_values.GetValueAtIndex(sel_index))); Value flag_value; - lldb::clang_type_t clang_int_type - = clang_ast_context->GetBuiltinTypeForEncodingAndBitSize(lldb::eEncodingSint, 32); + ClangASTType clang_int_type = clang_ast_context->GetBuiltinTypeForEncodingAndBitSize(lldb::eEncodingSint, 32); flag_value.SetValueType (Value::eValueTypeScalar); - flag_value.SetContext (Value::eContextTypeClangType, clang_int_type); + //flag_value.SetContext (Value::eContextTypeClangType, clang_int_type); + flag_value.SetClangType (clang_int_type); if (this_dispatch.stret_return) flag_value.GetScalar() = 1; |