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

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 10 12:37:07 PST 2020


This revision was not accepted when it landed; it landed in state "Needs Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rG0bd48c3d4ee1 (authored by saugustine, committed by dblaikie).

Changed prior to commit:
  https://reviews.llvm.org/D74249?vs=243264&id=243654#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74249/new/

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);
@@ -204,6 +204,7 @@
   EXPECT_STREQ(*Prologue.IncludeDirectories[0].getAsCString(), "a dir");
   ASSERT_EQ(Prologue.FileNames.size(), 1u);
   ASSERT_EQ(Prologue.FileNames[0].Name.getForm(), DW_FORM_string);
+  ASSERT_EQ(Prologue.FileNames[0].DirIdx, 0u);
   EXPECT_STREQ(*Prologue.FileNames[0].Name.getAsCString(), "a file");
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74249.243654.patch
Type: text/x-patch
Size: 1910 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200210/5eba38fd/attachment.bin>


More information about the llvm-commits mailing list