[PATCH] D74249: [DebugInfo] Support file-level include directories when generating Dwarf5 LineTable prologues.

Sterling Augustine via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 7 12:26:45 PST 2020


saugustine created this revision.
saugustine added a reviewer: jhenderson.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D74249

Files:
  llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp
  llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp


Index: llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
===================================================================
--- llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
+++ llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
@@ -164,8 +164,8 @@
     P.PrologueLength = 36;
     break;
   case 5:
-    P.TotalLength = 47;
-    P.PrologueLength = 39;
+    P.TotalLength = 50;
+    P.PrologueLength = 42;
     P.FormParams.AddrSize = AddrSize;
     break;
   default:
@@ -343,13 +343,16 @@
     writeCString(*Include.getAsCString(), Asm);
   }
 
-  Asm.emitInt8(1); // file_name_entry_format_count.
+  Asm.emitInt8(2); // file_name_entry_format_count.
   Asm.EmitULEB128(DW_LNCT_path);
   Asm.EmitULEB128(DW_FORM_string);
+  Asm.EmitULEB128(DW_LNCT_directory_index);
+  Asm.EmitULEB128(DW_FORM_data1);
   Asm.EmitULEB128(Prologue.FileNames.size());
   for (auto File : Prologue.FileNames) {
     assert(File.Name.getAsCString() && "expected a string form for file name");
     writeCString(*File.Name.getAsCString(), Asm);
+    Asm.emitInt8(File.DirIdx);
   }
 }
 
Index: llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp
===================================================================
--- llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp
+++ llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp
@@ -180,7 +180,7 @@
     UnitLength = PrologueLength + 2;
     break;
   case 5:
-    PrologueLength = 39;
+    PrologueLength = 42;
     UnitLength = PrologueLength + 4;
     EXPECT_EQ(Prologue.getAddressSize(), 8u);
     EXPECT_EQ(Prologue.SegSelectorSize, 0u);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74249.243264.patch
Type: text/x-patch
Size: 1587 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200207/4908c2da/attachment.bin>


More information about the llvm-commits mailing list