Changeset View
Changeset View
Standalone View
Standalone View
llvm/test/tools/yaml2obj/ELF/DWARF/debug-info.yaml
Show First 20 Lines • Show All 201 Lines • ▼ Show 20 Lines | - Table: | ||||
Form: DW_FORM_addrx1 ## 0x29 | Form: DW_FORM_addrx1 ## 0x29 | ||||
- Attribute: 0x01 | - Attribute: 0x01 | ||||
Form: DW_FORM_addrx2 ## 0x2a | Form: DW_FORM_addrx2 ## 0x2a | ||||
- Attribute: 0x01 | - Attribute: 0x01 | ||||
Form: DW_FORM_addrx3 ## 0x2b | Form: DW_FORM_addrx3 ## 0x2b | ||||
- Attribute: 0x01 | - Attribute: 0x01 | ||||
Form: DW_FORM_addrx4 ## 0x2c | Form: DW_FORM_addrx4 ## 0x2c | ||||
debug_info: | debug_info: | ||||
- Length: 0x1234 | - Length: 0x1234 | ||||
Version: 5 | Version: 5 | ||||
UnitType: DW_UT_type | UnitType: DW_UT_type | ||||
AbbrevTableID: 0 | |||||
AbbrOffset: 0x1234 | AbbrOffset: 0x1234 | ||||
AddrSize: 4 | AddrSize: 4 | ||||
Entries: | Entries: | ||||
- AbbrCode: 1 | - AbbrCode: 1 | ||||
Values: | Values: | ||||
- Value: 0x12345678 ## DW_FORM_addr | - Value: 0x12345678 ## DW_FORM_addr | ||||
- BlockData: ## DW_FORM_block2 | - BlockData: ## DW_FORM_block2 | ||||
- 0x12 | - 0x12 | ||||
- 0x34 | - 0x34 | ||||
- BlockData: ## DW_FORM_block4 | - BlockData: ## DW_FORM_block4 | ||||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | - Length: 0x1234 | ||||
- Value: 0x12 ## DW_FORM_addrx1 | - Value: 0x12 ## DW_FORM_addrx1 | ||||
- Value: 0x1234 ## DW_FORM_addrx2 | - Value: 0x1234 ## DW_FORM_addrx2 | ||||
- Value: 0x123456 ## DW_FORM_addrx3 (unimplemented) | - Value: 0x123456 ## DW_FORM_addrx3 (unimplemented) | ||||
- Value: 0x12345678 ## DW_FORM_addrx4 | - Value: 0x12345678 ## DW_FORM_addrx4 | ||||
- Length: 0x1234 | - Length: 0x1234 | ||||
Version: 5 | Version: 5 | ||||
## Test another unit type. | ## Test another unit type. | ||||
UnitType: DW_UT_compile | UnitType: DW_UT_compile | ||||
AbbrevTableID: 0 | |||||
AbbrOffset: 0x1234 | AbbrOffset: 0x1234 | ||||
AddrSize: 4 | AddrSize: 4 | ||||
Entries: | Entries: | ||||
- AbbrCode: 0 | - AbbrCode: 0 | ||||
Values: [] | Values: [] | ||||
- Length: 0x5678 | - Length: 0x5678 | ||||
## Test DWARFv4 | ## Test DWARFv4 | ||||
Version: 4 | Version: 4 | ||||
AbbrevTableID: 0 | |||||
AbbrOffset: 0x5678 | AbbrOffset: 0x5678 | ||||
AddrSize: 4 | AddrSize: 4 | ||||
Entries: | Entries: | ||||
- AbbrCode: 1 | - AbbrCode: 1 | ||||
Values: | Values: | ||||
- Value: 0x12345678 ## DW_FORM_addr | - Value: 0x12345678 ## DW_FORM_addr | ||||
- BlockData: ## DW_FORM_block2 | - BlockData: ## DW_FORM_block2 | ||||
- 0x12 | - 0x12 | ||||
▲ Show 20 Lines • Show All 351 Lines • ▼ Show 20 Lines | - Length: 0x1234 | ||||
Values: | Values: | ||||
- Value: 0x87654321 | - Value: 0x87654321 | ||||
- Value: 0x1234 | - Value: 0x1234 | ||||
## Test that yaml2obj ignores the contents of entries with abbrev code 0. | ## Test that yaml2obj ignores the contents of entries with abbrev code 0. | ||||
- AbbrCode: 0 | - AbbrCode: 0 | ||||
Values: | Values: | ||||
- Value: 0x1234 | - Value: 0x1234 | ||||
## i) Test that yaml2obj reports an error when 'debug_info' has values in its | ## i) Test that yaml2obj reports an error when 'debug_info' has values in its | ||||
Higuoxing: Added test. | |||||
## entries but 'debug_abbrev' doesn't have enough attributes for them. | ## entries but 'debug_abbrev' doesn't have enough attributes for them. | ||||
# RUN: not yaml2obj --docnum=10 %s -o %t10.o 2>&1 | \ | # RUN: not yaml2obj --docnum=10 %s -o %t10.o 2>&1 | \ | ||||
# RUN: FileCheck %s --check-prefixes=ERROR | # RUN: FileCheck %s --check-prefixes=ERROR | ||||
# ERROR: yaml2obj: error: abbrev code must be less than or equal to the number of entries in abbreviation table | # ERROR: yaml2obj: error: abbrev code must be less than or equal to the number of entries in abbreviation table | ||||
Perhaps worth including the index and table count values in this error message to make it easier for people to identify the problem. jhenderson: Perhaps worth including the index and table count values in this error message to make it… | |||||
I've included the abbrev table ID and compilation unit count values in test case (n). Can we prettify the error message in test case (i) in a follow-up patch? Higuoxing: I've included the abbrev table ID and compilation unit count values in test case (n). Can we… | |||||
Not Done ReplyInline ActionsThat's fine. jhenderson: That's fine. | |||||
--- !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: | ||||
▲ Show 20 Lines • Show All 230 Lines • ▼ Show 20 Lines | DWARF: | ||||
debug_info: | debug_info: | ||||
- Version: 4 | - Version: 4 | ||||
AbbrOffset: 0x00 | AbbrOffset: 0x00 | ||||
## n) Test that yaml2obj emits an error message when a compilation unit has values but there is no associated abbrev table. | ## n) Test that yaml2obj emits an error message when a compilation unit has values but there is no associated abbrev table. | ||||
## RUN: not yaml2obj --docnum=16 %s 2>&1 | FileCheck %s --check-prefix=NO-ABBREV | ## RUN: not yaml2obj --docnum=16 %s 2>&1 | FileCheck %s --check-prefix=NO-ABBREV | ||||
# NO-ABBREV: yaml2obj: error: non-empty compilation unit should have an associated abbrev table | # NO-ABBREV: yaml2obj: error: cannot find abbrev table whose ID is 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 | ||||
DWARF: | DWARF: | ||||
debug_info: | debug_info: | ||||
- Version: 4 | - Version: 4 | ||||
AbbrOffset: 0x00 | AbbrOffset: 0x00 | ||||
Entries: | Entries: | ||||
- AbbrCode: 1 | - AbbrCode: 1 | ||||
Values: | Values: | ||||
- Value: 0x1234 | - Value: 0x1234 | ||||
Same as Mach-O, this really is a debug_abbrev test, not a debug_info test. jhenderson: Same as Mach-O, this really is a debug_abbrev test, not a debug_info test. |
Added test.