Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
Show First 20 Lines • Show All 1,357 Lines • ▼ Show 20 Lines | TEST(DWARFDebugInfo, TestChildIteratorsOnInvalidDie) { | ||||
auto end = Invalid.end(); | auto end = Invalid.end(); | ||||
EXPECT_FALSE(begin->isValid()); | EXPECT_FALSE(begin->isValid()); | ||||
EXPECT_FALSE(end->isValid()); | EXPECT_FALSE(end->isValid()); | ||||
EXPECT_EQ(begin, end); | EXPECT_EQ(begin, end); | ||||
} | } | ||||
TEST(DWARFDebugInfo, TestEmptyChildren) { | TEST(DWARFDebugInfo, TestEmptyChildren) { | ||||
const char *yamldata = "debug_abbrev:\n" | const char *yamldata = "debug_abbrev:\n" | ||||
" - Table:\n" | |||||
" - Code: 0x00000001\n" | " - Code: 0x00000001\n" | ||||
" Tag: DW_TAG_compile_unit\n" | " Tag: DW_TAG_compile_unit\n" | ||||
" Children: DW_CHILDREN_yes\n" | " Children: DW_CHILDREN_yes\n" | ||||
" Attributes:\n" | " Attributes:\n" | ||||
"debug_info:\n" | "debug_info:\n" | ||||
" - Version: 4\n" | " - Version: 4\n" | ||||
" AbbrOffset: 0\n" | " AbbrOffset: 0\n" | ||||
" AddrSize: 8\n" | " AddrSize: 8\n" | ||||
" Entries:\n" | " Entries:\n" | ||||
" - AbbrCode: 0x00000001\n" | " - AbbrCode: 0x00000001\n" | ||||
" Values:\n" | " Values:\n" | ||||
" - AbbrCode: 0x00000000\n" | " - AbbrCode: 0x00000000\n" | ||||
▲ Show 20 Lines • Show All 502 Lines • ▼ Show 20 Lines | TEST(DWARFDebugInfo, TestDwarfVerifyInvalidCURef) { | ||||
// the compile unit itself. | // the compile unit itself. | ||||
const char *yamldata = R"( | const char *yamldata = R"( | ||||
debug_str: | debug_str: | ||||
- '' | - '' | ||||
- /tmp/main.c | - /tmp/main.c | ||||
- main | - main | ||||
debug_abbrev: | debug_abbrev: | ||||
- Table: | |||||
- Code: 0x00000001 | - Code: 0x00000001 | ||||
Tag: DW_TAG_compile_unit | Tag: DW_TAG_compile_unit | ||||
Children: DW_CHILDREN_yes | Children: DW_CHILDREN_yes | ||||
Attributes: | Attributes: | ||||
- Attribute: DW_AT_name | - Attribute: DW_AT_name | ||||
Form: DW_FORM_strp | Form: DW_FORM_strp | ||||
- Code: 0x00000002 | - Code: 0x00000002 | ||||
Tag: DW_TAG_subprogram | Tag: DW_TAG_subprogram | ||||
Children: DW_CHILDREN_no | Children: DW_CHILDREN_no | ||||
Attributes: | Attributes: | ||||
- Attribute: DW_AT_name | - Attribute: DW_AT_name | ||||
Form: DW_FORM_strp | Form: DW_FORM_strp | ||||
- Attribute: DW_AT_type | - Attribute: DW_AT_type | ||||
Form: DW_FORM_ref4 | Form: DW_FORM_ref4 | ||||
debug_info: | debug_info: | ||||
- Length: 22 | - Length: 22 | ||||
Version: 4 | Version: 4 | ||||
AbbrOffset: 0 | AbbrOffset: 0 | ||||
AddrSize: 8 | AddrSize: 8 | ||||
Entries: | Entries: | ||||
- AbbrCode: 0x00000001 | - AbbrCode: 0x00000001 | ||||
Values: | Values: | ||||
Show All 18 Lines | TEST(DWARFDebugInfo, TestDwarfVerifyInvalidRefAddr) { | ||||
// Create a single compile unit with a single function that has an invalid | // Create a single compile unit with a single function that has an invalid | ||||
// DW_AT_type with an invalid .debug_info offset in its DW_FORM_ref_addr. | // DW_AT_type with an invalid .debug_info offset in its DW_FORM_ref_addr. | ||||
const char *yamldata = R"( | const char *yamldata = R"( | ||||
debug_str: | debug_str: | ||||
- '' | - '' | ||||
- /tmp/main.c | - /tmp/main.c | ||||
- main | - main | ||||
debug_abbrev: | debug_abbrev: | ||||
- Table: | |||||
- Code: 0x00000001 | - Code: 0x00000001 | ||||
Tag: DW_TAG_compile_unit | Tag: DW_TAG_compile_unit | ||||
Children: DW_CHILDREN_yes | Children: DW_CHILDREN_yes | ||||
Attributes: | Attributes: | ||||
- Attribute: DW_AT_name | - Attribute: DW_AT_name | ||||
Form: DW_FORM_strp | Form: DW_FORM_strp | ||||
- Code: 0x00000002 | - Code: 0x00000002 | ||||
Tag: DW_TAG_subprogram | Tag: DW_TAG_subprogram | ||||
Children: DW_CHILDREN_no | Children: DW_CHILDREN_no | ||||
Attributes: | Attributes: | ||||
- Attribute: DW_AT_name | - Attribute: DW_AT_name | ||||
Form: DW_FORM_strp | Form: DW_FORM_strp | ||||
- Attribute: DW_AT_type | - Attribute: DW_AT_type | ||||
Form: DW_FORM_ref_addr | Form: DW_FORM_ref_addr | ||||
debug_info: | debug_info: | ||||
- Length: 22 | - Length: 22 | ||||
Version: 4 | Version: 4 | ||||
AbbrOffset: 0 | AbbrOffset: 0 | ||||
AddrSize: 8 | AddrSize: 8 | ||||
Entries: | Entries: | ||||
- AbbrCode: 0x00000001 | - AbbrCode: 0x00000001 | ||||
Values: | Values: | ||||
Show All 16 Lines | |||||
TEST(DWARFDebugInfo, TestDwarfVerifyInvalidRanges) { | TEST(DWARFDebugInfo, TestDwarfVerifyInvalidRanges) { | ||||
// Create a single compile unit with a DW_AT_ranges whose section offset | // Create a single compile unit with a DW_AT_ranges whose section offset | ||||
// isn't valid. | // isn't valid. | ||||
const char *yamldata = R"( | const char *yamldata = R"( | ||||
debug_str: | debug_str: | ||||
- '' | - '' | ||||
- /tmp/main.c | - /tmp/main.c | ||||
debug_abbrev: | debug_abbrev: | ||||
- Table: | |||||
- Code: 0x00000001 | - Code: 0x00000001 | ||||
Tag: DW_TAG_compile_unit | Tag: DW_TAG_compile_unit | ||||
Children: DW_CHILDREN_no | Children: DW_CHILDREN_no | ||||
Attributes: | Attributes: | ||||
- Attribute: DW_AT_name | - Attribute: DW_AT_name | ||||
Form: DW_FORM_strp | Form: DW_FORM_strp | ||||
- Attribute: DW_AT_ranges | - Attribute: DW_AT_ranges | ||||
Form: DW_FORM_sec_offset | Form: DW_FORM_sec_offset | ||||
debug_info: | debug_info: | ||||
- Length: 16 | - Length: 16 | ||||
Version: 4 | Version: 4 | ||||
AbbrOffset: 0 | AbbrOffset: 0 | ||||
AddrSize: 8 | AddrSize: 8 | ||||
Entries: | Entries: | ||||
- AbbrCode: 0x00000001 | - AbbrCode: 0x00000001 | ||||
Values: | Values: | ||||
Show All 13 Lines | |||||
TEST(DWARFDebugInfo, TestDwarfVerifyInvalidRnglists) { | TEST(DWARFDebugInfo, TestDwarfVerifyInvalidRnglists) { | ||||
// Create a single compile unit with a DW_AT_ranges whose section offset | // Create a single compile unit with a DW_AT_ranges whose section offset | ||||
// isn't valid. | // isn't valid. | ||||
const char *yamldata = R"( | const char *yamldata = R"( | ||||
debug_str: | debug_str: | ||||
- '' | - '' | ||||
- /tmp/main.c | - /tmp/main.c | ||||
debug_abbrev: | debug_abbrev: | ||||
- Table: | |||||
- Code: 0x00000001 | - Code: 0x00000001 | ||||
Tag: DW_TAG_compile_unit | Tag: DW_TAG_compile_unit | ||||
Children: DW_CHILDREN_no | Children: DW_CHILDREN_no | ||||
Attributes: | Attributes: | ||||
- Attribute: DW_AT_name | - Attribute: DW_AT_name | ||||
Form: DW_FORM_strp | Form: DW_FORM_strp | ||||
- Attribute: DW_AT_ranges | - Attribute: DW_AT_ranges | ||||
Form: DW_FORM_sec_offset | Form: DW_FORM_sec_offset | ||||
debug_info: | debug_info: | ||||
- Length: 17 | - Length: 17 | ||||
Version: 5 | Version: 5 | ||||
UnitType: DW_UT_compile | UnitType: DW_UT_compile | ||||
AbbrOffset: 0 | AbbrOffset: 0 | ||||
AddrSize: 8 | AddrSize: 8 | ||||
Entries: | Entries: | ||||
- AbbrCode: 0x00000001 | - AbbrCode: 0x00000001 | ||||
Show All 13 Lines | |||||
TEST(DWARFDebugInfo, TestDwarfVerifyInvalidStmtList) { | TEST(DWARFDebugInfo, TestDwarfVerifyInvalidStmtList) { | ||||
// Create a single compile unit with a DW_AT_stmt_list whose section offset | // Create a single compile unit with a DW_AT_stmt_list whose section offset | ||||
// isn't valid. | // isn't valid. | ||||
const char *yamldata = R"( | const char *yamldata = R"( | ||||
debug_str: | debug_str: | ||||
- '' | - '' | ||||
- /tmp/main.c | - /tmp/main.c | ||||
debug_abbrev: | debug_abbrev: | ||||
- Table: | |||||
- Code: 0x00000001 | - Code: 0x00000001 | ||||
Tag: DW_TAG_compile_unit | Tag: DW_TAG_compile_unit | ||||
Children: DW_CHILDREN_no | Children: DW_CHILDREN_no | ||||
Attributes: | Attributes: | ||||
- Attribute: DW_AT_name | - Attribute: DW_AT_name | ||||
Form: DW_FORM_strp | Form: DW_FORM_strp | ||||
- Attribute: DW_AT_stmt_list | - Attribute: DW_AT_stmt_list | ||||
Form: DW_FORM_sec_offset | Form: DW_FORM_sec_offset | ||||
debug_info: | debug_info: | ||||
- Length: 16 | - Length: 16 | ||||
Version: 4 | Version: 4 | ||||
AbbrOffset: 0 | AbbrOffset: 0 | ||||
AddrSize: 8 | AddrSize: 8 | ||||
Entries: | Entries: | ||||
- AbbrCode: 0x00000001 | - AbbrCode: 0x00000001 | ||||
Values: | Values: | ||||
Show All 12 Lines | |||||
TEST(DWARFDebugInfo, TestDwarfVerifyInvalidStrp) { | TEST(DWARFDebugInfo, TestDwarfVerifyInvalidStrp) { | ||||
// Create a single compile unit with a single function that has an invalid | // Create a single compile unit with a single function that has an invalid | ||||
// DW_FORM_strp for the DW_AT_name. | // DW_FORM_strp for the DW_AT_name. | ||||
const char *yamldata = R"( | const char *yamldata = R"( | ||||
debug_str: | debug_str: | ||||
- '' | - '' | ||||
debug_abbrev: | debug_abbrev: | ||||
- Table: | |||||
- Code: 0x00000001 | - Code: 0x00000001 | ||||
Tag: DW_TAG_compile_unit | Tag: DW_TAG_compile_unit | ||||
Children: DW_CHILDREN_no | Children: DW_CHILDREN_no | ||||
Attributes: | Attributes: | ||||
- Attribute: DW_AT_name | - Attribute: DW_AT_name | ||||
Form: DW_FORM_strp | Form: DW_FORM_strp | ||||
debug_info: | debug_info: | ||||
- Length: 12 | - Length: 12 | ||||
Version: 4 | Version: 4 | ||||
AbbrOffset: 0 | AbbrOffset: 0 | ||||
AddrSize: 8 | AddrSize: 8 | ||||
Entries: | Entries: | ||||
- AbbrCode: 0x00000001 | - AbbrCode: 0x00000001 | ||||
Values: | Values: | ||||
Show All 11 Lines | TEST(DWARFDebugInfo, TestDwarfVerifyInvalidRefAddrBetween) { | ||||
// Create a single compile unit with a single function that has a DW_AT_type | // Create a single compile unit with a single function that has a DW_AT_type | ||||
// with a valid .debug_info offset, but the offset is between two DIEs. | // with a valid .debug_info offset, but the offset is between two DIEs. | ||||
const char *yamldata = R"( | const char *yamldata = R"( | ||||
debug_str: | debug_str: | ||||
- '' | - '' | ||||
- /tmp/main.c | - /tmp/main.c | ||||
- main | - main | ||||
debug_abbrev: | debug_abbrev: | ||||
- Table: | |||||
- Code: 0x00000001 | - Code: 0x00000001 | ||||
Tag: DW_TAG_compile_unit | Tag: DW_TAG_compile_unit | ||||
Children: DW_CHILDREN_yes | Children: DW_CHILDREN_yes | ||||
Attributes: | Attributes: | ||||
- Attribute: DW_AT_name | - Attribute: DW_AT_name | ||||
Form: DW_FORM_strp | Form: DW_FORM_strp | ||||
- Code: 0x00000002 | - Code: 0x00000002 | ||||
Tag: DW_TAG_subprogram | Tag: DW_TAG_subprogram | ||||
Children: DW_CHILDREN_no | Children: DW_CHILDREN_no | ||||
Attributes: | Attributes: | ||||
- Attribute: DW_AT_name | - Attribute: DW_AT_name | ||||
Form: DW_FORM_strp | Form: DW_FORM_strp | ||||
- Attribute: DW_AT_type | - Attribute: DW_AT_type | ||||
Form: DW_FORM_ref_addr | Form: DW_FORM_ref_addr | ||||
debug_info: | debug_info: | ||||
- Length: 22 | - Length: 22 | ||||
Version: 4 | Version: 4 | ||||
AbbrOffset: 0 | AbbrOffset: 0 | ||||
AddrSize: 8 | AddrSize: 8 | ||||
Entries: | Entries: | ||||
- AbbrCode: 0x00000001 | - AbbrCode: 0x00000001 | ||||
Values: | Values: | ||||
Show All 17 Lines | |||||
TEST(DWARFDebugInfo, TestDwarfVerifyInvalidLineSequence) { | TEST(DWARFDebugInfo, TestDwarfVerifyInvalidLineSequence) { | ||||
// Create a single compile unit whose line table has a sequence in it where | // Create a single compile unit whose line table has a sequence in it where | ||||
// the address decreases. | // the address decreases. | ||||
StringRef yamldata = R"( | StringRef yamldata = R"( | ||||
debug_str: | debug_str: | ||||
- '' | - '' | ||||
- /tmp/main.c | - /tmp/main.c | ||||
debug_abbrev: | debug_abbrev: | ||||
- Table: | |||||
- Code: 0x00000001 | - Code: 0x00000001 | ||||
Tag: DW_TAG_compile_unit | Tag: DW_TAG_compile_unit | ||||
Children: DW_CHILDREN_no | Children: DW_CHILDREN_no | ||||
Attributes: | Attributes: | ||||
- Attribute: DW_AT_name | - Attribute: DW_AT_name | ||||
Form: DW_FORM_strp | Form: DW_FORM_strp | ||||
- Attribute: DW_AT_stmt_list | - Attribute: DW_AT_stmt_list | ||||
Form: DW_FORM_sec_offset | Form: DW_FORM_sec_offset | ||||
debug_info: | debug_info: | ||||
- Length: 16 | - Length: 16 | ||||
Version: 4 | Version: 4 | ||||
AbbrOffset: 0 | AbbrOffset: 0 | ||||
AddrSize: 8 | AddrSize: 8 | ||||
Entries: | Entries: | ||||
- AbbrCode: 0x00000001 | - AbbrCode: 0x00000001 | ||||
Values: | Values: | ||||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | |||||
TEST(DWARFDebugInfo, TestDwarfVerifyInvalidLineFileIndex) { | TEST(DWARFDebugInfo, TestDwarfVerifyInvalidLineFileIndex) { | ||||
// Create a single compile unit whose line table has a line table row with | // Create a single compile unit whose line table has a line table row with | ||||
// an invalid file index. | // an invalid file index. | ||||
StringRef yamldata = R"( | StringRef yamldata = R"( | ||||
debug_str: | debug_str: | ||||
- '' | - '' | ||||
- /tmp/main.c | - /tmp/main.c | ||||
debug_abbrev: | debug_abbrev: | ||||
- Table: | |||||
- Code: 0x00000001 | - Code: 0x00000001 | ||||
Tag: DW_TAG_compile_unit | Tag: DW_TAG_compile_unit | ||||
Children: DW_CHILDREN_no | Children: DW_CHILDREN_no | ||||
Attributes: | Attributes: | ||||
- Attribute: DW_AT_name | - Attribute: DW_AT_name | ||||
Form: DW_FORM_strp | Form: DW_FORM_strp | ||||
- Attribute: DW_AT_stmt_list | - Attribute: DW_AT_stmt_list | ||||
Form: DW_FORM_sec_offset | Form: DW_FORM_sec_offset | ||||
debug_info: | debug_info: | ||||
- Length: 16 | - Length: 16 | ||||
Version: 4 | Version: 4 | ||||
AbbrOffset: 0 | AbbrOffset: 0 | ||||
AddrSize: 8 | AddrSize: 8 | ||||
Entries: | Entries: | ||||
- AbbrCode: 0x00000001 | - AbbrCode: 0x00000001 | ||||
Values: | Values: | ||||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | |||||
TEST(DWARFDebugInfo, TestDwarfVerifyInvalidLineTablePorlogueDirIndex) { | TEST(DWARFDebugInfo, TestDwarfVerifyInvalidLineTablePorlogueDirIndex) { | ||||
// Create a single compile unit whose line table has a prologue with an | // Create a single compile unit whose line table has a prologue with an | ||||
// invalid dir index. | // invalid dir index. | ||||
StringRef yamldata = R"( | StringRef yamldata = R"( | ||||
debug_str: | debug_str: | ||||
- '' | - '' | ||||
- /tmp/main.c | - /tmp/main.c | ||||
debug_abbrev: | debug_abbrev: | ||||
- Table: | |||||
- Code: 0x00000001 | - Code: 0x00000001 | ||||
Tag: DW_TAG_compile_unit | Tag: DW_TAG_compile_unit | ||||
Children: DW_CHILDREN_no | Children: DW_CHILDREN_no | ||||
Attributes: | Attributes: | ||||
- Attribute: DW_AT_name | - Attribute: DW_AT_name | ||||
Form: DW_FORM_strp | Form: DW_FORM_strp | ||||
- Attribute: DW_AT_stmt_list | - Attribute: DW_AT_stmt_list | ||||
Form: DW_FORM_sec_offset | Form: DW_FORM_sec_offset | ||||
debug_info: | debug_info: | ||||
- Length: 16 | - Length: 16 | ||||
Version: 4 | Version: 4 | ||||
AbbrOffset: 0 | AbbrOffset: 0 | ||||
AddrSize: 8 | AddrSize: 8 | ||||
Entries: | Entries: | ||||
- AbbrCode: 0x00000001 | - AbbrCode: 0x00000001 | ||||
Values: | Values: | ||||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | |||||
TEST(DWARFDebugInfo, TestDwarfVerifyDuplicateFileWarning) { | TEST(DWARFDebugInfo, TestDwarfVerifyDuplicateFileWarning) { | ||||
// Create a single compile unit whose line table has a prologue with an | // Create a single compile unit whose line table has a prologue with an | ||||
// invalid dir index. | // invalid dir index. | ||||
StringRef yamldata = R"( | StringRef yamldata = R"( | ||||
debug_str: | debug_str: | ||||
- '' | - '' | ||||
- /tmp/main.c | - /tmp/main.c | ||||
debug_abbrev: | debug_abbrev: | ||||
- Table: | |||||
- Code: 0x00000001 | - Code: 0x00000001 | ||||
Tag: DW_TAG_compile_unit | Tag: DW_TAG_compile_unit | ||||
Children: DW_CHILDREN_no | Children: DW_CHILDREN_no | ||||
Attributes: | Attributes: | ||||
- Attribute: DW_AT_name | - Attribute: DW_AT_name | ||||
Form: DW_FORM_strp | Form: DW_FORM_strp | ||||
- Attribute: DW_AT_stmt_list | - Attribute: DW_AT_stmt_list | ||||
Form: DW_FORM_sec_offset | Form: DW_FORM_sec_offset | ||||
debug_info: | debug_info: | ||||
- Length: 16 | - Length: 16 | ||||
Version: 4 | Version: 4 | ||||
AbbrOffset: 0 | AbbrOffset: 0 | ||||
AddrSize: 8 | AddrSize: 8 | ||||
Entries: | Entries: | ||||
- AbbrCode: 0x00000001 | - AbbrCode: 0x00000001 | ||||
Values: | Values: | ||||
▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | TEST(DWARFDebugInfo, TestDwarfVerifyCUDontShareLineTable) { | ||||
// Create a two compile units where both compile units share the same | // Create a two compile units where both compile units share the same | ||||
// DW_AT_stmt_list value and verify we report the error correctly. | // DW_AT_stmt_list value and verify we report the error correctly. | ||||
StringRef yamldata = R"( | StringRef yamldata = R"( | ||||
debug_str: | debug_str: | ||||
- '' | - '' | ||||
- /tmp/main.c | - /tmp/main.c | ||||
- /tmp/foo.c | - /tmp/foo.c | ||||
debug_abbrev: | debug_abbrev: | ||||
- Table: | |||||
- Code: 0x00000001 | - Code: 0x00000001 | ||||
Tag: DW_TAG_compile_unit | Tag: DW_TAG_compile_unit | ||||
Children: DW_CHILDREN_no | Children: DW_CHILDREN_no | ||||
Attributes: | Attributes: | ||||
- Attribute: DW_AT_name | - Attribute: DW_AT_name | ||||
Form: DW_FORM_strp | Form: DW_FORM_strp | ||||
- Attribute: DW_AT_stmt_list | - Attribute: DW_AT_stmt_list | ||||
Form: DW_FORM_sec_offset | Form: DW_FORM_sec_offset | ||||
debug_info: | debug_info: | ||||
- Length: 16 | - Length: 16 | ||||
Version: 4 | Version: 4 | ||||
AbbrOffset: 0 | AbbrOffset: 0 | ||||
AddrSize: 8 | AddrSize: 8 | ||||
Entries: | Entries: | ||||
- AbbrCode: 0x00000001 | - AbbrCode: 0x00000001 | ||||
Values: | Values: | ||||
▲ Show 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | TEST(DWARFDebugInfo, TestDwarfVerifyCURangesIncomplete) { | ||||
// address range of the function. The verification should fail due to | // address range of the function. The verification should fail due to | ||||
// the CU ranges not containing all of the address ranges of all of the | // the CU ranges not containing all of the address ranges of all of the | ||||
// functions. | // functions. | ||||
StringRef yamldata = R"( | StringRef yamldata = R"( | ||||
debug_str: | debug_str: | ||||
- '' | - '' | ||||
- /tmp/main.c | - /tmp/main.c | ||||
debug_abbrev: | debug_abbrev: | ||||
- Table: | |||||
- Code: 0x00000001 | - Code: 0x00000001 | ||||
Tag: DW_TAG_compile_unit | Tag: DW_TAG_compile_unit | ||||
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_addr | Form: DW_FORM_addr | ||||
- Attribute: DW_AT_name | - Attribute: DW_AT_name | ||||
Form: DW_FORM_strp | Form: DW_FORM_strp | ||||
- Code: 0x00000002 | - Code: 0x00000002 | ||||
Tag: DW_TAG_subprogram | Tag: DW_TAG_subprogram | ||||
Children: DW_CHILDREN_no | Children: DW_CHILDREN_no | ||||
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_addr | Form: DW_FORM_addr | ||||
debug_info: | debug_info: | ||||
- Length: 46 | - Length: 46 | ||||
Version: 4 | Version: 4 | ||||
AbbrOffset: 0 | AbbrOffset: 0 | ||||
AddrSize: 8 | AddrSize: 8 | ||||
Entries: | Entries: | ||||
- AbbrCode: 0x00000001 | - AbbrCode: 0x00000001 | ||||
Values: | Values: | ||||
Show All 19 Lines | TEST(DWARFDebugInfo, TestDwarfVerifyLexicalBlockRanges) { | ||||
// Create a single compile unit with a single function that has a lexical | // Create a single compile unit with a single function that has a lexical | ||||
// block whose address range is not contained in the function address range. | // block whose address range is not contained in the function address range. | ||||
StringRef yamldata = R"( | StringRef yamldata = R"( | ||||
debug_str: | debug_str: | ||||
- '' | - '' | ||||
- /tmp/main.c | - /tmp/main.c | ||||
- main | - main | ||||
debug_abbrev: | debug_abbrev: | ||||
- Table: | |||||
- Code: 0x00000001 | - Code: 0x00000001 | ||||
Tag: DW_TAG_compile_unit | Tag: DW_TAG_compile_unit | ||||
Children: DW_CHILDREN_yes | Children: DW_CHILDREN_yes | ||||
Attributes: | Attributes: | ||||
- Attribute: DW_AT_name | - Attribute: DW_AT_name | ||||
Form: DW_FORM_strp | Form: DW_FORM_strp | ||||
- Code: 0x00000002 | - Code: 0x00000002 | ||||
Tag: DW_TAG_subprogram | Tag: DW_TAG_subprogram | ||||
Children: DW_CHILDREN_yes | Children: DW_CHILDREN_yes | ||||
Attributes: | Attributes: | ||||
- Attribute: DW_AT_name | - Attribute: DW_AT_name | ||||
Form: DW_FORM_strp | Form: DW_FORM_strp | ||||
- 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_addr | Form: DW_FORM_addr | ||||
- Code: 0x00000003 | - Code: 0x00000003 | ||||
Tag: DW_TAG_lexical_block | Tag: DW_TAG_lexical_block | ||||
Children: DW_CHILDREN_no | Children: DW_CHILDREN_no | ||||
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_addr | Form: DW_FORM_addr | ||||
debug_info: | debug_info: | ||||
- Length: 52 | - Length: 52 | ||||
Version: 4 | Version: 4 | ||||
AbbrOffset: 0 | AbbrOffset: 0 | ||||
AddrSize: 8 | AddrSize: 8 | ||||
Entries: | Entries: | ||||
- AbbrCode: 0x00000001 | - AbbrCode: 0x00000001 | ||||
Values: | Values: | ||||
Show All 25 Lines | TEST(DWARFDebugInfo, TestDwarfVerifyOverlappingFunctionRanges) { | ||||
// address ranges. | // address ranges. | ||||
StringRef yamldata = R"( | StringRef yamldata = R"( | ||||
debug_str: | debug_str: | ||||
- '' | - '' | ||||
- /tmp/main.c | - /tmp/main.c | ||||
- main | - main | ||||
- foo | - foo | ||||
debug_abbrev: | debug_abbrev: | ||||
- Table: | |||||
- Code: 0x00000001 | - Code: 0x00000001 | ||||
Tag: DW_TAG_compile_unit | Tag: DW_TAG_compile_unit | ||||
Children: DW_CHILDREN_yes | Children: DW_CHILDREN_yes | ||||
Attributes: | Attributes: | ||||
- Attribute: DW_AT_name | - Attribute: DW_AT_name | ||||
Form: DW_FORM_strp | Form: DW_FORM_strp | ||||
- Code: 0x00000002 | - Code: 0x00000002 | ||||
Tag: DW_TAG_subprogram | Tag: DW_TAG_subprogram | ||||
Children: DW_CHILDREN_no | Children: DW_CHILDREN_no | ||||
Attributes: | Attributes: | ||||
- Attribute: DW_AT_name | - Attribute: DW_AT_name | ||||
Form: DW_FORM_strp | Form: DW_FORM_strp | ||||
- 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_addr | Form: DW_FORM_addr | ||||
debug_info: | debug_info: | ||||
- Length: 55 | - Length: 55 | ||||
Version: 4 | Version: 4 | ||||
AbbrOffset: 0 | AbbrOffset: 0 | ||||
AddrSize: 8 | AddrSize: 8 | ||||
Entries: | Entries: | ||||
- AbbrCode: 0x00000001 | - AbbrCode: 0x00000001 | ||||
Values: | Values: | ||||
Show All 22 Lines | TEST(DWARFDebugInfo, TestDwarfVerifyOverlappingLexicalBlockRanges) { | ||||
// Create a single compile unit with a one function that has two lexical | // Create a single compile unit with a one function that has two lexical | ||||
// blocks with overlapping address ranges. | // blocks with overlapping address ranges. | ||||
StringRef yamldata = R"( | StringRef yamldata = R"( | ||||
debug_str: | debug_str: | ||||
- '' | - '' | ||||
- /tmp/main.c | - /tmp/main.c | ||||
- main | - main | ||||
debug_abbrev: | debug_abbrev: | ||||
- Table: | |||||
- Code: 0x00000001 | - Code: 0x00000001 | ||||
Tag: DW_TAG_compile_unit | Tag: DW_TAG_compile_unit | ||||
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_addr | Form: DW_FORM_addr | ||||
- Attribute: DW_AT_name | - Attribute: DW_AT_name | ||||
Form: DW_FORM_strp | Form: DW_FORM_strp | ||||
- Code: 0x00000002 | - Code: 0x00000002 | ||||
Tag: DW_TAG_subprogram | Tag: DW_TAG_subprogram | ||||
Children: DW_CHILDREN_yes | Children: DW_CHILDREN_yes | ||||
Attributes: | Attributes: | ||||
- Attribute: DW_AT_name | - Attribute: DW_AT_name | ||||
Form: DW_FORM_strp | Form: DW_FORM_strp | ||||
- 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_addr | Form: DW_FORM_addr | ||||
- Code: 0x00000003 | - Code: 0x00000003 | ||||
Tag: DW_TAG_lexical_block | Tag: DW_TAG_lexical_block | ||||
Children: DW_CHILDREN_no | Children: DW_CHILDREN_no | ||||
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_addr | Form: DW_FORM_addr | ||||
debug_info: | debug_info: | ||||
- Length: 85 | - Length: 85 | ||||
Version: 4 | Version: 4 | ||||
AbbrOffset: 0 | AbbrOffset: 0 | ||||
AddrSize: 8 | AddrSize: 8 | ||||
Entries: | Entries: | ||||
- AbbrCode: 0x00000001 | - AbbrCode: 0x00000001 | ||||
Values: | Values: | ||||
Show All 29 Lines | TEST(DWARFDebugInfo, TestDwarfVerifyInvalidDIERange) { | ||||
// Create a single compile unit with a single function that has an invalid | // Create a single compile unit with a single function that has an invalid | ||||
// address range where the high PC is smaller than the low PC. | // address range where the high PC is smaller than the low PC. | ||||
StringRef yamldata = R"( | StringRef yamldata = R"( | ||||
debug_str: | debug_str: | ||||
- '' | - '' | ||||
- /tmp/main.c | - /tmp/main.c | ||||
- main | - main | ||||
debug_abbrev: | debug_abbrev: | ||||
- Table: | |||||
- Code: 0x00000001 | - Code: 0x00000001 | ||||
Tag: DW_TAG_compile_unit | Tag: DW_TAG_compile_unit | ||||
Children: DW_CHILDREN_yes | Children: DW_CHILDREN_yes | ||||
Attributes: | Attributes: | ||||
- Attribute: DW_AT_name | - Attribute: DW_AT_name | ||||
Form: DW_FORM_strp | Form: DW_FORM_strp | ||||
- Code: 0x00000002 | - Code: 0x00000002 | ||||
Tag: DW_TAG_subprogram | Tag: DW_TAG_subprogram | ||||
Children: DW_CHILDREN_no | Children: DW_CHILDREN_no | ||||
Attributes: | Attributes: | ||||
- Attribute: DW_AT_name | - Attribute: DW_AT_name | ||||
Form: DW_FORM_strp | Form: DW_FORM_strp | ||||
- 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_addr | Form: DW_FORM_addr | ||||
debug_info: | debug_info: | ||||
- Length: 34 | - Length: 34 | ||||
Version: 4 | Version: 4 | ||||
AbbrOffset: 0 | AbbrOffset: 0 | ||||
AddrSize: 8 | AddrSize: 8 | ||||
Entries: | Entries: | ||||
- AbbrCode: 0x00000001 | - AbbrCode: 0x00000001 | ||||
Values: | Values: | ||||
Show All 20 Lines | TEST(DWARFDebugInfo, TestDwarfVerifyElidedDoesntFail) { | ||||
// ensure that verification succeeds. | // ensure that verification succeeds. | ||||
StringRef yamldata = R"( | StringRef yamldata = R"( | ||||
debug_str: | debug_str: | ||||
- '' | - '' | ||||
- /tmp/main.c | - /tmp/main.c | ||||
- main | - main | ||||
- elided | - elided | ||||
debug_abbrev: | debug_abbrev: | ||||
- Table: | |||||
- Code: 0x00000001 | - Code: 0x00000001 | ||||
Tag: DW_TAG_compile_unit | Tag: DW_TAG_compile_unit | ||||
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_addr | Form: DW_FORM_addr | ||||
- Attribute: DW_AT_name | - Attribute: DW_AT_name | ||||
Form: DW_FORM_strp | Form: DW_FORM_strp | ||||
- Code: 0x00000002 | - Code: 0x00000002 | ||||
Tag: DW_TAG_subprogram | Tag: DW_TAG_subprogram | ||||
Children: DW_CHILDREN_no | Children: DW_CHILDREN_no | ||||
Attributes: | Attributes: | ||||
- Attribute: DW_AT_name | - Attribute: DW_AT_name | ||||
Form: DW_FORM_strp | Form: DW_FORM_strp | ||||
- 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_addr | Form: DW_FORM_addr | ||||
debug_info: | debug_info: | ||||
- Length: 71 | - Length: 71 | ||||
Version: 4 | Version: 4 | ||||
AbbrOffset: 0 | AbbrOffset: 0 | ||||
AddrSize: 8 | AddrSize: 8 | ||||
Entries: | Entries: | ||||
- AbbrCode: 0x00000001 | - AbbrCode: 0x00000001 | ||||
Values: | Values: | ||||
Show All 26 Lines | TEST(DWARFDebugInfo, TestDwarfVerifyNestedFunctions) { | ||||
// to the DWARF standard. | // to the DWARF standard. | ||||
StringRef yamldata = R"( | StringRef yamldata = R"( | ||||
debug_str: | debug_str: | ||||
- '' | - '' | ||||
- /tmp/main.c | - /tmp/main.c | ||||
- main | - main | ||||
- nested | - nested | ||||
debug_abbrev: | debug_abbrev: | ||||
- Table: | |||||
- Code: 0x00000001 | - Code: 0x00000001 | ||||
Tag: DW_TAG_compile_unit | Tag: DW_TAG_compile_unit | ||||
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_addr | Form: DW_FORM_addr | ||||
- Attribute: DW_AT_name | - Attribute: DW_AT_name | ||||
Form: DW_FORM_strp | Form: DW_FORM_strp | ||||
- Code: 0x00000002 | - Code: 0x00000002 | ||||
Tag: DW_TAG_subprogram | Tag: DW_TAG_subprogram | ||||
Children: DW_CHILDREN_yes | Children: DW_CHILDREN_yes | ||||
Attributes: | Attributes: | ||||
- Attribute: DW_AT_name | - Attribute: DW_AT_name | ||||
Form: DW_FORM_strp | Form: DW_FORM_strp | ||||
- 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_addr | Form: DW_FORM_addr | ||||
debug_info: | debug_info: | ||||
- Length: 73 | - Length: 73 | ||||
Version: 4 | Version: 4 | ||||
AbbrOffset: 0 | AbbrOffset: 0 | ||||
AddrSize: 8 | AddrSize: 8 | ||||
Entries: | Entries: | ||||
- AbbrCode: 0x00000001 | - AbbrCode: 0x00000001 | ||||
Values: | Values: | ||||
▲ Show 20 Lines • Show All 245 Lines • Show Last 20 Lines |