Lines Matching defs:die

340 void SymbolFileDWARF::GetTypes(const DWARFDIE &die, dw_offset_t min_die_offset,
343 if (die) {
344 const dw_offset_t die_offset = die.GetOffset();
350 const dw_tag_t tag = die.Tag();
398 Type *type = ResolveTypeUID(die, assert_not_being_parsed);
404 for (DWARFDIE child_die : die.children()) {
451 DWARFDIE die;
452 for (die = child_die.GetParent(); die; die = die.GetParent()) {
453 dw_tag_t tag = die.Tag();
461 return die;
903 const DWARFDIE &die) {
905 if (!die.IsValid())
908 auto type_system_or_err = GetTypeSystemForLanguage(GetLanguage(*die.GetCU()));
921 DWARFRangeList ranges = die.GetDIE()->GetAttributeAddressRanges(
922 die.GetCU(), /*check_hi_lo_pc=*/true);
935 ModuleSP module_sp(die.GetModule());
946 return dwarf_ast->ParseFunctionFromDWARF(comp_unit, die, func_range);
950 SymbolFileDWARF::ConstructFunctionDemangledName(const DWARFDIE &die) {
952 if (!die.IsValid()) {
956 auto type_system_or_err = GetTypeSystemForLanguage(GetLanguage(*die.GetCU()));
972 return dwarf_ast->ConstructDemangledNameFromDWARF(die);
1040 DWARFDIE die(dwarf_cu, &entry);
1041 if (comp_unit.FindFunctionByUID(die.GetID()))
1043 if (ParseFunction(comp_unit, die))
1183 const DWARFDIE die = dwarf_cu->DIE();
1184 if (!die)
1187 for (DWARFDIE child_die : die.children()) {
1338 DWARFDIE die = orig_die;
1339 while (die) {
1340 dw_tag_t tag = die.Tag();
1357 BlockSP block_sp(new Block(die.GetID()));
1371 if (die.GetDIENamesAndRanges(name, mangled_name, ranges, decl_file,
1432 if (die.HasChildren()) {
1434 ParseBlocksRecursive(comp_unit, block, die.GetFirstChild(),
1448 die.Clear();
1450 die = die.GetSibling();
1457 for (DWARFDIE die : parent_die.children()) {
1458 dw_tag_t tag = die.Tag();
1469 if (die.GetAttributeValueAsUnsigned(DW_AT_virtuality, 0) != 0)
1494 if (DWARFDIE die = GetDIE(type_uid))
1495 return GetDecl(die);
1507 if (DWARFDIE die = GetDIE(type_uid))
1508 return GetDeclContext(die);
1518 if (DWARFDIE die = GetDIE(type_uid))
1519 return GetContainingDeclContext(die);
1529 if (DWARFDIE die = GetDIE(type_uid))
1530 return die.GetDeclContext();
1558 Type *SymbolFileDWARF::ResolveTypeUID(const DWARFDIE &die,
1560 if (die) {
1565 "SymbolFileDWARF::ResolveTypeUID (die = {0:x16}) {1} ({2}) '{3}'",
1566 die.GetOffset(), DW_TAG_value_to_name(die.Tag()), die.Tag(),
1567 die.GetName());
1572 DWARFDIE decl_ctx_die = GetDeclContextDIEContainingDIE(die);
1583 "SymbolFileDWARF::ResolveTypeUID (die = {0:x16}) {1} ({2}) "
1585 die.GetOffset(), DW_TAG_value_to_name(die.Tag()), die.Tag(),
1586 die.GetName(), decl_ctx_die.GetOffset());
1594 return ResolveType(die);
1682 Type *SymbolFileDWARF::ResolveType(const DWARFDIE &die,
1685 if (die) {
1686 Type *type = GetTypeForDIE(die, resolve_function_context).get();
1693 "Parsing a die that is being parsed die: {0:x16}: {1} ({2}) {3}",
1694 die.GetOffset(), DW_TAG_value_to_name(die.Tag()), die.Tag(),
1695 die.GetName());
1722 ConstString class_name, llvm::function_ref<bool(DWARFDIE die)> callback) {
1726 bool SymbolFileDWARF::GetFunction(const DWARFDIE &die, SymbolContext &sc) {
1729 if (die && llvm::isa<DWARFCompileUnit>(die.GetCU())) {
1732 GetCompUnitForDWARFCompUnit(llvm::cast<DWARFCompileUnit>(*die.GetCU()));
1734 sc.function = sc.comp_unit->FindFunctionByUID(die.GetID()).get();
1736 sc.function = ParseFunction(*sc.comp_unit, die);
2019 const DWARFBaseDIE die = dwarf_cu->GetUnitDIEOnly();
2020 if (!die || die.HasChildren() || !die.GetDIE())
2023 const char *name = die.GetAttributeValueAsString(DW_AT_name, nullptr);
2032 const char *dwo_path = GetDWOName(*dwarf_cu, *die.GetDIE());
2040 die.GetAttributeValueAsString(DW_AT_comp_dir, nullptr);
2077 die.GetOffset(), dwo_module_spec.GetFileSpec().GetPath().c_str(),
2084 std::optional<uint64_t> dwo_id = ::GetDWOId(*dwarf_cu, *die.GetDIE());
2103 die.GetOffset(), dwo_module_spec.GetFileSpec().GetPath().c_str());
2400 m_index->GetGlobalVariables(ConstString(basename), [&](DWARFDIE die) {
2405 if (die.Tag() != DW_TAG_variable)
2408 auto *dwarf_cu = llvm::dyn_cast<DWARFCompileUnit>(die.GetCU());
2414 if (DWARFASTParser *dwarf_ast = GetDWARFParser(*die.GetCU())) {
2416 dwarf_ast->GetDeclContextContainingUIDFromDWARF(die);
2429 ParseAndAppendGlobalVariable(sc, die, variables);
2472 m_index->GetGlobalVariables(regex, [&](DWARFDIE die) {
2477 DWARFCompileUnit *dwarf_cu = llvm::dyn_cast<DWARFCompileUnit>(die.GetCU());
2482 ParseAndAppendGlobalVariable(sc, die, variables);
2496 // If we were passed a die that is not a function, just return false...
2501 DWARFDIE die = orig_die;
2503 if (die.Tag() == DW_TAG_inlined_subroutine) {
2504 inlined_die = die;
2507 die = die.GetParent();
2509 if (die) {
2510 if (die.Tag() == DW_TAG_subprogram)
2516 assert(die && die.Tag() == DW_TAG_subprogram);
2517 if (GetFunction(die, sc)) {
2540 const DWARFDIE &die,
2544 // particular decl context so any die matches.
2547 // 'die' is a top-level context.
2549 return die.GetParent().Tag() == llvm::dwarf::DW_TAG_compile_unit;
2554 if (die) {
2555 if (DWARFASTParser *dwarf_ast = GetDWARFParser(*die.GetCU())) {
2557 dwarf_ast->GetDeclContextContainingUIDFromDWARF(die))
2600 m_index->GetFunctions(lookup_info, *this, parent_decl_ctx, [&](DWARFDIE die) {
2601 if (resolved_dies.insert(die.GetDIE()).second)
2602 ResolveFunction(die, include_inlines, sc_list);
2617 [&](DWARFDIE die) {
2618 if (resolved_dies.insert(die.GetDIE()).second)
2619 ResolveFunction(die, include_inlines, sc_list);
2653 m_index->GetFunctions(regex, [&](DWARFDIE die) {
2654 if (resolved_dies.insert(die.GetDIE()).second)
2655 ResolveFunction(die, include_inlines, sc_list);
2677 DWARFDIE die = GetDIE(die_ref);
2678 mangled_names.push_back(ConstString(die.GetMangledName()));
2743 m_index->GetTypes(query.GetTypeBasename(), [&](DWARFDIE die) {
2746 if (!query.LanguageMatches(GetLanguageFamily(*die.GetCU())))
2753 die_context = die.GetDeclContext();
2755 die_context = die.GetTypeLookupContext();
2761 if (Type *matching_type = ResolveType(die, true, true)) {
2801 m_index->GetTypes(query_simple.GetTypeBasename(), [&](DWARFDIE die) {
2804 if (!query.LanguageMatches(GetLanguageFamily(*die.GetCU())))
2811 die_context = die.GetDeclContext();
2813 die_context = die.GetTypeLookupContext();
2819 if (Type *matching_type = ResolveType(die, true, true)) {
2874 m_index->GetNamespaces(name, [&](DWARFDIE die) {
2875 if (!DIEInDeclContext(parent_decl_ctx, die, only_root_namespaces))
2878 DWARFASTParser *dwarf_ast = GetDWARFParser(*die.GetCU());
2882 namespace_decl_ctx = dwarf_ast->GetDeclContextForUIDFromDWARF(die);
2900 TypeSP SymbolFileDWARF::GetTypeForDIE(const DWARFDIE &die,
2903 if (die) {
2904 Type *type_ptr = GetDIEToType().lookup(die.GetDIE());
2907 if (auto *dwarf_cu = llvm::dyn_cast<DWARFCompileUnit>(die.GetCU()))
2913 const DWARFDebugInfoEntry *parent_die = die.GetParent().GetDIE();
2921 !GetFunction(DWARFDIE(die.GetCU(), parent_die), sc))
2924 type_sp = ParseType(sc, die, nullptr);
2936 DWARFDIE die = orig_die;
2938 while (die) {
2942 if (orig_die != die) {
2943 switch (die.Tag()) {
2952 return die;
2954 DWARFDIE abs_die = die.GetReferencedDIE(DW_AT_abstract_origin);
2965 DWARFDIE spec_die = die.GetReferencedDIE(DW_AT_specification);
2972 DWARFDIE abs_die = die.GetReferencedDIE(DW_AT_abstract_origin);
2979 die = die.GetParent();
3032 const DWARFDIE &die, ConstString type_name, bool must_be_implementation) {
3043 if (type_die == die || !IsStructOrClassTag(type_die.Tag()))
3061 die.GetID(),
3065 if (die)
3066 GetDIEToType()[die.GetDIE()] = resolved_type;
3074 SymbolFileDWARF::FindDefinitionDIE(const DWARFDIE &die) {
3075 const char *name = die.GetName();
3078 if (!die.GetAttributeValueAsUnsigned(DW_AT_declaration, 0))
3079 return die;
3085 const dw_tag_t tag = die.Tag();
3099 const LanguageType language = GetLanguage(*die.GetCU());
3118 for (DWARFDIE ctx_die = die; ctx_die && !isUnitType(ctx_die.Tag());
3166 "name='{2}') ignoring die={3:x16} ({4})",
3178 "trying die={3:x16} ({4})",
3189 TypeSP SymbolFileDWARF::ParseType(const SymbolContext &sc, const DWARFDIE &die,
3191 if (!die)
3194 auto type_system_or_err = GetTypeSystemForLanguage(GetLanguage(*die.GetCU()));
3208 TypeSP type_sp = dwarf_ast->ParseTypeFromDWARF(sc, die, type_is_new_ptr);
3210 if (die.Tag() == DW_TAG_subprogram) {
3211 std::string scope_qualified_name(GetDeclContextForUID(die.GetID())
3216 *die.GetDIERef());
3228 DWARFDIE die = orig_die;
3230 while (die) {
3231 const dw_tag_t tag = die.Tag();
3240 ParseType(sc, die, &type_is_new);
3245 if (parse_children && die.HasChildren()) {
3246 if (die.Tag() == DW_TAG_subprogram) {
3248 child_sc.function = sc.comp_unit->FindFunctionByUID(die.GetID()).get();
3249 types_added += ParseTypes(child_sc, die.GetFirstChild(), true, true);
3251 types_added += ParseTypes(sc, die.GetFirstChild(), true, true);
3255 die = die.GetSibling();
3257 die.Clear();
3331 m_index->GetGlobalVariables(*dwarf_cu, [&](DWARFDIE die) {
3332 VariableSP var_sp(ParseVariableDIECached(sc, die));
3347 const DWARFDIE &die) {
3348 if (!die)
3351 DIEToVariableSP &die_to_variable = die.GetDWARF()->GetDIEToVariable();
3353 VariableSP var_sp = die_to_variable[die.GetDIE()];
3357 var_sp = ParseVariableDIE(sc, die, LLDB_INVALID_ADDRESS);
3359 die_to_variable[die.GetDIE()] = var_sp;
3360 if (DWARFDIE spec_die = die.GetReferencedDIE(DW_AT_specification))
3369 const DWARFDIE &die,
3372 const DWARFDataExtractor &data = die.GetData();
3377 module, DataExtractor(data, block_offset, block_length), die.GetCU());
3380 DWARFExpressionList location_list(module, DWARFExpression(), die.GetCU());
3381 DataExtractor data = die.GetCU()->GetLocationData();
3384 offset = die.GetCU()->GetLoclistOffset(offset).value_or(-1);
3400 const DWARFDIE &die) {
3401 const DWARFDataExtractor &debug_info_data = die.GetData();
3409 die.GetCU());
3414 die.GetCU()->GetByteOrder(),
3415 die.GetCU()->GetAddressByteSize()),
3416 die.GetCU());
3417 return DWARFExpressionList(module, DWARFExpression(), die.GetCU());
3429 DWARFExpressionList &expr_list, const DWARFDIE &die) {
3447 if (location->Update_DW_OP_addr(die.GetCU(), exe_file_addr))
3453 const DWARFDIE &die,
3455 if (die.GetDWARF() != this)
3456 return die.GetDWARF()->ParseVariableDIE(sc, die, func_low_pc);
3458 if (!die)
3461 const dw_tag_t tag = die.Tag();
3468 DWARFAttributes attributes = die.GetAttributes();
3541 return GetExprListFromAtLocation(location_form, module, die, func_low_pc);
3543 return GetExprListFromAtConstValue(const_value_form, module, die);
3544 return DWARFExpressionList(module, DWARFExpression(), die.GetCU());
3547 const DWARFDIE parent_context_die = GetDeclContextDIEContainingDIE(die);
3548 const DWARFDIE sc_parent_die = GetParentSymbolContextDIE(die);
3572 Language::LanguageIsCPlusPlus(GetLanguage(*die.GetCU())))
3573 mangled = die.GetDWARFDeclContext()
3605 "{0:x16}: {1} ({2}) has an invalid location: {3}", die.GetOffset(),
3606 DW_TAG_value_to_name(die.Tag()), die.Tag(), strm.GetData());
3630 die)) {
3645 location->Update_DW_OP_addr(die.GetCU(), exe_file_addr);
3654 die.GetDIE()->IsGlobalOrStaticScopeVariable())
3711 die.GetCU()->GetAddressByteSize());
3715 die.GetID(), name, mangled, type_sp, scope, symbol_context_scope,
3723 // Give the concrete function die specified by "func_die_offset", find the
3732 const DWARFDIE &die, dw_offset_t spec_block_die_offset) {
3733 if (die) {
3734 switch (die.Tag()) {
3738 if (die.GetReferencedDIE(DW_AT_specification).GetOffset() ==
3740 return die;
3742 if (die.GetReferencedDIE(DW_AT_abstract_origin).GetOffset() ==
3744 return die;
3750 // Give the concrete function die specified by "func_die_offset", find the
3753 for (DWARFDIE child_die : die.children()) {
3765 const SymbolContext &sc, const DWARFDIE &die,
3767 if (!die)
3770 dw_tag_t tag = die.Tag();
3775 VariableSP var_sp = GetDIEToVariable()[die.GetDIE()];
3785 DWARFDIE sc_parent_die = GetParentSymbolContextDIE(die);
3797 sc_parent_die.Tag(), die.GetID(), DW_TAG_value_to_name(die.Tag()),
3798 die.Tag());
3807 die.GetID(), DW_TAG_value_to_name(die.Tag()), die.Tag());
3811 var_sp = ParseVariableDIECached(sc, die);
3897 const SymbolContext &sc, const DWARFDIE &die,
3899 if (!die || !sc.function)
3903 // to this vector because |die| should be a
3906 return ParseVariablesInFunctionContextRecursive(sc, die, func_low_pc,
3910 // This method parses all the variables in the blocks in the subtree of |die|,
3915 const lldb_private::SymbolContext &sc, const DWARFDIE &die,
3918 dw_tag_t tag = die.Tag();
3922 accumulator.push_back(*die.GetDIERef());
3931 sc.function->GetBlock(/*can_create=*/true).FindBlockByID(die.GetID());
3938 GetDIE(sc.function->GetID()), die.GetOffset());
3956 for (DWARFDIE child = die.GetFirstChild(); child;
3962 MergeBlockAbstractParameters(die, std::move(block_variables));
3970 for (DWARFDIE child = die.GetFirstChild(); child;
3985 for (auto &die : variable_dies) {
3986 if (VariableSP var_sp = ParseVariableDIE(sc, GetDIE(die), func_low_pc)) {
4248 if (const DWARFBaseDIE die = dwarf_cu->GetUnitDIEOnly()) {
4249 const char *dwo_name = GetDWOName(*dwarf_cu, *die.GetDIE());
4256 const char *comp_dir = die.GetDIE()->GetAttributeValueAsString(
4381 CompilerDecl SymbolFileDWARF::GetDecl(const DWARFDIE &die) {
4382 if (DWARFASTParser *dwarf_ast = GetDWARFParser(*die.GetCU()))
4383 return dwarf_ast->GetDeclForUIDFromDWARF(die);
4387 CompilerDeclContext SymbolFileDWARF::GetDeclContext(const DWARFDIE &die) {
4388 if (DWARFASTParser *dwarf_ast = GetDWARFParser(*die.GetCU()))
4389 return dwarf_ast->GetDeclContextForUIDFromDWARF(die);
4394 SymbolFileDWARF::GetContainingDeclContext(const DWARFDIE &die) {
4395 if (DWARFASTParser *dwarf_ast = GetDWARFParser(*die.GetCU()))
4396 return dwarf_ast->GetDeclContextContainingUIDFromDWARF(die);
4474 const DWARFBaseDIE die = dwarf_cu->GetUnitDIEOnly();
4475 if (!die)
4478 const char *flags = die.GetAttributeValueAsString(DW_AT_APPLE_flags, NULL);