Changeset View
Changeset View
Standalone View
Standalone View
llvm/test/tools/yaml2obj/ELF/DWARF/debug-abbrev.yaml
Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | |||||
--- !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 | ||||
DWARF: | DWARF: | ||||
debug_abbrev: | debug_abbrev: | ||||
- Table: | |||||
- Code: 1 | - Code: 1 | ||||
Tag: DW_TAG_compile_unit | Tag: DW_TAG_compile_unit | ||||
Children: DW_CHILDREN_yes | Children: DW_CHILDREN_yes | ||||
Attributes: | Attributes: | ||||
- Attribute: DW_AT_producer | - Attribute: DW_AT_producer | ||||
Form: DW_FORM_strp | Form: DW_FORM_strp | ||||
- Attribute: DW_AT_language | - Attribute: DW_AT_language | ||||
Form: DW_FORM_data2 | Form: DW_FORM_data2 | ||||
- Attribute: DW_AT_name | - Attribute: DW_AT_name | ||||
Form: DW_FORM_strx | Form: DW_FORM_strx | ||||
- Code: 2 | - Code: 2 | ||||
Tag: DW_TAG_subprogram | Tag: DW_TAG_subprogram | ||||
Children: DW_CHILDREN_yes | Children: DW_CHILDREN_yes | ||||
Attributes: | Attributes: | ||||
- Attribute: DW_AT_low_pc | - Attribute: DW_AT_low_pc | ||||
Form: DW_FORM_addr | Form: DW_FORM_addr | ||||
- Attribute: DW_AT_high_pc | - Attribute: DW_AT_high_pc | ||||
Form: DW_FORM_addrx | Form: DW_FORM_addrx | ||||
- Code: 3 | - Code: 3 | ||||
## Test a reserved tag value. | ## Test a reserved tag value. | ||||
Tag: 0x06 | Tag: 0x06 | ||||
Children: DW_CHILDREN_no | Children: DW_CHILDREN_no | ||||
Attributes: | Attributes: | ||||
## Test an attribute value that is more than one byte. | ## Test an attribute value that is more than one byte. | ||||
- Attribute: DW_AT_call_pc | - Attribute: DW_AT_call_pc | ||||
## Test a form value that is more than one byte. | ## Test a form value that is more than one byte. | ||||
Form: 0x81 | Form: 0x81 | ||||
## Test a reserved attribute value. | ## Test a reserved attribute value. | ||||
- Attribute: 0x04 | - Attribute: 0x04 | ||||
## Test a reserved form value. | ## Test a reserved form value. | ||||
Form: 0x02 | Form: 0x02 | ||||
- Attribute: 0x2020 | - Attribute: 0x2020 | ||||
## Test one special attribute form DW_FORM_implicit_const, | ## Test one special attribute form DW_FORM_implicit_const, | ||||
## who is followed by a SLEB128 value. | ## who is followed by a SLEB128 value. | ||||
Form: DW_FORM_implicit_const | Form: DW_FORM_implicit_const | ||||
Value: 12345678 | Value: 12345678 | ||||
## b) Generate the .debug_abbrev section from raw section content. | ## b) Generate the .debug_abbrev section from raw section content. | ||||
# RUN: yaml2obj --docnum=2 %s -o %t2.o | # RUN: yaml2obj --docnum=2 %s -o %t2.o | ||||
# RUN: llvm-readobj --sections --section-data %t2.o | \ | # RUN: llvm-readobj --sections --section-data %t2.o | \ | ||||
# RUN: FileCheck -DADDRALIGN=0 -DSIZE=3 %s --check-prefixes=SHDR,ARBITRARY-CONTENT | # RUN: FileCheck -DADDRALIGN=0 -DSIZE=3 %s --check-prefixes=SHDR,ARBITRARY-CONTENT | ||||
# ARBITRARY-CONTENT-NEXT: SectionData ( | # ARBITRARY-CONTENT-NEXT: SectionData ( | ||||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | FileHeader: | ||||
Type: ET_EXEC | Type: ET_EXEC | ||||
Machine: EM_X86_64 | Machine: EM_X86_64 | ||||
Sections: | Sections: | ||||
- Name: .debug_abbrev | - Name: .debug_abbrev | ||||
Type: SHT_PROGBITS | Type: SHT_PROGBITS | ||||
Size: 0x10 | Size: 0x10 | ||||
DWARF: | DWARF: | ||||
debug_abbrev: | debug_abbrev: | ||||
- Table: | |||||
- Code: 1 | - Code: 1 | ||||
Tag: DW_TAG_compile_unit | Tag: DW_TAG_compile_unit | ||||
Children: DW_CHILDREN_no | Children: DW_CHILDREN_no | ||||
Attributes: [] | Attributes: [] | ||||
## e) Test that yaml2obj emits an error message when both the "Content" and the | ## e) Test that yaml2obj emits an error message when both the "Content" and the | ||||
## "debug_abbrev" entry are specified at the same time. | ## "debug_abbrev" entry are specified at the same time. | ||||
# RUN: not yaml2obj --docnum=5 %s 2>&1 | FileCheck %s --check-prefix=ERROR | # RUN: not yaml2obj --docnum=5 %s 2>&1 | FileCheck %s --check-prefix=ERROR | ||||
--- !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_PROGBITS | Type: SHT_PROGBITS | ||||
Content: "00" | Content: "00" | ||||
DWARF: | DWARF: | ||||
debug_abbrev: | debug_abbrev: | ||||
- Table: | |||||
- Code: 1 | - Code: 1 | ||||
Tag: DW_TAG_compile_unit | Tag: DW_TAG_compile_unit | ||||
Children: DW_CHILDREN_no | Children: DW_CHILDREN_no | ||||
Attributes: [] | Attributes: [] | ||||
## 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 | ||||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | - Name: .debug_abbrev | ||||
Info: 1 ## 0 by default. | Info: 1 ## 0 by default. | ||||
AddressAlign: 2 ## 1 by default. | AddressAlign: 2 ## 1 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. | ||||
- Name: .sec ## Linked by .debug_abbrev. | - Name: .sec ## Linked by .debug_abbrev. | ||||
Type: SHT_STRTAB | Type: SHT_STRTAB | ||||
DWARF: | DWARF: | ||||
debug_abbrev: | debug_abbrev: | ||||
- Table: | |||||
- Code: 1 | - Code: 1 | ||||
Tag: DW_TAG_compile_unit | Tag: DW_TAG_compile_unit | ||||
Children: DW_CHILDREN_no | Children: DW_CHILDREN_no | ||||
Attributes: [] | Attributes: [] | ||||
## h) Test that yaml2obj automatically generates abbreviation codes for us. | ## h) Test that yaml2obj automatically generates abbreviation codes for us. | ||||
# RUN: yaml2obj --docnum=8 %s -o %t8.o | # RUN: yaml2obj --docnum=8 %s -o %t8.o | ||||
# RUN: llvm-readelf --hex-dump=.debug_abbrev %t8.o | FileCheck %s --check-prefix=CODE | # RUN: llvm-readelf --hex-dump=.debug_abbrev %t8.o | FileCheck %s --check-prefix=CODE | ||||
# CODE: 0x00000000 01110000 00022e00 0000042e 00000004 | # CODE: 0x00000000 01110000 00022e00 0000042e 00000004 | ||||
## ^- abbreviation code ULEB128 | ## ^- abbreviation code ULEB128 | ||||
## ^- abbreviation code ULEB128 | ## ^- abbreviation code ULEB128 | ||||
## ^- abbreviation code (ULEB128) 0x04 | ## ^- abbreviation code (ULEB128) 0x04 | ||||
## ^- abbreviation code (ULEB128) 0x04 | ## ^- abbreviation code (ULEB128) 0x04 | ||||
## | ## | ||||
# CODE-NEXT: 0x00000010 2e000000 052e0000 00062e00 0000 | # CODE-NEXT: 0x00000010 2e000000 052e0000 00062e00 0000 | ||||
## ^- abbreviation code ULEB128 | ## ^- abbreviation code ULEB128 | ||||
## ^- abbreviation code ULEB128 | ## ^- abbreviation code ULEB128 | ||||
--- !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 | ||||
DWARF: | DWARF: | ||||
debug_abbrev: | debug_abbrev: | ||||
- Table: | |||||
- Tag: DW_TAG_compile_unit | - Tag: DW_TAG_compile_unit | ||||
Children: DW_CHILDREN_no | Children: DW_CHILDREN_no | ||||
Attributes: [] | Attributes: [] | ||||
- Tag: DW_TAG_subprogram | - Tag: DW_TAG_subprogram | ||||
Children: DW_CHILDREN_no | Children: DW_CHILDREN_no | ||||
Attributes: [] | Attributes: [] | ||||
- Code: 4 | - Code: 4 | ||||
Tag: DW_TAG_subprogram | Tag: DW_TAG_subprogram | ||||
Children: DW_CHILDREN_no | Children: DW_CHILDREN_no | ||||
Attributes: [] | Attributes: [] | ||||
- Code: 4 | - Code: 4 | ||||
Tag: DW_TAG_subprogram | Tag: DW_TAG_subprogram | ||||
Children: DW_CHILDREN_no | Children: DW_CHILDREN_no | ||||
Attributes: [] | Attributes: [] | ||||
- Tag: DW_TAG_subprogram | - Tag: DW_TAG_subprogram | ||||
Children: DW_CHILDREN_no | Children: DW_CHILDREN_no | ||||
Attributes: [] | Attributes: [] | ||||
- Tag: DW_TAG_subprogram | - Tag: DW_TAG_subprogram | ||||
Children: DW_CHILDREN_no | Children: DW_CHILDREN_no | ||||
Attributes: [] | Attributes: [] |