diff options
3 files changed, 68 insertions, 68 deletions
diff --git a/lldb/source/Expression/ClangExpressionDeclMap.cpp b/lldb/source/Expression/ClangExpressionDeclMap.cpp index 9dd2ea292c2..224fbacb415 100644 --- a/lldb/source/Expression/ClangExpressionDeclMap.cpp +++ b/lldb/source/Expression/ClangExpressionDeclMap.cpp @@ -970,45 +970,6 @@ ClangExpressionDeclMap::GetDecls if (m_exe_ctx.frame == NULL) return; - static ConstString g_lldb_class_name ("$__lldb_class"); - if (name == g_lldb_class_name) - { - // Clang is looking for the type of "this" - - VariableList *vars = m_exe_ctx.frame->GetVariableList(false); - - if (!vars) - return; - - lldb::VariableSP this_var = vars->FindVariable(ConstString("this")); - - if (!this_var) - return; - - Type *this_type = this_var->GetType(); - - if (!this_type) - return; - - TypeFromUser this_user_type(this_type->GetClangType(), - this_type->GetClangAST()); - - m_object_pointer_type = this_user_type; - - void *pointer_target_type; - - if (!ClangASTContext::IsPointerType(this_user_type.GetOpaqueQualType(), - &pointer_target_type)) - return; - - TypeFromUser class_user_type(pointer_target_type, - this_type->GetClangAST()); - - AddOneType(context, class_user_type, true); - - return; - } - SymbolContextList sym_ctxs; // Only look for functions by name out in our symbols if the function @@ -1066,6 +1027,45 @@ ClangExpressionDeclMap::GetDecls } else { + static ConstString g_lldb_class_name ("$__lldb_class"); + if (name == g_lldb_class_name) + { + // Clang is looking for the type of "this" + + VariableList *vars = m_exe_ctx.frame->GetVariableList(false); + + if (!vars) + return; + + lldb::VariableSP this_var = vars->FindVariable(ConstString("this")); + + if (!this_var) + return; + + Type *this_type = this_var->GetType(); + + if (!this_type) + return; + + TypeFromUser this_user_type(this_type->GetClangType(), + this_type->GetClangAST()); + + m_object_pointer_type = this_user_type; + + void *pointer_target_type; + + if (!ClangASTContext::IsPointerType(this_user_type.GetOpaqueQualType(), + &pointer_target_type)) + return; + + TypeFromUser class_user_type(pointer_target_type, + this_type->GetClangAST()); + + AddOneType(context, class_user_type, true); + + return; + } + ClangExpressionVariable *pvar(m_persistent_vars->GetVariable(name)); if (pvar) diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp index 247e42edc68..319a15f26ed 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp @@ -268,14 +268,14 @@ AppleObjCRuntimeV2::CreateObjectChecker(const char *name) else { assert(snprintf(&buf->contents[0], sizeof(buf->contents), - "extern \"C\" int gdb_class_getClass(void *); \n" - "extern \"C\" void \n" - "%s(void *$__lldb_arg_obj) \n" - "{ \n" - " void **isa_ptr = (void **)$__lldb_arg_obj; \n" - " if (!isa_ptr || !gdb_class_getClass(*isa_ptr)) \n" - " abort(); \n" - "} \n", + "extern \"C\" int gdb_class_getClass(void *); \n" + "extern \"C\" void \n" + "%s(void *$__lldb_arg_obj) \n" + "{ \n" + " void **$isa_ptr = (void **)$__lldb_arg_obj; \n" + " if (!$isa_ptr || !gdb_class_getClass(*$isa_ptr)) \n" + " abort(); \n" + "} \n", name) < sizeof(buf->contents)); } diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index 6492ae55622..4fd7681f905 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -2857,27 +2857,27 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, } -// if (is_forward_declaration) -// { -// // We have a forward declaration to a type and we need -// // to try and find a full declaration. We look in the -// // current type index just in case we have a forward -// // declaration followed by an actual declarations in the -// // DWARF. If this fails, we need to look elsewhere... -// -// type_sp = FindDefinitionTypeForDIE (dwarf_cu, die, type_name_const_str); -// -// if (!type_sp) -// { -// // We weren't able to find a full declaration in -// // this DWARF, see if we have a declaration anywhere -// // else... -// if (m_debug_map_symfile) -// type_sp = m_debug_map_symfile->FindDefinitionTypeForDIE (dwarf_cu, die, type_name_const_str); -// } -// if (type_sp) -// return type_sp; -// } + if (is_forward_declaration) + { + // We have a forward declaration to a type and we need + // to try and find a full declaration. We look in the + // current type index just in case we have a forward + // declaration followed by an actual declarations in the + // DWARF. If this fails, we need to look elsewhere... + + type_sp = FindDefinitionTypeForDIE (dwarf_cu, die, type_name_const_str); + + if (!type_sp) + { + // We weren't able to find a full declaration in + // this DWARF, see if we have a declaration anywhere + // else... + if (m_debug_map_symfile) + type_sp = m_debug_map_symfile->FindDefinitionTypeForDIE (dwarf_cu, die, type_name_const_str); + } + if (type_sp) + return type_sp; + } assert (tag_decl_kind != -1); bool clang_type_was_created = false; clang_type = m_forward_decl_die_to_clang_type.lookup (die); |