Lines Matching refs:dwarf

45 static dwarf::Tag GetCompileUnitType(UnitKind Kind, DwarfDebug *DW) {  in GetCompileUnitType()
53 return dwarf::DW_TAG_skeleton_unit; in GetCompileUnitType()
55 return dwarf::DW_TAG_compile_unit; in GetCompileUnitType()
68 void DwarfCompileUnit::addLabelAddress(DIE &Die, dwarf::Attribute Attribute, in addLabelAddress()
87 DD->getDwarfVersion() >= 5 ? dwarf::DW_FORM_addrx in addLabelAddress()
88 : dwarf::DW_FORM_GNU_addr_index, in addLabelAddress()
101 addBlock(Die, Attribute, dwarf::DW_FORM_exprloc, Loc); in addLabelAddress()
103 addAttribute(Die, Attribute, dwarf::DW_FORM_LLVM_addrx_offset, in addLabelAddress()
109 dwarf::Attribute Attribute, in addLocalLabelAddress()
112 addAttribute(Die, Attribute, dwarf::DW_FORM_addr, DIELabel(Label)); in addLocalLabelAddress()
114 addAttribute(Die, Attribute, dwarf::DW_FORM_addr, DIEInteger(0)); in addLocalLabelAddress()
161 addDIEEntry(*VariableDIE, dwarf::DW_AT_specification, *VariableSpecDIE); in getOrCreateGlobalVariableDIE()
171 addString(*VariableDIE, dwarf::DW_AT_name, GV->getDisplayName()); in getOrCreateGlobalVariableDIE()
177 addFlag(*VariableDIE, dwarf::DW_AT_external); in getOrCreateGlobalVariableDIE()
184 addFlag(*VariableDIE, dwarf::DW_AT_declaration); in getOrCreateGlobalVariableDIE()
191 addUInt(*VariableDIE, dwarf::DW_AT_alignment, dwarf::DW_FORM_udata, in getOrCreateGlobalVariableDIE()
274 dwarf::Form Form; in addLocationAttribute()
275 dwarf::LocationAtom Op; in addLocationAttribute()
278 ? FormAndOp{dwarf::DW_FORM_data4, dwarf::DW_OP_const4u} in addLocationAttribute()
279 : FormAndOp{dwarf::DW_FORM_data8, dwarf::DW_OP_const8u}; in addLocationAttribute()
290 addUInt(*Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_plus); in addLocationAttribute()
299 addUInt(*Loc, dwarf::DW_FORM_data1, FormAndOp.Op); in addLocationAttribute()
305 addUInt(*Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_GNU_const_index); in addLocationAttribute()
306 addUInt(*Loc, dwarf::DW_FORM_udata, in addLocationAttribute()
310 addUInt(*Loc, dwarf::DW_FORM_data1, in addLocationAttribute()
311 DD->useGNUTLSOpcode() ? dwarf::DW_OP_GNU_push_tls_address in addLocationAttribute()
312 : dwarf::DW_OP_form_tls_address); in addLocationAttribute()
321 addUInt(*Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_plus); in addLocationAttribute()
329 addUInt(*Loc, dwarf::DW_FORM_data1, FormAndOp.Op); in addLocationAttribute()
336 addUInt(*Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_breg0 + BaseReg); in addLocationAttribute()
338 addSInt(*Loc, dwarf::DW_FORM_sdata, 0); in addLocationAttribute()
340 addUInt(*Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_plus); in addLocationAttribute()
360 addUInt(*VariableDIE, dwarf::DW_AT_address_class, dwarf::DW_FORM_data1, in addLocationAttribute()
364 addBlock(*VariableDIE, dwarf::DW_AT_location, DwarfExpr->finalize()); in addLocationAttribute()
388 DIE &NDie = createAndAddDIE(dwarf::DW_TAG_common_block, *ContextDIE, CB); in getOrCreateCommonBlock()
390 addString(NDie, dwarf::DW_AT_name, Name); in getOrCreateCommonBlock()
439 addSectionLabel(getUnitDie(), dwarf::DW_AT_stmt_list, LineTableStartSym, in initStmtList()
445 addSectionLabel(D, dwarf::DW_AT_stmt_list, LineTableStartSym, in applyStmtList()
456 addLabelAddress(D, dwarf::DW_AT_low_pc, Begin); in attachLowHighPC()
458 addLabelAddress(D, dwarf::DW_AT_high_pc, End); in attachLowHighPC()
460 addLabelDelta(D, dwarf::DW_AT_high_pc, End, Begin); in attachLowHighPC()
481 addUInt(*Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_WASM_location); in addWasmRelocBaseGlobal()
482 addSInt(*Loc, dwarf::DW_FORM_sdata, TI_GLOBAL_RELOC); in addWasmRelocBaseGlobal()
484 addLabel(*Loc, dwarf::DW_FORM_data4, Sym); in addWasmRelocBaseGlobal()
492 addUInt(*Loc, dwarf::DW_FORM_data4, GlobalIndex); in addWasmRelocBaseGlobal()
512 addFlag(*SPDie, dwarf::DW_AT_APPLE_omit_frame_ptr); in updateSubprogramScopeDIE()
523 addAddress(*SPDie, dwarf::DW_AT_frame_base, Location); in updateSubprogramScopeDIE()
529 addUInt(*Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_call_frame_cfa); in updateSubprogramScopeDIE()
531 addUInt(*Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_consts); in updateSubprogramScopeDIE()
532 addSInt(*Loc, dwarf::DW_FORM_sdata, FrameBase.Location.Offset); in updateSubprogramScopeDIE()
533 addUInt(*Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_plus); in updateSubprogramScopeDIE()
535 addBlock(*SPDie, dwarf::DW_AT_frame_base, Loc); in updateSubprogramScopeDIE()
548 addUInt(*Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_stack_value); in updateSubprogramScopeDIE()
549 addBlock(*SPDie, dwarf::DW_AT_frame_base, Loc); in updateSubprogramScopeDIE()
557 addBlock(*SPDie, dwarf::DW_AT_frame_base, DwarfExpr.finalize()); in updateSubprogramScopeDIE()
623 addUInt(ScopeDIE, dwarf::DW_AT_ranges, dwarf::DW_FORM_rnglistx, Index); in addScopeRangeList()
629 addSectionDelta(ScopeDIE, dwarf::DW_AT_ranges, List.Label, in addScopeRangeList()
632 addSectionLabel(ScopeDIE, dwarf::DW_AT_ranges, List.Label, in addScopeRangeList()
696 auto ScopeDIE = DIE::get(DIEValueAllocator, dwarf::DW_TAG_inlined_subroutine); in constructInlinedScopeDIE()
698 addDIEEntry(*ScopeDIE, dwarf::DW_AT_abstract_origin, *OriginDIE); in constructInlinedScopeDIE()
704 addUInt(*ScopeDIE, dwarf::DW_AT_call_file, std::nullopt, in constructInlinedScopeDIE()
706 addUInt(*ScopeDIE, dwarf::DW_AT_call_line, std::nullopt, IA->getLine()); in constructInlinedScopeDIE()
708 addUInt(*ScopeDIE, dwarf::DW_AT_call_column, std::nullopt, IA->getColumn()); in constructInlinedScopeDIE()
710 addUInt(*ScopeDIE, dwarf::DW_AT_GNU_discriminator, std::nullopt, in constructInlinedScopeDIE()
728 auto ScopeDIE = DIE::get(DIEValueAllocator, dwarf::DW_TAG_lexical_block); in constructLexicalScopeDIE()
779 addBlock(VariableDie, dwarf::DW_AT_location, DwarfExpr.finalize()); in applyConcreteDbgVariableAttributes()
781 addUInt(VariableDie, dwarf::DW_AT_LLVM_tag_offset, in applyConcreteDbgVariableAttributes()
782 dwarf::DW_FORM_data1, *DwarfExpr.TagOffset); in applyConcreteDbgVariableAttributes()
795 addBlock(VariableDie, dwarf::DW_AT_location, DwarfExpr.finalize()); in applyConcreteDbgVariableAttributes()
856 addBlock(VariableDie, dwarf::DW_AT_location, DwarfExpr.finalize()); in applyConcreteDbgVariableAttributes()
858 addUInt(VariableDie, dwarf::DW_AT_LLVM_tag_offset, dwarf::DW_FORM_data1, in applyConcreteDbgVariableAttributes()
864 addLocationList(VariableDie, dwarf::DW_AT_location, in applyConcreteDbgVariableAttributes()
868 addUInt(VariableDie, dwarf::DW_AT_LLVM_tag_offset, dwarf::DW_FORM_data1, in applyConcreteDbgVariableAttributes()
923 addUInt(VariableDie, dwarf::DW_AT_address_class, dwarf::DW_FORM_data1, in applyConcreteDbgVariableAttributes()
926 addBlock(VariableDie, dwarf::DW_AT_location, DwarfExpr.finalize()); in applyConcreteDbgVariableAttributes()
928 addUInt(VariableDie, dwarf::DW_AT_LLVM_tag_offset, dwarf::DW_FORM_data1, in applyConcreteDbgVariableAttributes()
946 addBlock(VariableDie, dwarf::DW_AT_location, DwarfExpr.finalize()); in applyConcreteDbgVariableAttributes()
977 if (!Array || Array->getTag() != dwarf::DW_TAG_array_type) in dependencies()
1087 addDIEEntry(ScopeDIE, dwarf::DW_AT_object_pointer, *ObjectPointer); in constructSubprogramScopeDIE()
1099 DIE::get(DIEValueAllocator, dwarf::DW_TAG_unspecified_parameters)); in constructSubprogramScopeDIE()
1180 DIE &AbsDef = ContextCU->createAndAddDIE(dwarf::DW_TAG_subprogram, in constructAbstractSubprogramScopeDIE()
1187 ContextCU->addSInt(AbsDef, dwarf::DW_AT_inline, in constructAbstractSubprogramScopeDIE()
1188 DD->getDwarfVersion() <= 4 ? std::optional<dwarf::Form>() in constructAbstractSubprogramScopeDIE()
1189 : dwarf::DW_FORM_implicit_const, in constructAbstractSubprogramScopeDIE()
1190 dwarf::DW_INL_inlined); in constructAbstractSubprogramScopeDIE()
1192 ContextCU->addDIEEntry(AbsDef, dwarf::DW_AT_object_pointer, *ObjectPointer); in constructAbstractSubprogramScopeDIE()
1199 dwarf::Tag DwarfCompileUnit::getDwarf5OrGNUTag(dwarf::Tag Tag) const { in getDwarf5OrGNUTag()
1203 case dwarf::DW_TAG_call_site: in getDwarf5OrGNUTag()
1204 return dwarf::DW_TAG_GNU_call_site; in getDwarf5OrGNUTag()
1205 case dwarf::DW_TAG_call_site_parameter: in getDwarf5OrGNUTag()
1206 return dwarf::DW_TAG_GNU_call_site_parameter; in getDwarf5OrGNUTag()
1212 dwarf::Attribute
1213 DwarfCompileUnit::getDwarf5OrGNUAttr(dwarf::Attribute Attr) const { in getDwarf5OrGNUAttr()
1217 case dwarf::DW_AT_call_all_calls: in getDwarf5OrGNUAttr()
1218 return dwarf::DW_AT_GNU_all_call_sites; in getDwarf5OrGNUAttr()
1219 case dwarf::DW_AT_call_target: in getDwarf5OrGNUAttr()
1220 return dwarf::DW_AT_GNU_call_site_target; in getDwarf5OrGNUAttr()
1221 case dwarf::DW_AT_call_origin: in getDwarf5OrGNUAttr()
1222 return dwarf::DW_AT_abstract_origin; in getDwarf5OrGNUAttr()
1223 case dwarf::DW_AT_call_return_pc: in getDwarf5OrGNUAttr()
1224 return dwarf::DW_AT_low_pc; in getDwarf5OrGNUAttr()
1225 case dwarf::DW_AT_call_value: in getDwarf5OrGNUAttr()
1226 return dwarf::DW_AT_GNU_call_site_value; in getDwarf5OrGNUAttr()
1227 case dwarf::DW_AT_call_tail_call: in getDwarf5OrGNUAttr()
1228 return dwarf::DW_AT_GNU_tail_call; in getDwarf5OrGNUAttr()
1234 dwarf::LocationAtom
1235 DwarfCompileUnit::getDwarf5OrGNULocationAtom(dwarf::LocationAtom Loc) const { in getDwarf5OrGNULocationAtom()
1239 case dwarf::DW_OP_entry_value: in getDwarf5OrGNULocationAtom()
1240 return dwarf::DW_OP_GNU_entry_value; in getDwarf5OrGNULocationAtom()
1253 DIE &CallSiteDIE = createAndAddDIE(getDwarf5OrGNUTag(dwarf::DW_TAG_call_site), in constructCallSiteEntryDIE()
1258 addAddress(CallSiteDIE, getDwarf5OrGNUAttr(dwarf::DW_AT_call_target), in constructCallSiteEntryDIE()
1263 addDIEEntry(CallSiteDIE, getDwarf5OrGNUAttr(dwarf::DW_AT_call_origin), in constructCallSiteEntryDIE()
1269 addFlag(CallSiteDIE, getDwarf5OrGNUAttr(dwarf::DW_AT_call_tail_call)); in constructCallSiteEntryDIE()
1284 addLabelAddress(CallSiteDIE, dwarf::DW_AT_call_pc, CallAddr); in constructCallSiteEntryDIE()
1296 getDwarf5OrGNUAttr(dwarf::DW_AT_call_return_pc), PCAddr); in constructCallSiteEntryDIE()
1308 getDwarf5OrGNUTag(dwarf::DW_TAG_call_site_parameter)); in constructCallSiteParmEntryDIEs()
1310 addAddress(*CallSiteDieParam, dwarf::DW_AT_location, in constructCallSiteParmEntryDIEs()
1319 addBlock(*CallSiteDieParam, getDwarf5OrGNUAttr(dwarf::DW_AT_call_value), in constructCallSiteParmEntryDIEs()
1328 DIE *IMDie = DIE::get(DIEValueAllocator, (dwarf::Tag)Module->getTag()); in constructImportedEntityDIE()
1354 addDIEEntry(*IMDie, dwarf::DW_AT_import, *EntityDie); in constructImportedEntityDIE()
1357 addString(*IMDie, dwarf::DW_AT_name, Name); in constructImportedEntityDIE()
1400 addDIEEntry(*D, dwarf::DW_AT_abstract_origin, *AbsSPDIE); in finishSubprogramDefinition()
1417 addDIEEntry(*Die, dwarf::DW_AT_abstract_origin, *AbsEntity->getDIE()); in finishEntityDefinition()
1435 addLabelAddress(*Die, dwarf::DW_AT_low_pc, Sym); in finishEntityDefinition()
1472 dwarf::UnitType UT = Skeleton ? dwarf::DW_UT_split_compile in emitHeader()
1473 : DD->useSplitDwarf() ? dwarf::DW_UT_skeleton in emitHeader()
1474 : dwarf::DW_UT_compile; in emitHeader()
1476 if (DD->getDwarfVersion() >= 5 && UT != dwarf::DW_UT_compile) in emitHeader()
1545 addComplexAddress(Single->getExpr(), Die, dwarf::DW_AT_location, Location); in addVariableAddress()
1547 addAddress(Die, dwarf::DW_AT_location, Location); in addVariableAddress()
1551 void DwarfCompileUnit::addAddress(DIE &Die, dwarf::Attribute Attribute, in addAddress()
1568 addUInt(Die, dwarf::DW_AT_LLVM_tag_offset, dwarf::DW_FORM_data1, in addAddress()
1577 dwarf::Attribute Attribute, in addComplexAddress()
1598 addUInt(Die, dwarf::DW_AT_LLVM_tag_offset, dwarf::DW_FORM_data1, in addComplexAddress()
1603 void DwarfCompileUnit::addLocationList(DIE &Die, dwarf::Attribute Attribute, in addLocationList()
1605 dwarf::Form Form = (DD->getDwarfVersion() >= 5) in addLocationList()
1606 ? dwarf::DW_FORM_loclistx in addLocationList()
1615 addString(VariableDie, dwarf::DW_AT_name, Name); in applyCommonDbgVariableAttributes()
1619 addUInt(VariableDie, dwarf::DW_AT_alignment, dwarf::DW_FORM_udata, in applyCommonDbgVariableAttributes()
1627 addFlag(VariableDie, dwarf::DW_AT_artificial); in applyCommonDbgVariableAttributes()
1634 addString(LabelDie, dwarf::DW_AT_name, Name); in applyLabelAttributes()
1640 void DwarfCompileUnit::addExpr(DIELoc &Die, dwarf::Form Form, in addExpr()
1642 addAttribute(Die, (dwarf::Attribute)0, Form, DIEExpr(Expr)); in addExpr()
1670 DD->getDwarfVersion() >= 5 ? dwarf::DW_AT_addr_base in addAddrTableBase()
1671 : dwarf::DW_AT_GNU_addr_base, in addAddrTableBase()
1676 addAttribute(Die, (dwarf::Attribute)0, dwarf::DW_FORM_udata, in addBaseTypeRef()
1687 DIE::get(DIEValueAllocator, dwarf::DW_TAG_base_type)); in createBaseTypeDIEs()
1689 addString(Die, dwarf::DW_AT_name, in createBaseTypeDIEs()
1690 Twine(dwarf::AttributeEncodingString(Btr.Encoding) + in createBaseTypeDIEs()
1692 addUInt(Die, dwarf::DW_AT_encoding, dwarf::DW_FORM_data1, Btr.Encoding); in createBaseTypeDIEs()
1694 addUInt(Die, dwarf::DW_AT_byte_size, std::nullopt, in createBaseTypeDIEs()