Lines Matching +full:- +full:section

1 //===- DebugLineSectionEmitter.h --------------------------------*- C++ -*-===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
23 /// This class emits specified line table into the .debug_line section.
36 // Get descriptor for output .debug_line section.
52 assert(OffsetAfterUnitLength -
55 OutSection.apply(OffsetAfterUnitLength -
58 OffsetAfterEnd - OffsetAfterUnitLength);
76 MRI.reset(TheTarget->createMCRegInfo(TripleName));
83 MAI.reset(TheTarget->createMCAsmInfo(*MRI, TripleName, MCOptions));
88 MSTI.reset(TheTarget->createMCSubtargetInfo(TripleName, "", ""));
101 SectionDescriptor &Section) {
103 Section.emitIntVal(P.getVersion(), 2);
106 Section.emitIntVal(P.getAddressSize(), 1);
109 Section.emitIntVal(P.SegSelectorSize, 1);
113 Section.emitOffset(0xBADDEF);
115 uint64_t OffsetAfterPrologueLength = Section.OS.tell();
116 emitLineTableProloguePayload(P, Section);
117 uint64_t OffsetAfterPrologueEnd = Section.OS.tell();
120 Section.apply(OffsetAfterPrologueLength -
121 Section.getFormParams().getDwarfOffsetByteSize(),
123 OffsetAfterPrologueEnd - OffsetAfterPrologueLength);
128 SectionDescriptor &Section) {
137 Section.emitString(Include.getForm(), *IncludeStr);
140 Section.emitIntVal(0, 1);
150 // A null-terminated string containing the full or relative path name of a
152 Section.emitString(File.Name.getForm(), *FileNameStr);
155 // directory in the include_directories section.
156 encodeULEB128(File.DirIdx, Section.OS);
157 // An unsigned LEB128 number representing the (implementation-defined)
159 encodeULEB128(File.ModTime, Section.OS);
162 encodeULEB128(File.Length, Section.OS);
165 Section.emitIntVal(0, 1);
170 SectionDescriptor &Section) {
173 Section.emitIntVal(0, 1);
176 Section.emitIntVal(1, 1);
179 encodeULEB128(dwarf::DW_LNCT_path, Section.OS);
180 encodeULEB128(P.IncludeDirectories[0].getForm(), Section.OS);
184 encodeULEB128(P.IncludeDirectories.size(), Section.OS);
193 Section.emitString(Include.getForm(), *IncludeStr);
204 Section.emitIntVal(0, 1);
210 Section.emitIntVal(
214 encodeULEB128(dwarf::DW_LNCT_path, Section.OS);
215 encodeULEB128(FileNameForm, Section.OS);
217 encodeULEB128(dwarf::DW_LNCT_directory_index, Section.OS);
218 encodeULEB128(dwarf::DW_FORM_data1, Section.OS);
221 encodeULEB128(dwarf::DW_LNCT_MD5, Section.OS);
222 encodeULEB128(dwarf::DW_FORM_data16, Section.OS);
226 encodeULEB128(dwarf::DW_LNCT_LLVM_source, Section.OS);
227 encodeULEB128(LLVMSourceForm, Section.OS);
232 encodeULEB128(P.FileNames.size(), Section.OS);
242 // A null-terminated string containing the full or relative path name of a
244 Section.emitString(FileNameForm, *FileNameStr);
245 Section.emitIntVal(File.DirIdx, 1);
250 Section.emitBinaryData(
263 Section.emitString(LLVMSourceForm, *FileSourceStr);
269 SectionDescriptor &Section) {
271 Section.emitIntVal(P.MinInstLength, 1);
274 Section.emitIntVal(P.MaxOpsPerInst, 1);
277 Section.emitIntVal(P.DefaultIsStmt, 1);
279 Section.emitIntVal(P.LineBase, 1);
281 Section.emitIntVal(P.LineRange, 1);
283 Section.emitIntVal(P.OpcodeBase, 1);
287 Section.emitIntVal(Length, 1);
290 emitLineTablePrologueV2IncludeAndFileTable(P, Section);
292 emitLineTablePrologueV5IncludeAndFileTable(P, Section);
296 SectionDescriptor &Section) {
310 Section.OS.write(EncodingBuffer.c_str(), EncodingBuffer.size());
321 uint64_t Address = -1ULL;
327 if (Address == -1ULL) {
328 Section.emitIntVal(dwarf::DW_LNS_extended_op, 1);
329 encodeULEB128(Section.getFormParams().AddrSize + 1, Section.OS);
330 Section.emitIntVal(dwarf::DW_LNE_set_address, 1);
331 Section.emitIntVal(Row.Address.Address,
332 Section.getFormParams().AddrSize);
336 (Row.Address.Address - Address) / LineTable.Prologue.MinInstLength;
346 Section.emitIntVal(dwarf::DW_LNS_set_file, 1);
347 encodeULEB128(FileNum, Section.OS);
351 Section.emitIntVal(dwarf::DW_LNS_set_column, 1);
352 encodeULEB128(Column, Section.OS);
354 if (Discriminator != Row.Discriminator && MC->getDwarfVersion() >= 4) {
357 Section.emitIntVal(dwarf::DW_LNS_extended_op, 1);
358 encodeULEB128(Size + 1, Section.OS);
359 Section.emitIntVal(dwarf::DW_LNE_set_discriminator, 1);
360 encodeULEB128(Discriminator, Section.OS);
366 Section.emitIntVal(dwarf::DW_LNS_set_isa, 1);
367 encodeULEB128(Isa, Section.OS);
371 Section.emitIntVal(dwarf::DW_LNS_negate_stmt, 1);
374 Section.emitIntVal(dwarf::DW_LNS_set_basic_block, 1);
377 Section.emitIntVal(dwarf::DW_LNS_set_prologue_end, 1);
380 Section.emitIntVal(dwarf::DW_LNS_set_epilogue_begin, 1);
382 int64_t LineDelta = int64_t(Row.Line) - LastLine;
386 Section.OS.write(EncodingBuffer.c_str(), EncodingBuffer.size());
393 Section.emitIntVal(dwarf::DW_LNS_advance_line, 1);
394 encodeSLEB128(LineDelta, Section.OS);
397 Section.emitIntVal(dwarf::DW_LNS_advance_pc, 1);
398 encodeULEB128(AddressDelta, Section.OS);
403 Section.OS.write(EncodingBuffer.c_str(), EncodingBuffer.size());
405 Address = -1ULL;
414 Section.OS.write(EncodingBuffer.c_str(), EncodingBuffer.size());