int FormatCount = DebugLineData.getU8(OffsetPtr);
bool HasPath = false;
for (int I = 0; I != FormatCount; ++I) {
- if (*OffsetPtr >= EndPrologueOffset)
- return createStringError(
- errc::invalid_argument,
- "failed to parse entry content descriptions at offset "
- "0x%8.8" PRIx64
- " because offset extends beyond the prologue end at offset "
- "0x%8.8" PRIx64,
- *OffsetPtr, EndPrologueOffset);
ContentDescriptor Descriptor;
Descriptor.Type =
dwarf::LineNumberEntryFormat(DebugLineData.getULEB128(OffsetPtr));
// Get the directory entries, according to the format described above.
int DirEntryCount = DebugLineData.getU8(OffsetPtr);
for (int I = 0; I != DirEntryCount; ++I) {
- if (*OffsetPtr >= EndPrologueOffset)
- return createStringError(
- errc::invalid_argument,
- "failed to parse directory entry at offset "
- "0x%8.8" PRIx64
- " because offset extends beyond the prologue end at offset "
- "0x%8.8" PRIx64,
- *OffsetPtr, EndPrologueOffset);
for (auto Descriptor : *DirDescriptors) {
DWARFFormValue Value(Descriptor.Form);
switch (Descriptor.Type) {
// Get the file entries, according to the format described above.
int FileEntryCount = DebugLineData.getU8(OffsetPtr);
for (int I = 0; I != FileEntryCount; ++I) {
- if (*OffsetPtr >= EndPrologueOffset)
- return createStringError(
- errc::invalid_argument,
- "failed to parse file entry at offset "
- "0x%8.8" PRIx64
- " because offset extends beyond the prologue end at offset "
- "0x%8.8" PRIx64,
- *OffsetPtr, EndPrologueOffset);
DWARFDebugLine::FileNameEntry FileEntry;
for (auto Descriptor : *FileDescriptors) {
DWARFFormValue Value(Descriptor.Form);
# NONFATAL: debug_line[0x000001ad]\r
# NONFATAL-NEXT: Line table prologue\r
# NONFATAL: standard_opcode_lengths[DW_LNS_set_isa] = 1\r
-# NONFATAL-NOT: include_directories\r
-# NONFATAL-NOT: file_names\r
+# NONFATAL-NEXT: include_directories[ 0] = "/tmp"\r
+# NONFATAL-NEXT: file_names[ 0]:\r
+# NONFATAL-NEXT: name: "a.c"\r
+# NONFATAL-NEXT: dir_index: 1\r
# NONFATAL-NOT: Address\r
\r
## Case 9: V5 prologue ends during file table.\r
# NONFATAL: debug_line[0x000001ed]\r
# NONFATAL-NEXT: Line table prologue\r
# NONFATAL: include_directories[ 0] = "/tmp"\r
-# NONFATAL-NOT: file_names\r
+# NONFATAL-NEXT: file_names[ 0]:\r
+# NONFATAL-NEXT: name: "a.c"\r
+# NONFATAL-NEXT: dir_index: 1\r
# NONFATAL-NOT: Address\r
\r
## Case 10: V5 prologue ends during directory table.\r
# NONFATAL: debug_line[0x0000022d]\r
# NONFATAL-NEXT: Line table prologue\r
-# NONFATAL-NOT: include_directories\r
-# NONFATAL-NOT: file_names\r
+# NONFATAL: include_directories[ 0] = "/tmp"\r
+# NONFATAL-NEXT: file_names[ 0]:\r
+# NONFATAL-NEXT: name: "a.c"\r
+# NONFATAL-NEXT: dir_index: 1\r
# NONFATAL-NOT: Address\r
\r
## Case 11: V5 invalid MD5 hash form.\r
# NONFATAL: debug_line[0x0000026d]\r
# NONFATAL-NEXT: Line table prologue\r
+# NONFATAL: include_directories[ 0] = "/tmp"\r
+# NONFATAL-NOT: file_names\r
# NONFATAL-NOT: Address\r
\r
# LAST: debug_line[0x000002af]\r
# ALL-NEXT: warning: parsing line table prologue at 0x000000c9 should have ended at 0x00000104 but it ended at 0x00000103\r
# OTHER-NEXT: warning: unexpected line op length at offset 0x00000158 expected 0x02 found 0x01\r
# OTHER-NEXT: warning: last sequence in debug line table is not terminated!\r
-# ALL-NEXT: warning: parsing line table prologue at 0x000001ad found an invalid directory or file table description at 0x000001cc\r
-# ALL-NEXT: warning: failed to parse entry content descriptions at offset 0x000001cc because offset extends beyond the prologue end at offset 0x000001c8\r
-# ALL-NEXT: warning: parsing line table prologue at 0x000001ed found an invalid directory or file table description at 0x0000021a\r
-# ALL-NEXT: warning: failed to parse file entry at offset 0x0000021a because offset extends beyond the prologue end at offset 0x00000218\r
-# ALL-NEXT: warning: parsing line table prologue at 0x0000022d found an invalid directory or file table description at 0x0000024f\r
-# ALL-NEXT: warning: failed to parse directory entry at offset 0x0000024f because offset extends beyond the prologue end at offset 0x0000024f\r
+# ALL-NEXT: warning: parsing line table prologue at 0x000001ad should have ended at 0x000001c8 but it ended at 0x000001df\r
+# ALL-NEXT: warning: parsing line table prologue at 0x000001ed should have ended at 0x00000218 but it ended at 0x0000021f\r
+# ALL-NEXT: warning: parsing line table prologue at 0x0000022d should have ended at 0x0000024f but it ended at 0x0000025f\r
# ALL-NEXT: warning: parsing line table prologue at 0x0000026d found an invalid directory or file table description at 0x000002a2\r
# ALL-NEXT: warning: failed to parse file entry because the MD5 hash is invalid\r
# ALL-NOT: warning:\r