brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.0 KiB · 66ed6f5 Raw
101 lines · plain
1# RUN: llvm-mc -triple x86_64-unknown-linux %s -filetype=obj -o - | \2# RUN:   not llvm-dwarfdump -debug-cu-index -debug-tu-index --verify - | FileCheck %s3 4# FIXME: The verifier should probably be handled to verify the hash table5# itself - in which case this test would need to be updated to have a correct6# hash table (currently hand crafted with no attempt at correct allocation of7# hashes to buckets) - and probably to verify that the section ranges apply to8# sections that exist, which currently they don't9 10# This tests that an index that describes units as being in overlapping11# sections is invalid (this was observed in the wild due to overflow due to the12# 32 bit limit of the indexes (a DWARF spec bug - there should be a 64 bit13# version of the index format with 64 bit offsets/sizes)) - but Type Units will14# generally share all the sections other than the info section with each other15# (and with their originating CU) since the dwo format has no way to describe16# which part of non-info-section contributions are used by which units, so17# they're all shared. So demonstrate that the TU index ignores non-info overlap,18# but the CU index diagnoses such overlap (in the abbrev section, in this case)19 20# This doesn't currently check for info section overlap between the CU and TU21# index, but that could be an extension of this work in the future.22 23# CHECK: Verifying .debug_cu_index... 24# CHECK: error: overlapping index entries for entries 0x0000000000000001 and 0x0000000000000002 for column DW_SECT_ABBREV25# CHECK: Verifying .debug_tu_index... 26# CHECK: error: overlapping index entries for entries 0x0000000000000001 and 0x0000000000000003 for column DW_SECT_INFO27 28    .section .debug_cu_index, "", @progbits29## Header:30    .long 5             # Version31    .long 2             # Section count32    .long 3             # Unit count33    .long 4             # Slot count34## Hash Table of Signatures:35    .quad 0x000000000000000136    .quad 0x000000000000000237    .quad 0x000000000000000338    .quad 039## Parallel Table of Indexes:40    .long 141    .long 242    .long 343    .long 044## Table of Section Offsets:45## Row 0:46    .long 1             # DW_SECT_INFO47    .long 3             # DW_SECT_ABBREV48## Row 1:49    .long 0x1           # Offset in .debug_info.dwo50    .long 0x1           # Offset in .debug_abbrev.dwo51## Row 2:52    .long 0x2           # Offset in .debug_info.dwo53    .long 0x1           # Offset in .debug_abbrev.dwo54## Row 3:55    .long 0x1           # Offset in .debug_info.dwo56    .long 0x1           # Offset in .debug_abbrev.dwo57## Table of Section Sizes:58    .long 0x1          # Size in .debug_info.dwo59    .long 0x1          # Size in .debug_abbrev.dwo60    .long 0x1          # Size in .debug_info.dwo61    .long 0x1          # Size in .debug_abbrev.dwo62    .long 0x1          # Size in .debug_info.dwo63    .long 0x1          # Size in .debug_abbrev.dwo64 65    .section .debug_tu_index, "", @progbits66## Header:67    .long 5             # Version68    .long 2             # Section count69    .long 3             # Unit count70    .long 4             # Slot count71## Hash Table of Signatures:72    .quad 0x000000000000000173    .quad 0x000000000000000274    .quad 0x000000000000000375    .quad 076## Parallel Table of Indexes:77    .long 178    .long 279    .long 380    .long 081## Table of Section Offsets:82## Row 0:83    .long 1             # DW_SECT_INFO84    .long 3             # DW_SECT_ABBREV85## Row 1:86    .long 0x1           # Offset in .debug_info.dwo87    .long 0x1           # Offset in .debug_abbrev.dwo88## Row 2:89    .long 0x2           # Offset in .debug_info.dwo90    .long 0x1           # Offset in .debug_abbrev.dwo91## Row 3:92    .long 0x1           # Offset in .debug_info.dwo93    .long 0x1           # Offset in .debug_abbrev.dwo94## Table of Section Sizes:95    .long 0x1          # Size in .debug_info.dwo96    .long 0x1          # Size in .debug_abbrev.dwo97    .long 0x1          # Size in .debug_info.dwo98    .long 0x1          # Size in .debug_abbrev.dwo99    .long 0x1          # Size in .debug_info.dwo100    .long 0x1          # Size in .debug_abbrev.dwo101