Skip to content

Commit

Permalink
[Test] Simplify DWARF test cases. NFC.
Browse files Browse the repository at this point in the history
The Length, AbbrOffset and Values fields of the debug_info section are
optional. This patch helps remove them and simplify test cases.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D86857
  • Loading branch information
higuoxing committed Aug 31, 2020
1 parent f2284e3 commit 1d01fc1
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 145 deletions.
6 changes: 1 addition & 5 deletions lldb/test/API/functionalities/source-map/a.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,7 @@ DWARF:
- Attribute: DW_AT_type
Form: DW_FORM_ref4
debug_info:
- Length: 122
Version: 4
AbbrOffset: 0
- Version: 4
AddrSize: 8
Entries:
- AbbrCode: 0x00000001
Expand Down Expand Up @@ -345,7 +343,6 @@ DWARF:
- Value: 0x0000000000000001
- Value: 0x0000000000000067
- AbbrCode: 0x00000000
Values: []
- AbbrCode: 0x00000004
Values:
- Value: 0x0000000000000059
Expand All @@ -366,7 +363,6 @@ DWARF:
- Value: 0x0000000000000006
- Value: 0x0000000000000001
- AbbrCode: 0x00000000
Values: []
debug_line:
- Length: 68
Version: 4
Expand Down
5 changes: 1 addition & 4 deletions lldb/unittests/Expression/DWARFExpressionTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ TEST(DWARFExpression, DW_OP_convert) {
" Form: DW_FORM_data1\n"
"debug_info:\n"
" - Version: 4\n"
" AbbrOffset: 0\n"
" AddrSize: 8\n"
" Entries:\n"
" - AbbrCode: 0x00000001\n"
Expand Down Expand Up @@ -132,9 +131,7 @@ TEST(DWARFExpression, DW_OP_convert) {
" Values:\n"
" - Value: 0x000000000000000b\n" // DW_ATE_numeric_string
" - Value: 0x0000000000000001\n"
""
" - AbbrCode: 0x00000000\n"
" Values: []\n";
" - AbbrCode: 0x00000000\n";
uint8_t offs_uint32_t = 0x0000000e;
uint8_t offs_uint64_t = 0x00000011;
uint8_t offs_sint64_t = 0x00000014;
Expand Down
14 changes: 1 addition & 13 deletions lldb/unittests/Symbol/Inputs/inlined-functions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,7 @@ DWARF:
- Attribute: DW_AT_type
Form: DW_FORM_ref4
debug_info:
- Length: 579
Version: 4
AbbrOffset: 0
- Version: 4
AddrSize: 8
Entries:
- AbbrCode: 0x00000001
Expand Down Expand Up @@ -411,7 +409,6 @@ DWARF:
- Value: 0x0000000000000007
- Value: 0x00000000000000B2
- AbbrCode: 0x00000000
Values: []
- AbbrCode: 0x00000005
Values:
- Value: 0x0000000000000094
Expand Down Expand Up @@ -440,7 +437,6 @@ DWARF:
- Value: 0x0000000000000002
- Value: 0x00000000000000B2
- AbbrCode: 0x00000000
Values: []
- AbbrCode: 0x00000008
Values:
- Value: 0x00000000000000A3
Expand Down Expand Up @@ -486,7 +482,6 @@ DWARF:
- Value: 0x000000000000000C
- Value: 0x00000000000000B2
- AbbrCode: 0x00000000
Values: []
- AbbrCode: 0x00000009
Values:
- Value: 0x0000000000000020
Expand Down Expand Up @@ -562,7 +557,6 @@ DWARF:
- 0x7F
- Value: 0x00000000000000A6
- AbbrCode: 0x00000000
Values: []
- AbbrCode: 0x0000000A
Values:
- Value: 0x00000000000000B9
Expand Down Expand Up @@ -634,7 +628,6 @@ DWARF:
- 0x68
- Value: 0x00000000000000A6
- AbbrCode: 0x00000000
Values: []
- AbbrCode: 0x0000000A
Values:
- Value: 0x0000000000000080
Expand Down Expand Up @@ -664,9 +657,7 @@ DWARF:
- 0x74
- Value: 0x00000000000000A6
- AbbrCode: 0x00000000
Values: []
- AbbrCode: 0x00000000
Values: []
- AbbrCode: 0x0000000A
Values:
- Value: 0x0000000000000080
Expand Down Expand Up @@ -696,9 +687,7 @@ DWARF:
- 0x48
- Value: 0x00000000000000A6
- AbbrCode: 0x00000000
Values: []
- AbbrCode: 0x00000000
Values: []
- AbbrCode: 0x0000000D
Values:
- Value: 0x000000000000023A
Expand All @@ -711,7 +700,6 @@ DWARF:
- Value: 0x0000000000000006
- Value: 0x0000000000000001
- AbbrCode: 0x00000000
Values: []
debug_line:
- Length: 202
Version: 4
Expand Down
5 changes: 1 addition & 4 deletions lldb/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ TEST_F(DWARFASTParserClangTests,
" Form: DW_FORM_data1\n"
"debug_info:\n"
" - Version: 4\n"
" AbbrOffset: 0\n"
" AddrSize: 8\n"
" Entries:\n"
" - AbbrCode: 0x00000001\n"
Expand All @@ -84,9 +83,7 @@ TEST_F(DWARFASTParserClangTests,
" Values:\n"
" - Value: 0x0000000000000008\n" // DW_ATE_unsigned_char
" - Value: 0x0000000000000001\n"
""
" - AbbrCode: 0x00000000\n"
" Values: []\n";
" - AbbrCode: 0x00000000\n";

YAMLModuleTester t(yamldata, "i386-unknown-linux");
ASSERT_TRUE((bool)t.GetDwarfUnit());
Expand Down
5 changes: 1 addition & 4 deletions lldb/unittests/SymbolFile/DWARF/XcodeSDKModuleTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,14 @@ TEST_F(XcodeSDKModuleTests, TestModuleGetXcodeSDK) {
- Attribute: DW_AT_APPLE_sdk
Form: DW_FORM_strp
debug_info:
- Length: 8
Version: 2
AbbrOffset: 0
- Version: 2
AddrSize: 8
Entries:
- AbbrCode: 0x00000001
Values:
- Value: 0x000000000000000C
- Value: 0x0000000000000000
- AbbrCode: 0x00000000
Values: []
...
)";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,7 @@ DWARF:
- LowOffset: 0x0000000000001000
HighOffset: 0x0000000000002000
debug_info:
- Length: 99
Version: 4
AbbrOffset: 0
- Version: 4
AddrSize: 8
Entries:
- AbbrCode: 0x00000001
Expand Down Expand Up @@ -256,5 +254,4 @@ DWARF:
- Value: 0x0000000000002000
- Value: 0x0000000000001000
- AbbrCode: 0x00000000
Values: []
...
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,7 @@ Slices:
- DieOffset: 0x0000006F
Name: char
debug_info:
- Length: 115
Version: 4
AbbrOffset: 0
- Version: 4
AddrSize: 4
Entries:
- AbbrCode: 0x00000001
Expand Down Expand Up @@ -450,7 +448,6 @@ Slices:
- Value: 0x0000000000000001
- Value: 0x0000000000000060
- AbbrCode: 0x00000000
Values: []
- AbbrCode: 0x00000004
Values:
- Value: 0x000000000000004E
Expand All @@ -471,7 +468,6 @@ Slices:
- Value: 0x0000000000000006
- Value: 0x0000000000000001
- AbbrCode: 0x00000000
Values: []
debug_line:
- Length: 55
Version: 4
Expand Down
9 changes: 1 addition & 8 deletions llvm/test/tools/llvm-gsymutil/X86/mach-dwarf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -573,9 +573,7 @@ DWARF:
- DieOffset: 0x000000D8
Name: char
debug_info:
- Length: 220
Version: 4
AbbrOffset: 0
- Version: 4
AddrSize: 8
Entries:
- AbbrCode: 0x00000001
Expand All @@ -601,7 +599,6 @@ DWARF:
BlockData: [ 0x91, 0x7C ]
- Value: 0x0000000000000056
- AbbrCode: 0x00000000
Values: []
- AbbrCode: 0x00000004
Values:
- Value: 0x000000000000003F
Expand All @@ -618,7 +615,6 @@ DWARF:
- Value: 0x0000000000000001
- Value: 0x0000000000000062
- AbbrCode: 0x00000000
Values: []
- AbbrCode: 0x00000006
Values:
- Value: 0x000000000000004D
Expand Down Expand Up @@ -672,9 +668,7 @@ DWARF:
BlockData: [ 0x91, 0x7C ]
- Value: 0x0000000000000056
- AbbrCode: 0x00000000
Values: []
- AbbrCode: 0x00000000
Values: []
- AbbrCode: 0x0000000B
Values:
- Value: 0x00000000000000CE
Expand All @@ -690,7 +684,6 @@ DWARF:
- Value: 0x0000000000000006
- Value: 0x0000000000000001
- AbbrCode: 0x00000000
Values: []
debug_line:
- Length: 102
Version: 4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,7 @@ DWARF:
- Attribute: DW_AT_external
Form: DW_FORM_flag_present
debug_info:
- Length: 113
Version: 4
- Version: 4
AbbrOffset: 0
AddrSize: 8
Entries:
Expand Down Expand Up @@ -459,7 +458,6 @@ DWARF:
- Value: 0x000000000000003F
- Value: 0x0000000000000001
- AbbrCode: 0x00000000
Values: []
debug_line:
- Length: 74
Version: 4
Expand Down
Loading

0 comments on commit 1d01fc1

Please sign in to comment.