Lines Matching refs:dwarf
60 static dwarf::Tag GetCompileUnitType(UnitKind Kind, DwarfDebug *DW) { in GetCompileUnitType()
68 return dwarf::DW_TAG_skeleton_unit; in GetCompileUnitType()
70 return dwarf::DW_TAG_compile_unit; in GetCompileUnitType()
83 void DwarfCompileUnit::addLabelAddress(DIE &Die, dwarf::Attribute Attribute, in addLabelAddress()
102 DD->getDwarfVersion() >= 5 ? dwarf::DW_FORM_addrx in addLabelAddress()
103 : dwarf::DW_FORM_GNU_addr_index, in addLabelAddress()
116 addBlock(Die, Attribute, dwarf::DW_FORM_exprloc, Loc); in addLabelAddress()
118 addAttribute(Die, Attribute, dwarf::DW_FORM_LLVM_addrx_offset, in addLabelAddress()
124 dwarf::Attribute Attribute, in addLocalLabelAddress()
127 addAttribute(Die, Attribute, dwarf::DW_FORM_addr, DIELabel(Label)); in addLocalLabelAddress()
129 addAttribute(Die, Attribute, dwarf::DW_FORM_addr, DIEInteger(0)); in addLocalLabelAddress()
176 addDIEEntry(*VariableDIE, dwarf::DW_AT_specification, *VariableSpecDIE); in getOrCreateGlobalVariableDIE()
186 addString(*VariableDIE, dwarf::DW_AT_name, GV->getDisplayName()); in getOrCreateGlobalVariableDIE()
192 addFlag(*VariableDIE, dwarf::DW_AT_external); in getOrCreateGlobalVariableDIE()
199 addFlag(*VariableDIE, dwarf::DW_AT_declaration); in getOrCreateGlobalVariableDIE()
206 addUInt(*VariableDIE, dwarf::DW_AT_alignment, dwarf::DW_FORM_udata, in getOrCreateGlobalVariableDIE()
289 dwarf::Form Form; in addLocationAttribute()
290 dwarf::LocationAtom Op; in addLocationAttribute()
293 ? FormAndOp{dwarf::DW_FORM_data4, dwarf::DW_OP_const4u} in addLocationAttribute()
294 : FormAndOp{dwarf::DW_FORM_data8, dwarf::DW_OP_const8u}; in addLocationAttribute()
305 addUInt(*Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_plus); in addLocationAttribute()
314 addUInt(*Loc, dwarf::DW_FORM_data1, FormAndOp.Op); in addLocationAttribute()
320 addUInt(*Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_GNU_const_index); in addLocationAttribute()
321 addUInt(*Loc, dwarf::DW_FORM_udata, in addLocationAttribute()
325 addUInt(*Loc, dwarf::DW_FORM_data1, in addLocationAttribute()
326 DD->useGNUTLSOpcode() ? dwarf::DW_OP_GNU_push_tls_address in addLocationAttribute()
327 : dwarf::DW_OP_form_tls_address); in addLocationAttribute()
336 addUInt(*Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_plus); in addLocationAttribute()
344 addUInt(*Loc, dwarf::DW_FORM_data1, FormAndOp.Op); in addLocationAttribute()
351 addUInt(*Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_breg0 + BaseReg); in addLocationAttribute()
353 addSInt(*Loc, dwarf::DW_FORM_sdata, 0); in addLocationAttribute()
355 addUInt(*Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_plus); in addLocationAttribute()
375 addUInt(*VariableDIE, dwarf::DW_AT_address_class, dwarf::DW_FORM_data1, in addLocationAttribute()
379 addBlock(*VariableDIE, dwarf::DW_AT_location, DwarfExpr->finalize()); in addLocationAttribute()
403 DIE &NDie = createAndAddDIE(dwarf::DW_TAG_common_block, *ContextDIE, CB); in getOrCreateCommonBlock()
405 addString(NDie, dwarf::DW_AT_name, Name); in getOrCreateCommonBlock()
454 addSectionLabel(getUnitDie(), dwarf::DW_AT_stmt_list, LineTableStartSym, in initStmtList()
460 addSectionLabel(D, dwarf::DW_AT_stmt_list, LineTableStartSym, in applyStmtList()
471 addLabelAddress(D, dwarf::DW_AT_low_pc, Begin); in attachLowHighPC()
473 addLabelAddress(D, dwarf::DW_AT_high_pc, End); in attachLowHighPC()
475 addLabelDelta(D, dwarf::DW_AT_high_pc, End, Begin); in attachLowHighPC()
496 addUInt(*Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_WASM_location); in addWasmRelocBaseGlobal()
497 addSInt(*Loc, dwarf::DW_FORM_sdata, TI_GLOBAL_RELOC); in addWasmRelocBaseGlobal()
499 addLabel(*Loc, dwarf::DW_FORM_data4, Sym); in addWasmRelocBaseGlobal()
507 addUInt(*Loc, dwarf::DW_FORM_data4, GlobalIndex); in addWasmRelocBaseGlobal()
527 addFlag(*SPDie, dwarf::DW_AT_APPLE_omit_frame_ptr); in updateSubprogramScopeDIE()
538 addAddress(*SPDie, dwarf::DW_AT_frame_base, Location); in updateSubprogramScopeDIE()
544 addUInt(*Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_call_frame_cfa); in updateSubprogramScopeDIE()
546 addUInt(*Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_consts); in updateSubprogramScopeDIE()
547 addSInt(*Loc, dwarf::DW_FORM_sdata, FrameBase.Location.Offset); in updateSubprogramScopeDIE()
548 addUInt(*Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_plus); in updateSubprogramScopeDIE()
550 addBlock(*SPDie, dwarf::DW_AT_frame_base, Loc); in updateSubprogramScopeDIE()
563 addUInt(*Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_stack_value); in updateSubprogramScopeDIE()
564 addBlock(*SPDie, dwarf::DW_AT_frame_base, Loc); in updateSubprogramScopeDIE()
572 addBlock(*SPDie, dwarf::DW_AT_frame_base, DwarfExpr.finalize()); in updateSubprogramScopeDIE()
638 addUInt(ScopeDIE, dwarf::DW_AT_ranges, dwarf::DW_FORM_rnglistx, Index); in addScopeRangeList()
644 addSectionDelta(ScopeDIE, dwarf::DW_AT_ranges, List.Label, in addScopeRangeList()
647 addSectionLabel(ScopeDIE, dwarf::DW_AT_ranges, List.Label, in addScopeRangeList()
711 auto ScopeDIE = DIE::get(DIEValueAllocator, dwarf::DW_TAG_inlined_subroutine); in constructInlinedScopeDIE()
713 addDIEEntry(*ScopeDIE, dwarf::DW_AT_abstract_origin, *OriginDIE); in constructInlinedScopeDIE()
719 addUInt(*ScopeDIE, dwarf::DW_AT_call_file, std::nullopt, in constructInlinedScopeDIE()
721 addUInt(*ScopeDIE, dwarf::DW_AT_call_line, std::nullopt, IA->getLine()); in constructInlinedScopeDIE()
723 addUInt(*ScopeDIE, dwarf::DW_AT_call_column, std::nullopt, IA->getColumn()); in constructInlinedScopeDIE()
725 addUInt(*ScopeDIE, dwarf::DW_AT_GNU_discriminator, std::nullopt, in constructInlinedScopeDIE()
743 auto ScopeDIE = DIE::get(DIEValueAllocator, dwarf::DW_TAG_lexical_block); in constructLexicalScopeDIE()
794 addBlock(VariableDie, dwarf::DW_AT_location, DwarfExpr.finalize()); in applyConcreteDbgVariableAttributes()
796 addUInt(VariableDie, dwarf::DW_AT_LLVM_tag_offset, in applyConcreteDbgVariableAttributes()
797 dwarf::DW_FORM_data1, *DwarfExpr.TagOffset); in applyConcreteDbgVariableAttributes()
810 addBlock(VariableDie, dwarf::DW_AT_location, DwarfExpr.finalize()); in applyConcreteDbgVariableAttributes()
871 addBlock(VariableDie, dwarf::DW_AT_location, DwarfExpr.finalize()); in applyConcreteDbgVariableAttributes()
873 addUInt(VariableDie, dwarf::DW_AT_LLVM_tag_offset, dwarf::DW_FORM_data1, in applyConcreteDbgVariableAttributes()
879 addLocationList(VariableDie, dwarf::DW_AT_location, in applyConcreteDbgVariableAttributes()
883 addUInt(VariableDie, dwarf::DW_AT_LLVM_tag_offset, dwarf::DW_FORM_data1, in applyConcreteDbgVariableAttributes()
938 addUInt(VariableDie, dwarf::DW_AT_address_class, dwarf::DW_FORM_data1, in applyConcreteDbgVariableAttributes()
941 addBlock(VariableDie, dwarf::DW_AT_location, DwarfExpr.finalize()); in applyConcreteDbgVariableAttributes()
943 addUInt(VariableDie, dwarf::DW_AT_LLVM_tag_offset, dwarf::DW_FORM_data1, in applyConcreteDbgVariableAttributes()
961 addBlock(VariableDie, dwarf::DW_AT_location, DwarfExpr.finalize()); in applyConcreteDbgVariableAttributes()
992 if (!Array || Array->getTag() != dwarf::DW_TAG_array_type) in dependencies()
1102 addDIEEntry(ScopeDIE, dwarf::DW_AT_object_pointer, *ObjectPointer); in constructSubprogramScopeDIE()
1114 DIE::get(DIEValueAllocator, dwarf::DW_TAG_unspecified_parameters)); in constructSubprogramScopeDIE()
1195 DIE &AbsDef = ContextCU->createAndAddDIE(dwarf::DW_TAG_subprogram, in constructAbstractSubprogramScopeDIE()
1202 ContextCU->addSInt(AbsDef, dwarf::DW_AT_inline, in constructAbstractSubprogramScopeDIE()
1203 DD->getDwarfVersion() <= 4 ? std::optional<dwarf::Form>() in constructAbstractSubprogramScopeDIE()
1204 : dwarf::DW_FORM_implicit_const, in constructAbstractSubprogramScopeDIE()
1205 dwarf::DW_INL_inlined); in constructAbstractSubprogramScopeDIE()
1207 ContextCU->addDIEEntry(AbsDef, dwarf::DW_AT_object_pointer, *ObjectPointer); in constructAbstractSubprogramScopeDIE()
1214 dwarf::Tag DwarfCompileUnit::getDwarf5OrGNUTag(dwarf::Tag Tag) const { in getDwarf5OrGNUTag()
1218 case dwarf::DW_TAG_call_site: in getDwarf5OrGNUTag()
1219 return dwarf::DW_TAG_GNU_call_site; in getDwarf5OrGNUTag()
1220 case dwarf::DW_TAG_call_site_parameter: in getDwarf5OrGNUTag()
1221 return dwarf::DW_TAG_GNU_call_site_parameter; in getDwarf5OrGNUTag()
1227 dwarf::Attribute
1228 DwarfCompileUnit::getDwarf5OrGNUAttr(dwarf::Attribute Attr) const { in getDwarf5OrGNUAttr()
1232 case dwarf::DW_AT_call_all_calls: in getDwarf5OrGNUAttr()
1233 return dwarf::DW_AT_GNU_all_call_sites; in getDwarf5OrGNUAttr()
1234 case dwarf::DW_AT_call_target: in getDwarf5OrGNUAttr()
1235 return dwarf::DW_AT_GNU_call_site_target; in getDwarf5OrGNUAttr()
1236 case dwarf::DW_AT_call_origin: in getDwarf5OrGNUAttr()
1237 return dwarf::DW_AT_abstract_origin; in getDwarf5OrGNUAttr()
1238 case dwarf::DW_AT_call_return_pc: in getDwarf5OrGNUAttr()
1239 return dwarf::DW_AT_low_pc; in getDwarf5OrGNUAttr()
1240 case dwarf::DW_AT_call_value: in getDwarf5OrGNUAttr()
1241 return dwarf::DW_AT_GNU_call_site_value; in getDwarf5OrGNUAttr()
1242 case dwarf::DW_AT_call_tail_call: in getDwarf5OrGNUAttr()
1243 return dwarf::DW_AT_GNU_tail_call; in getDwarf5OrGNUAttr()
1249 dwarf::LocationAtom
1250 DwarfCompileUnit::getDwarf5OrGNULocationAtom(dwarf::LocationAtom Loc) const { in getDwarf5OrGNULocationAtom()
1254 case dwarf::DW_OP_entry_value: in getDwarf5OrGNULocationAtom()
1255 return dwarf::DW_OP_GNU_entry_value; in getDwarf5OrGNULocationAtom()
1268 DIE &CallSiteDIE = createAndAddDIE(getDwarf5OrGNUTag(dwarf::DW_TAG_call_site), in constructCallSiteEntryDIE()
1273 addAddress(CallSiteDIE, getDwarf5OrGNUAttr(dwarf::DW_AT_call_target), in constructCallSiteEntryDIE()
1280 !CalleeDIE->findAttribute(dwarf::DW_AT_linkage_name)) { in constructCallSiteEntryDIE()
1284 addDIEEntry(CallSiteDIE, getDwarf5OrGNUAttr(dwarf::DW_AT_call_origin), in constructCallSiteEntryDIE()
1290 addFlag(CallSiteDIE, getDwarf5OrGNUAttr(dwarf::DW_AT_call_tail_call)); in constructCallSiteEntryDIE()
1305 addLabelAddress(CallSiteDIE, dwarf::DW_AT_call_pc, CallAddr); in constructCallSiteEntryDIE()
1317 getDwarf5OrGNUAttr(dwarf::DW_AT_call_return_pc), PCAddr); in constructCallSiteEntryDIE()
1329 getDwarf5OrGNUTag(dwarf::DW_TAG_call_site_parameter)); in constructCallSiteParmEntryDIEs()
1331 addAddress(*CallSiteDieParam, dwarf::DW_AT_location, in constructCallSiteParmEntryDIEs()
1340 addBlock(*CallSiteDieParam, getDwarf5OrGNUAttr(dwarf::DW_AT_call_value), in constructCallSiteParmEntryDIEs()
1349 DIE *IMDie = DIE::get(DIEValueAllocator, (dwarf::Tag)Module->getTag()); in constructImportedEntityDIE()
1375 addDIEEntry(*IMDie, dwarf::DW_AT_import, *EntityDie); in constructImportedEntityDIE()
1378 addString(*IMDie, dwarf::DW_AT_name, Name); in constructImportedEntityDIE()
1421 addDIEEntry(*D, dwarf::DW_AT_abstract_origin, *AbsSPDIE); in finishSubprogramDefinition()
1438 addDIEEntry(*Die, dwarf::DW_AT_abstract_origin, *AbsEntity->getDIE()); in finishEntityDefinition()
1456 addLabelAddress(*Die, dwarf::DW_AT_low_pc, Sym); in finishEntityDefinition()
1493 dwarf::UnitType UT = Skeleton ? dwarf::DW_UT_split_compile in emitHeader()
1494 : DD->useSplitDwarf() ? dwarf::DW_UT_skeleton in emitHeader()
1495 : dwarf::DW_UT_compile; in emitHeader()
1497 if (DD->getDwarfVersion() >= 5 && UT != dwarf::DW_UT_compile) in emitHeader()
1566 addComplexAddress(Single->getExpr(), Die, dwarf::DW_AT_location, Location); in addVariableAddress()
1568 addAddress(Die, dwarf::DW_AT_location, Location); in addVariableAddress()
1572 void DwarfCompileUnit::addAddress(DIE &Die, dwarf::Attribute Attribute, in addAddress()
1589 addUInt(Die, dwarf::DW_AT_LLVM_tag_offset, dwarf::DW_FORM_data1, in addAddress()
1598 dwarf::Attribute Attribute, in addComplexAddress()
1619 addUInt(Die, dwarf::DW_AT_LLVM_tag_offset, dwarf::DW_FORM_data1, in addComplexAddress()
1624 void DwarfCompileUnit::addLocationList(DIE &Die, dwarf::Attribute Attribute, in addLocationList()
1626 dwarf::Form Form = (DD->getDwarfVersion() >= 5) in addLocationList()
1627 ? dwarf::DW_FORM_loclistx in addLocationList()
1636 addString(VariableDie, dwarf::DW_AT_name, Name); in applyCommonDbgVariableAttributes()
1640 addUInt(VariableDie, dwarf::DW_AT_alignment, dwarf::DW_FORM_udata, in applyCommonDbgVariableAttributes()
1648 addFlag(VariableDie, dwarf::DW_AT_artificial); in applyCommonDbgVariableAttributes()
1655 addString(LabelDie, dwarf::DW_AT_name, Name); in applyLabelAttributes()
1661 void DwarfCompileUnit::addExpr(DIELoc &Die, dwarf::Form Form, in addExpr()
1663 addAttribute(Die, (dwarf::Attribute)0, Form, DIEExpr(Expr)); in addExpr()
1691 DD->getDwarfVersion() >= 5 ? dwarf::DW_AT_addr_base in addAddrTableBase()
1692 : dwarf::DW_AT_GNU_addr_base, in addAddrTableBase()
1697 addAttribute(Die, (dwarf::Attribute)0, dwarf::DW_FORM_udata, in addBaseTypeRef()
1708 DIE::get(DIEValueAllocator, dwarf::DW_TAG_base_type)); in createBaseTypeDIEs()
1710 addString(Die, dwarf::DW_AT_name, in createBaseTypeDIEs()
1711 Twine(dwarf::AttributeEncodingString(Btr.Encoding) + in createBaseTypeDIEs()
1713 addUInt(Die, dwarf::DW_AT_encoding, dwarf::DW_FORM_data1, Btr.Encoding); in createBaseTypeDIEs()
1715 addUInt(Die, dwarf::DW_AT_byte_size, std::nullopt, in createBaseTypeDIEs()