Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/test/tools/yaml2obj/ELF/DWARF/debug-abbrev.yaml
## Test that yaml2obj emits .debug_abbrev section. | ## Test that yaml2obj emits .debug_abbrev section. | ||||
## a) Generate the .debug_abbrev section from the "DWARF" entry. | ## a) Generate the .debug_abbrev section from the "DWARF" entry. | ||||
# RUN: yaml2obj --docnum=1 %s -o %t1.o | # RUN: yaml2obj --docnum=1 %s -o %t1.o | ||||
# RUN: llvm-readobj --sections --section-data %t1.o | \ | # RUN: llvm-readobj --sections --section-data %t1.o | \ | ||||
# RUN: FileCheck -DSIZE=38 -DADDRALIGN=1 %s --check-prefixes=SHDR,CONTENT | # RUN: FileCheck -DSIZE=39 -DADDRALIGN=1 %s --check-prefixes=SHDR,CONTENT | ||||
# SHDR: Index: 1 | # SHDR: Index: 1 | ||||
# SHDR-NEXT: Name: .debug_abbrev (1) | # SHDR-NEXT: Name: .debug_abbrev (1) | ||||
# SHDR-NEXT: Type: SHT_PROGBITS (0x1) | # SHDR-NEXT: Type: SHT_PROGBITS (0x1) | ||||
# SHDR-NEXT: Flags [ (0x0) | # SHDR-NEXT: Flags [ (0x0) | ||||
# SHDR-NEXT: ] | # SHDR-NEXT: ] | ||||
# SHDR-NEXT: Address: 0x0 | # SHDR-NEXT: Address: 0x0 | ||||
# SHDR-NEXT: Offset: 0x40 | # SHDR-NEXT: Offset: 0x40 | ||||
# SHDR-NEXT: Size: [[SIZE]] | # SHDR-NEXT: Size: [[SIZE]] | ||||
# SHDR-NEXT: Link: 0 | # SHDR-NEXT: Link: 0 | ||||
# SHDR-NEXT: Info: 0 | # SHDR-NEXT: Info: 0 | ||||
# SHDR-NEXT: AddressAlignment: [[ADDRALIGN]] | # SHDR-NEXT: AddressAlignment: [[ADDRALIGN]] | ||||
# SHDR-NEXT: EntrySize: 0 | # SHDR-NEXT: EntrySize: 0 | ||||
# CONTENT-NEXT: SectionData ( | # CONTENT-NEXT: SectionData ( | ||||
# CONTENT-NEXT: 000: 01110125 0E130503 | # CONTENT-NEXT: 000: 01110125 0E130503 | ||||
## ^- abbreviation code ULEB128 ^- DW_FORM_strp ULEB128 | ## ^- abbreviation code ULEB128 ^- DW_FORM_strp ULEB128 | ||||
## ^- DW_TAG_compile_unit ULEB128 ^- DW_AT_language ULEB128 | ## ^- DW_TAG_compile_unit ULEB128 ^- DW_AT_language ULEB128 | ||||
## ^- DW_CHILDREN_yes 1-byte ^- DW_FORM_data2 ULEB128 | ## ^- DW_CHILDREN_yes 1-byte ^- DW_FORM_data2 ULEB128 | ||||
## ^- DW_AT_producer ULEB128 ^- DW_AT_name ULEB128 | ## ^- DW_AT_producer ULEB128 ^- DW_AT_name ULEB128 | ||||
## | ## | ||||
## CONTENT: 1A000002 2E011101 |...%............| | ## CONTENT: 1A000002 2E011101 |...%............| | ||||
## ^- DW_AT_strx ULEB128 ^- DW_TAG_subprogram ULEB128 | ## ^- DW_AT_strx ULEB128 ^- DW_TAG_subprogram ULEB128 | ||||
## ^--- terminating entry ^- DW_CHILDREN_yes 1-byte | ## ^--- attr terminator ^- DW_CHILDREN_yes 1-byte | ||||
## ^- abbreviation code ULEB128 ^- DW_AT_low_pc ULEB128 | ## ^- abbreviation code ULEB128 ^- DW_AT_low_pc ULEB128 | ||||
## ^- DW_FORM_addr ULEB128 | ## ^- DW_FORM_addr ULEB128 | ||||
## | ## | ||||
# CONTENT-NEXT: 0010: 121B0000 03060081 | # CONTENT-NEXT: 0010: 121B0000 03060081 | ||||
## ^- DW_AT_high_pc ULEB128 ^- abbreviation code ULEB128 | ## ^- DW_AT_high_pc ULEB128 ^- abbreviation code ULEB128 | ||||
## ^- DW_FORM_addrx ULEB128 ^- Tag: value UELB128 | ## ^- DW_FORM_addrx ULEB128 ^- Tag: value UELB128 | ||||
## ^--- terminating entry ^- DW_CHILDREN_no 1-byte | ## ^--- attr terminator ^- DW_CHILDREN_no 1-byte | ||||
## ^- DW_AT_call_pc ULEB128 (0x81) | ## ^- DW_AT_call_pc ULEB128 (0x81) | ||||
## | ## | ||||
# CONTENT: 01810104 02A04021 |..............@!| | # CONTENT: 01810104 02A04021 |..............@!| | ||||
## -- ^- Form: reserved ULEB128 | ## -- ^- Form: reserved ULEB128 | ||||
## ^--- Form: invalid ULEB128 (0x81) ^--- Attribute: reserved ULEB128 (0x2020) | ## ^--- Form: invalid ULEB128 (0x81) ^--- Attribute: reserved ULEB128 (0x2020) | ||||
## ^- Attribute: reserved ULEB128 ^- DW_FORM_implicit_const ULEB128 | ## ^- Attribute: reserved ULEB128 ^- DW_FORM_implicit_const ULEB128 | ||||
## | ## | ||||
# CONTENT-NEXT: 0020: CEC2F105 0000 |......| | # CONTENT-NEXT: 0020: CEC2F105 000000 |.......| | ||||
## ^------- Value SLEB128 (12345678) ^--- terminating entry | ## ^------- Value SLEB128 (12345678) ^--- attr terminator | ||||
## ^- abbrev terminator | |||||
jhenderson: How about "attr terminator" and "abbrev terminator". | |||||
# CONTENT-NEXT: ) | # CONTENT-NEXT: ) | ||||
--- !ELF | --- !ELF | ||||
FileHeader: | FileHeader: | ||||
Class: ELFCLASS64 | Class: ELFCLASS64 | ||||
Data: ELFDATA2LSB | Data: ELFDATA2LSB | ||||
Type: ET_EXEC | Type: ET_EXEC | ||||
Machine: EM_X86_64 | Machine: EM_X86_64 | ||||
▲ Show 20 Lines • Show All 126 Lines • ▼ Show 20 Lines | |||||
## f) Test that all the properties can be overridden by the section header when | ## f) Test that all the properties can be overridden by the section header when | ||||
## the "debug_abbrev" entry doesn't exist. | ## the "debug_abbrev" entry doesn't exist. | ||||
# RUN: yaml2obj --docnum=6 %s -o %t6.o | # RUN: yaml2obj --docnum=6 %s -o %t6.o | ||||
# RUN: llvm-readelf --sections %t6.o | FileCheck %s --check-prefix=OVERRIDDEN | # RUN: llvm-readelf --sections %t6.o | FileCheck %s --check-prefix=OVERRIDDEN | ||||
# OVERRIDDEN: [Nr] Name Type Address Off Size ES Flg Lk Inf Al | # OVERRIDDEN: [Nr] Name Type Address Off Size ES Flg Lk Inf Al | ||||
# OVERRIDDEN: [ 1] .debug_abbrev STRTAB 0000000000002020 000050 000005 01 A 2 1 2 | # OVERRIDDEN: [ 1] .debug_abbrev STRTAB 0000000000002020 000050 000006 01 A 2 1 2 | ||||
# OVERRIDDEN-NEXT: [ 2] .sec STRTAB 0000000000000000 000055 000000 00 0 0 0 | # OVERRIDDEN-NEXT: [ 2] .sec STRTAB 0000000000000000 000056 000000 00 0 0 0 | ||||
--- !ELF | --- !ELF | ||||
FileHeader: | FileHeader: | ||||
Class: ELFCLASS64 | Class: ELFCLASS64 | ||||
Data: ELFDATA2LSB | Data: ELFDATA2LSB | ||||
Type: ET_EXEC | Type: ET_EXEC | ||||
Machine: EM_X86_64 | Machine: EM_X86_64 | ||||
Sections: | Sections: | ||||
- Name: .debug_abbrev | - Name: .debug_abbrev | ||||
Type: SHT_STRTAB ## SHT_PROGBITS by default. | Type: SHT_STRTAB ## SHT_PROGBITS by default. | ||||
Flags: [SHF_ALLOC] ## 0 by default. | Flags: [SHF_ALLOC] ## 0 by default. | ||||
Link: .sec ## 0 by default. | Link: .sec ## 0 by default. | ||||
EntSize: 1 ## 0 by default. | EntSize: 1 ## 0 by default. | ||||
Info: 1 ## 0 by default. | Info: 1 ## 0 by default. | ||||
AddressAlign: 2 ## 0 by default. | AddressAlign: 2 ## 0 by default. | ||||
Address: 0x2020 ## 0x00 by default. | Address: 0x2020 ## 0x00 by default. | ||||
Offset: 0x50 ## 0x40 for the first section. | Offset: 0x50 ## 0x40 for the first section. | ||||
Size: 0x05 ## Set the "Size" so that we can reuse the check tag "OVERRIDDEN". | Size: 0x06 ## Set the "Size" so that we can reuse the check tag "OVERRIDDEN". | ||||
- Name: .sec ## Linked by .debug_abbrev. | - Name: .sec ## Linked by .debug_abbrev. | ||||
Type: SHT_STRTAB | Type: SHT_STRTAB | ||||
## g) Test that all the properties can be overridden by the section header when | ## g) Test that all the properties can be overridden by the section header when | ||||
## the "debug_abbrev" entry exists. | ## the "debug_abbrev" entry exists. | ||||
# RUN: yaml2obj --docnum=7 %s -o %t7.o | # RUN: yaml2obj --docnum=7 %s -o %t7.o | ||||
# RUN: llvm-readelf --sections %t7.o | FileCheck %s --check-prefix=OVERRIDDEN | # RUN: llvm-readelf --sections %t7.o | FileCheck %s --check-prefix=OVERRIDDEN | ||||
▲ Show 20 Lines • Show All 69 Lines • Show Last 20 Lines |
How about "attr terminator" and "abbrev terminator".