Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp =================================================================== --- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -3049,13 +3049,38 @@ bool parse_siblings, bool parse_children) { size_t types_added = 0; DWARFDIE die = orig_die; + while (die) { + const dw_tag_t tag = die.Tag(); bool type_is_new = false; - if (ParseType(sc, die, &type_is_new).get()) { - if (type_is_new) - ++types_added; + + switch (tag) { + case DW_TAG_array_type: + case DW_TAG_unspecified_type: + case DW_TAG_base_type: + case DW_TAG_class_type: + case DW_TAG_structure_type: + case DW_TAG_union_type: + case DW_TAG_enumeration_type: + case DW_TAG_subroutine_type: + case DW_TAG_subprogram: + case DW_TAG_inlined_subroutine: + case DW_TAG_pointer_type: + case DW_TAG_rvalue_reference_type: + case DW_TAG_reference_type: + case DW_TAG_typedef: + case DW_TAG_ptr_to_member_type: + ParseType(sc, die, &type_is_new).get(); + printf("pubname: %s is_type = %d\n", die.GetPubname(), true); + break; + default: + printf("pubname: %s is_type = %d\n", die.GetPubname(), false); + break; } + if (type_is_new) + ++types_added; + if (parse_children && die.HasChildren()) { if (die.Tag() == DW_TAG_subprogram) { SymbolContext child_sc(sc); Index: tools/lldb-test/lldb-test.cpp =================================================================== --- tools/lldb-test/lldb-test.cpp +++ tools/lldb-test/lldb-test.cpp @@ -42,6 +42,7 @@ #include "llvm/Support/PrettyStackTrace.h" #include "llvm/Support/Signals.h" #include "llvm/Support/WithColor.h" + #include #include @@ -548,6 +549,34 @@ tu->print(outs()); + lldb_private::TypeList type_list; + size_t ntypes = symfile->GetTypes(nullptr, eTypeClassAny, type_list); + printf("Type list size: %zu\n", ntypes); + + for (size_t i = 0; i < ntypes; ++i) { + auto type = type_list.GetTypeAtIndex(i); + printf("%s\n", type->GetName().AsCString()); + + if (clang::CXXRecordDecl *record_decl = clang_ast_ctx->GetAsCXXRecordDecl( + type->GetFullCompilerType().GetOpaqueQualType())) + record_decl->dump(); + else if (clang::TagDecl *tag_decl = + clang_ast_ctx->GetAsTagDecl(type->GetFullCompilerType())) + tag_decl->dump(); + else if (clang::TypedefNameDecl *typedef_decl = + clang_ast_ctx->GetAsTypedefDecl(type->GetFullCompilerType())) + typedef_decl->dump(); + else if (clang::EnumDecl *enum_decl = + clang_ast_ctx->GetAsEnumDecl(type->GetFullCompilerType())) + enum_decl->dump(); + else { + clang_ast_ctx + ->GetCanonicalQualType( + type->GetFullCompilerType().GetOpaqueQualType()) + .dump(); + } + } + return Error::success(); }