Skip to content

Commit 8632931

Browse files
committed
[DWARFYAML] Make the length field of compilation units optional. NFC.
This patch makes the length field of compilation units optional (0 by default).
1 parent 36036aa commit 8632931

File tree

5 files changed

+5
-9
lines changed

5 files changed

+5
-9
lines changed

lldb/unittests/Expression/DWARFExpressionTest.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ TEST(DWARFExpression, DW_OP_convert) {
9494
" - Attribute: DW_AT_byte_size\n"
9595
" Form: DW_FORM_data1\n"
9696
"debug_info:\n"
97-
" - Length: 0\n"
98-
" Version: 4\n"
97+
" - Version: 4\n"
9998
" AbbrOffset: 0\n"
10099
" AddrSize: 8\n"
101100
" Entries:\n"

lldb/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ TEST_F(DWARFASTParserClangTests,
5656
" - Attribute: DW_AT_byte_size\n"
5757
" Form: DW_FORM_data1\n"
5858
"debug_info:\n"
59-
" - Length: 0\n"
60-
" Version: 4\n"
59+
" - Version: 4\n"
6160
" AbbrOffset: 0\n"
6261
" AddrSize: 8\n"
6362
" Entries:\n"

llvm/lib/ObjectYAML/DWARFYAML.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ void MappingTraits<DWARFYAML::PubSection>::mapping(
143143

144144
void MappingTraits<DWARFYAML::Unit>::mapping(IO &IO, DWARFYAML::Unit &Unit) {
145145
IO.mapOptional("Format", Unit.Format, dwarf::DWARF32);
146-
IO.mapRequired("Length", Unit.Length);
146+
IO.mapOptional("Length", Unit.Length, 0);
147147
IO.mapRequired("Version", Unit.Version);
148148
if (Unit.Version >= 5)
149149
IO.mapRequired("UnitType", Unit.Type);

llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -1368,8 +1368,7 @@ TEST(DWARFDebugInfo, TestEmptyChildren) {
13681368
" Children: DW_CHILDREN_yes\n"
13691369
" Attributes:\n"
13701370
"debug_info:\n"
1371-
" - Length: 0\n"
1372-
" Version: 4\n"
1371+
" - Version: 4\n"
13731372
" AbbrOffset: 0\n"
13741373
" AddrSize: 8\n"
13751374
" Entries:\n"

llvm/unittests/DebugInfo/DWARF/DWARFDieTest.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ TEST(DWARFDie, getLocations) {
3434
- Attribute: DW_AT_call_data_location
3535
Form: DW_FORM_sec_offset
3636
debug_info:
37-
- Length: 0
38-
Version: 5
37+
- Version: 5
3938
UnitType: DW_UT_compile
4039
AbbrOffset: 0
4140
AddrSize: 4

0 commit comments

Comments
 (0)