[Lldb-commits] [lldb] 8632931 - [DWARFYAML] Make the length field of compilation units optional. NFC.

2020-07-21 Thread Xing GUO via lldb-commits

Author: Xing GUO
Date: 2020-07-22T12:16:19+08:00
New Revision: 86329317873e46f8bc094b05437a44a1f65c55d6

URL: 
https://github.com/llvm/llvm-project/commit/86329317873e46f8bc094b05437a44a1f65c55d6
DIFF: 
https://github.com/llvm/llvm-project/commit/86329317873e46f8bc094b05437a44a1f65c55d6.diff

LOG: [DWARFYAML] Make the length field of compilation units optional. NFC.

This patch makes the length field of compilation units optional (0 by
default).

Added: 


Modified: 
lldb/unittests/Expression/DWARFExpressionTest.cpp
lldb/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp
llvm/lib/ObjectYAML/DWARFYAML.cpp
llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
llvm/unittests/DebugInfo/DWARF/DWARFDieTest.cpp

Removed: 




diff  --git a/lldb/unittests/Expression/DWARFExpressionTest.cpp 
b/lldb/unittests/Expression/DWARFExpressionTest.cpp
index 78c400c33d4e..ffa3775a6113 100644
--- a/lldb/unittests/Expression/DWARFExpressionTest.cpp
+++ b/lldb/unittests/Expression/DWARFExpressionTest.cpp
@@ -94,8 +94,7 @@ TEST(DWARFExpression, DW_OP_convert) {
   "  - Attribute:   DW_AT_byte_size\n"
   "Form:DW_FORM_data1\n"
   "debug_info:\n"
-  "  - Length:  0\n"
-  "Version: 4\n"
+  "  - Version: 4\n"
   "AbbrOffset:  0\n"
   "AddrSize:8\n"
   "Entries:\n"

diff  --git a/lldb/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp 
b/lldb/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp
index 858aa61b19bb..6b84a21c9d7f 100644
--- a/lldb/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp
+++ b/lldb/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp
@@ -56,8 +56,7 @@ TEST_F(DWARFASTParserClangTests,
   "  - Attribute:   DW_AT_byte_size\n"
   "Form:DW_FORM_data1\n"
   "debug_info:\n"
-  "  - Length:  0\n"
-  "Version: 4\n"
+  "  - Version: 4\n"
   "AbbrOffset:  0\n"
   "AddrSize:8\n"
   "Entries:\n"

diff  --git a/llvm/lib/ObjectYAML/DWARFYAML.cpp 
b/llvm/lib/ObjectYAML/DWARFYAML.cpp
index 4cef29a6b428..11eb5779da0e 100644
--- a/llvm/lib/ObjectYAML/DWARFYAML.cpp
+++ b/llvm/lib/ObjectYAML/DWARFYAML.cpp
@@ -143,7 +143,7 @@ void MappingTraits::mapping(
 
 void MappingTraits::mapping(IO &IO, DWARFYAML::Unit &Unit) {
   IO.mapOptional("Format", Unit.Format, dwarf::DWARF32);
-  IO.mapRequired("Length", Unit.Length);
+  IO.mapOptional("Length", Unit.Length, 0);
   IO.mapRequired("Version", Unit.Version);
   if (Unit.Version >= 5)
 IO.mapRequired("UnitType", Unit.Type);

diff  --git a/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp 
b/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
index 6825981de0c3..459d68b57d8b 100644
--- a/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
+++ b/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
@@ -1368,8 +1368,7 @@ TEST(DWARFDebugInfo, TestEmptyChildren) {
  "Children:DW_CHILDREN_yes\n"
  "Attributes:\n"
  "debug_info:\n"
- "  - Length:  0\n"
- "Version: 4\n"
+ "  - Version: 4\n"
  "AbbrOffset:  0\n"
  "AddrSize:8\n"
  "Entries:\n"

diff  --git a/llvm/unittests/DebugInfo/DWARF/DWARFDieTest.cpp 
b/llvm/unittests/DebugInfo/DWARF/DWARFDieTest.cpp
index 983f0624939a..d87f68e2f740 100644
--- a/llvm/unittests/DebugInfo/DWARF/DWARFDieTest.cpp
+++ b/llvm/unittests/DebugInfo/DWARF/DWARFDieTest.cpp
@@ -34,8 +34,7 @@ TEST(DWARFDie, getLocations) {
   - Attribute:   DW_AT_call_data_location
 Form:DW_FORM_sec_offset
 debug_info:
-  - Length:  0
-Version: 5
+  - Version: 5
 UnitType:DW_UT_compile
 AbbrOffset:  0
 AddrSize:4



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 92874d2 - [DWARFYAML] Refactor emitDebugInfo() to make the length be inferred.

2020-07-23 Thread Xing GUO via lldb-commits

Author: Xing GUO
Date: 2020-07-23T23:00:19+08:00
New Revision: 92874d286695d2233a3fc526b07896c3676ec1d3

URL: 
https://github.com/llvm/llvm-project/commit/92874d286695d2233a3fc526b07896c3676ec1d3
DIFF: 
https://github.com/llvm/llvm-project/commit/92874d286695d2233a3fc526b07896c3676ec1d3.diff

LOG: [DWARFYAML] Refactor emitDebugInfo() to make the length be inferred.

This patch refactors `emitDebugInfo()` to make the length field be
inferred from its content. Besides, the `Visitor` class is removed in
this patch. The original `Visitor` class helps us determine an
appropriate length and emit the .debug_info section. These two
processes can be merged into one process. Besides, the length field
should be inferred when it's missing rather than when it's zero.

Reviewed By: jhenderson, labath

Differential Revision: https://reviews.llvm.org/D84008

Added: 


Modified: 
lldb/unittests/TestingSupport/Symbol/YAMLModuleTester.cpp
llvm/include/llvm/ObjectYAML/DWARFEmitter.h
llvm/include/llvm/ObjectYAML/DWARFYAML.h
llvm/lib/ObjectYAML/CMakeLists.txt
llvm/lib/ObjectYAML/DWARFEmitter.cpp
llvm/lib/ObjectYAML/DWARFYAML.cpp
llvm/test/tools/yaml2obj/ELF/DWARF/debug-info.yaml
llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
llvm/unittests/DebugInfo/DWARF/DWARFDieTest.cpp

Removed: 
llvm/lib/ObjectYAML/DWARFVisitor.cpp
llvm/lib/ObjectYAML/DWARFVisitor.h



diff  --git a/lldb/unittests/TestingSupport/Symbol/YAMLModuleTester.cpp 
b/lldb/unittests/TestingSupport/Symbol/YAMLModuleTester.cpp
index 54c2c9441e57..248e87825ac9 100644
--- a/lldb/unittests/TestingSupport/Symbol/YAMLModuleTester.cpp
+++ b/lldb/unittests/TestingSupport/Symbol/YAMLModuleTester.cpp
@@ -93,7 +93,7 @@ class YAMLObjectFile : public lldb_private::ObjectFile {
 
 YAMLModuleTester::YAMLModuleTester(llvm::StringRef yaml_data,
llvm::StringRef triple) {
-  auto sections_map = llvm::DWARFYAML::emitDebugSections(yaml_data, true);
+  auto sections_map = llvm::DWARFYAML::emitDebugSections(yaml_data);
   if (!sections_map)
 return;
   m_sections_map = std::move(*sections_map);

diff  --git a/llvm/include/llvm/ObjectYAML/DWARFEmitter.h 
b/llvm/include/llvm/ObjectYAML/DWARFEmitter.h
index ff07ddaca951..5837c69ed59f 100644
--- a/llvm/include/llvm/ObjectYAML/DWARFEmitter.h
+++ b/llvm/include/llvm/ObjectYAML/DWARFEmitter.h
@@ -42,7 +42,7 @@ Error emitDebugStrOffsets(raw_ostream &OS, const Data &DI);
 Error emitDebugRnglists(raw_ostream &OS, const Data &DI);
 
 Expected>>
-emitDebugSections(StringRef YAMLString, bool ApplyFixups = false,
+emitDebugSections(StringRef YAMLString,
   bool IsLittleEndian = sys::IsLittleEndianHost);
 } // end namespace DWARFYAML
 } // end namespace llvm

diff  --git a/llvm/include/llvm/ObjectYAML/DWARFYAML.h 
b/llvm/include/llvm/ObjectYAML/DWARFYAML.h
index 5eff3038131f..1427332fafe0 100644
--- a/llvm/include/llvm/ObjectYAML/DWARFYAML.h
+++ b/llvm/include/llvm/ObjectYAML/DWARFYAML.h
@@ -120,7 +120,7 @@ struct DWARFContext {
 
 struct Unit {
   dwarf::DwarfFormat Format;
-  yaml::Hex64 Length;
+  Optional Length;
   uint16_t Version;
   llvm::dwarf::UnitType Type; // Added in DWARF 5
   yaml::Hex64 AbbrOffset;

diff  --git a/llvm/lib/ObjectYAML/CMakeLists.txt 
b/llvm/lib/ObjectYAML/CMakeLists.txt
index bc014c1caca3..92ea1ec9866c 100644
--- a/llvm/lib/ObjectYAML/CMakeLists.txt
+++ b/llvm/lib/ObjectYAML/CMakeLists.txt
@@ -6,7 +6,6 @@ add_llvm_component_library(LLVMObjectYAML
   COFFEmitter.cpp
   COFFYAML.cpp
   DWARFEmitter.cpp
-  DWARFVisitor.cpp
   DWARFYAML.cpp
   ELFEmitter.cpp
   ELFYAML.cpp

diff  --git a/llvm/lib/ObjectYAML/DWARFEmitter.cpp 
b/llvm/lib/ObjectYAML/DWARFEmitter.cpp
index 3012813ced39..81113c48432c 100644
--- a/llvm/lib/ObjectYAML/DWARFEmitter.cpp
+++ b/llvm/lib/ObjectYAML/DWARFEmitter.cpp
@@ -12,7 +12,6 @@
 
//===--===//
 
 #include "llvm/ObjectYAML/DWARFEmitter.h"
-#include "DWARFVisitor.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringRef.h"
@@ -205,79 +204,194 @@ Error DWARFYAML::emitPubSection(raw_ostream &OS,
   return Error::success();
 }
 
-namespace {
-/// An extension of the DWARFYAML::ConstVisitor which writes compile
-/// units and DIEs to a stream.
-class DumpVisitor : public DWARFYAML::ConstVisitor {
-  raw_ostream &OS;
-
-protected:
-  void onStartCompileUnit(const DWARFYAML::Unit &CU) override {
-writeInitialLength(CU.Format, CU.Length, OS, DebugInfo.IsLittleEndian);
-writeInteger((uint16_t)CU.Version, OS, DebugInfo.IsLittleEndian);
-if (CU.Version >= 5) {
-  writeInteger((uint8_t)CU.Type, OS, DebugInfo.IsLittleEndian);
-  writeInteger((uint8_t)CU.AddrSize, OS, DebugInfo.IsLittleEndian);
-  cantFail(writeVariableSizedInteger(CU.AbbrOffset,
- CU.Format =

[Lldb-commits] [lldb] 1d01fc1 - [Test] Simplify DWARF test cases. NFC.

2020-08-30 Thread Xing GUO via lldb-commits

Author: Xing GUO
Date: 2020-08-31T14:03:48+08:00
New Revision: 1d01fc100bb5bef5f5eaf92520b2e52f64ee1d6e

URL: 
https://github.com/llvm/llvm-project/commit/1d01fc100bb5bef5f5eaf92520b2e52f64ee1d6e
DIFF: 
https://github.com/llvm/llvm-project/commit/1d01fc100bb5bef5f5eaf92520b2e52f64ee1d6e.diff

LOG: [Test] Simplify DWARF test cases. NFC.

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

Added: 


Modified: 
lldb/test/API/functionalities/source-map/a.yaml
lldb/unittests/Expression/DWARFExpressionTest.cpp
lldb/unittests/Symbol/Inputs/inlined-functions.yaml
lldb/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp
lldb/unittests/SymbolFile/DWARF/XcodeSDKModuleTests.cpp
llvm/test/tools/llvm-dwarfdump/X86/verify_overlapping_cu_ranges.yaml
llvm/test/tools/llvm-gsymutil/ARM_AArch64/fat-macho-dwarf.yaml
llvm/test/tools/llvm-gsymutil/X86/mach-dwarf.yaml
llvm/test/tools/llvm-objcopy/MachO/Inputs/strip-all-with-dwarf.yaml
llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
llvm/unittests/DebugInfo/DWARF/DWARFDieTest.cpp
llvm/unittests/DebugInfo/GSYM/GSYMTest.cpp

Removed: 




diff  --git a/lldb/test/API/functionalities/source-map/a.yaml 
b/lldb/test/API/functionalities/source-map/a.yaml
index 477f0bd7b9da..53a07ea7443c 100644
--- a/lldb/test/API/functionalities/source-map/a.yaml
+++ b/lldb/test/API/functionalities/source-map/a.yaml
@@ -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:0x0001
@@ -345,7 +343,6 @@ DWARF:
 - Value:   0x0001
 - Value:   0x0067
 - AbbrCode:0x
-  Values:  []
 - AbbrCode:0x0004
   Values:  
 - Value:   0x0059
@@ -366,7 +363,6 @@ DWARF:
 - Value:   0x0006
 - Value:   0x0001
 - AbbrCode:0x
-  Values:  []
   debug_line:  
 - Length:  68
   Version: 4

diff  --git a/lldb/unittests/Expression/DWARFExpressionTest.cpp 
b/lldb/unittests/Expression/DWARFExpressionTest.cpp
index 7c1f2ef8a764..c02de402b4dd 100644
--- a/lldb/unittests/Expression/DWARFExpressionTest.cpp
+++ b/lldb/unittests/Expression/DWARFExpressionTest.cpp
@@ -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:0x0001\n"
@@ -132,9 +131,7 @@ TEST(DWARFExpression, DW_OP_convert) {
   "Values:\n"
   "  - Value:   0x000b\n" // 
DW_ATE_numeric_string
   "  - Value:   0x0001\n"
-  ""
-  "  - AbbrCode:0x\n"
-  "Values:  []\n";
+  "  - AbbrCode:0x\n";
   uint8_t offs_uint32_t = 0x000e;
   uint8_t offs_uint64_t = 0x0011;
   uint8_t offs_sint64_t = 0x0014;

diff  --git a/lldb/unittests/Symbol/Inputs/inlined-functions.yaml 
b/lldb/unittests/Symbol/Inputs/inlined-functions.yaml
index 0443fcca58f1..050ee869d3c0 100644
--- a/lldb/unittests/Symbol/Inputs/inlined-functions.yaml
+++ b/lldb/unittests/Symbol/Inputs/inlined-functions.yaml
@@ -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:0x0001
@@ -411,7 +409,6 @@ DWARF:
 - Value:   0x0007
 - Value:   0x00B2
 - AbbrCode:0x
-  Values:  []
 - AbbrCode:0x0005
   Values:  
 - Value:   0x0094
@@ -440,7 +437,6 @@ DWARF:
 - Value:   0x0002
 - Value:   0x00B2
 - AbbrCode:0x
-  Values:  []
 - AbbrCode:0x0008
   Values:  
 - Value:   0x00A3
@@ -486,7 +482,6 @@ DWARF:
 - Value:   0x000C
 - Value:   0x

[Lldb-commits] [lldb] 2d35092 - [DWARFYAML] Make the include_directories, file_names and opcodes fields of the line table optional.

2020-09-18 Thread Xing GUO via lldb-commits

Author: Xing GUO
Date: 2020-09-18T20:21:11+08:00
New Revision: 2d35092cd2589dffbca1e34a3dc68f6df75818a9

URL: 
https://github.com/llvm/llvm-project/commit/2d35092cd2589dffbca1e34a3dc68f6df75818a9
DIFF: 
https://github.com/llvm/llvm-project/commit/2d35092cd2589dffbca1e34a3dc68f6df75818a9.diff

LOG: [DWARFYAML] Make the include_directories, file_names and opcodes fields of 
the line table optional.

This patch makes the include_directories, file_names and opcodes fields
of the line table optional. This helps us simplify some tests.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D87878

Added: 


Modified: 
lldb/unittests/Symbol/Inputs/inlined-functions.yaml
llvm/lib/ObjectYAML/DWARFYAML.cpp
llvm/test/ObjectYAML/MachO/DWARF-debug_info.yaml
llvm/test/ObjectYAML/MachO/DWARF-debug_line.yaml
llvm/test/ObjectYAML/MachO/DWARF5-debug_info.yaml
llvm/test/tools/llvm-dwarfdump/X86/verify_attr_file_indexes.yaml
llvm/test/tools/llvm-dwarfdump/X86/verify_attr_file_indexes_no_files.yaml
llvm/test/tools/llvm-gsymutil/ARM_AArch64/fat-macho-dwarf.yaml
llvm/test/tools/llvm-gsymutil/X86/mach-dwarf.yaml
llvm/test/tools/llvm-objcopy/MachO/Inputs/strip-all-with-dwarf.yaml
llvm/test/tools/yaml2obj/ELF/DWARF/debug-line.yaml

Removed: 




diff  --git a/lldb/unittests/Symbol/Inputs/inlined-functions.yaml 
b/lldb/unittests/Symbol/Inputs/inlined-functions.yaml
index 050ee869d3c0..8498cf7f6d31 100644
--- a/lldb/unittests/Symbol/Inputs/inlined-functions.yaml
+++ b/lldb/unittests/Symbol/Inputs/inlined-functions.yaml
@@ -711,7 +711,6 @@ DWARF:
   LineRange:   14
   OpcodeBase:  13
   StandardOpcodeLengths: [ 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 ]
-  IncludeDirs: []
   Files:   
 - Name:inlined-functions.cpp
   DirIdx:  0

diff  --git a/llvm/lib/ObjectYAML/DWARFYAML.cpp 
b/llvm/lib/ObjectYAML/DWARFYAML.cpp
index 975b9b40b6b1..067423e2e7a2 100644
--- a/llvm/lib/ObjectYAML/DWARFYAML.cpp
+++ b/llvm/lib/ObjectYAML/DWARFYAML.cpp
@@ -246,9 +246,9 @@ void MappingTraits::mapping(
   IO.mapRequired("LineRange", LineTable.LineRange);
   IO.mapRequired("OpcodeBase", LineTable.OpcodeBase);
   IO.mapRequired("StandardOpcodeLengths", LineTable.StandardOpcodeLengths);
-  IO.mapRequired("IncludeDirs", LineTable.IncludeDirs);
-  IO.mapRequired("Files", LineTable.Files);
-  IO.mapRequired("Opcodes", LineTable.Opcodes);
+  IO.mapOptional("IncludeDirs", LineTable.IncludeDirs);
+  IO.mapOptional("Files", LineTable.Files);
+  IO.mapOptional("Opcodes", LineTable.Opcodes);
 }
 
 void MappingTraits::mapping(

diff  --git a/llvm/test/ObjectYAML/MachO/DWARF-debug_info.yaml 
b/llvm/test/ObjectYAML/MachO/DWARF-debug_info.yaml
index 7b9d5fa19894..d6bcaf0d754b 100644
--- a/llvm/test/ObjectYAML/MachO/DWARF-debug_info.yaml
+++ b/llvm/test/ObjectYAML/MachO/DWARF-debug_info.yaml
@@ -478,7 +478,6 @@ DWARF:
 - 0
 - 0
 - 1
-  IncludeDirs: 
   Files:   
 - Name:hello_world.c
   DirIdx:  0

diff  --git a/llvm/test/ObjectYAML/MachO/DWARF-debug_line.yaml 
b/llvm/test/ObjectYAML/MachO/DWARF-debug_line.yaml
index 6643e2d5f75a..6ac577f9c83a 100644
--- a/llvm/test/ObjectYAML/MachO/DWARF-debug_line.yaml
+++ b/llvm/test/ObjectYAML/MachO/DWARF-debug_line.yaml
@@ -499,7 +499,6 @@ DWARF:
   LineRange:   14
   OpcodeBase:  13
   StandardOpcodeLengths: [ 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 ]
-  IncludeDirs: 
   Files:   
 - Name:hello_world.c
   DirIdx:  0
@@ -540,7 +539,6 @@ DWARF:
 # CHECK-NEXT: LineRange:   14
 # CHECK-NEXT: OpcodeBase:  13
 # CHECK-NEXT: StandardOpcodeLengths: [ 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 ]
-# CHECK-NEXT: IncludeDirs:
 # CHECK-NEXT: Files:
 # CHECK-NEXT:   - Name:hello_world.c
 # CHECK-NEXT: DirIdx:  0

diff  --git a/llvm/test/ObjectYAML/MachO/DWARF5-debug_info.yaml 
b/llvm/test/ObjectYAML/MachO/DWARF5-debug_info.yaml
index d016b8c485ee..e0f82e862c8b 100644
--- a/llvm/test/ObjectYAML/MachO/DWARF5-debug_info.yaml
+++ b/llvm/test/ObjectYAML/MachO/DWARF5-debug_info.yaml
@@ -479,7 +479,6 @@ DWARF:
 - 0
 - 0
 - 1
-  IncludeDirs: 
   Files:   
 - Name:hello_world.c
   DirIdx:  0

diff  --git a/llvm/test/tools/llvm-dwarfdump/X86/verify_attr_file_indexes.yaml 
b/llvm/test/tools/llvm-dwarfdump/X86/verify_attr_file_indexes.yaml
index 19d9a6943589..3e1e1ee2e00d 100644
--- a/llvm/test/tools/llvm-dwarfdump/X86/verify_attr_file_indexes.yaml
+++ b/llvm/test/tools/llvm-dwarfdump/X86/verify_attr_file_indexes.yaml
@@ -118,5 +118,4 @@ DWARF:
   DirIdx:  1
   ModTime: 0
   Length:  0
-  Opcodes: []
 ...

d

[Lldb-commits] [lldb] 0431e4b - Recommit "[DWARFYAML][debug_line] Replace `InitialLength` with `Format` and `Length`."

2020-06-13 Thread Xing GUO via lldb-commits

Author: Xing GUO
Date: 2020-06-13T23:39:11+08:00
New Revision: 0431e4bcb27bba30156ac49be4c09ac632c5a03a

URL: 
https://github.com/llvm/llvm-project/commit/0431e4bcb27bba30156ac49be4c09ac632c5a03a
DIFF: 
https://github.com/llvm/llvm-project/commit/0431e4bcb27bba30156ac49be4c09ac632c5a03a.diff

LOG: Recommit "[DWARFYAML][debug_line] Replace `InitialLength` with `Format` 
and `Length`."

This recommits fcc0c186e9cea0af644581069058f0e00469d20e

Added: 


Modified: 
lldb/unittests/Symbol/Inputs/inlined-functions.yaml
llvm/include/llvm/ObjectYAML/DWARFYAML.h
llvm/lib/ObjectYAML/DWARFEmitter.cpp
llvm/lib/ObjectYAML/DWARFYAML.cpp
llvm/test/ObjectYAML/MachO/DWARF-debug_info.yaml
llvm/test/ObjectYAML/MachO/DWARF-debug_line.yaml
llvm/test/ObjectYAML/MachO/DWARF5-debug_info.yaml
llvm/test/tools/llvm-gsymutil/ARM_AArch64/fat-macho-dwarf.yaml
llvm/test/tools/llvm-gsymutil/X86/mach-dwarf.yaml
llvm/test/tools/llvm-objcopy/MachO/Inputs/strip-all-with-dwarf.yaml
llvm/test/tools/yaml2obj/ELF/DWARF/debug-line.yaml
llvm/tools/obj2yaml/dwarf2yaml.cpp
llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
llvm/unittests/DebugInfo/GSYM/GSYMTest.cpp

Removed: 




diff  --git a/lldb/unittests/Symbol/Inputs/inlined-functions.yaml 
b/lldb/unittests/Symbol/Inputs/inlined-functions.yaml
index 16e437c48bf9..14573da3498d 100644
--- a/lldb/unittests/Symbol/Inputs/inlined-functions.yaml
+++ b/lldb/unittests/Symbol/Inputs/inlined-functions.yaml
@@ -713,8 +713,7 @@ DWARF:
 - AbbrCode:0x
   Values:  []
   debug_line:  
-- Length:  
-TotalLength: 202
+- Length:  202
   Version: 4
   PrologueLength:  45
   MinInstLength:   1

diff  --git a/llvm/include/llvm/ObjectYAML/DWARFYAML.h 
b/llvm/include/llvm/ObjectYAML/DWARFYAML.h
index 2f355b2a5b59..08b02691ffc1 100644
--- a/llvm/include/llvm/ObjectYAML/DWARFYAML.h
+++ b/llvm/include/llvm/ObjectYAML/DWARFYAML.h
@@ -144,7 +144,8 @@ struct LineTableOpcode {
 };
 
 struct LineTable {
-  InitialLength Length;
+  dwarf::DwarfFormat Format;
+  uint64_t Length;
   uint16_t Version;
   uint64_t PrologueLength;
   uint8_t MinInstLength;

diff  --git a/llvm/lib/ObjectYAML/DWARFEmitter.cpp 
b/llvm/lib/ObjectYAML/DWARFEmitter.cpp
index b496e2a09386..9ab6aa5aeafc 100644
--- a/llvm/lib/ObjectYAML/DWARFEmitter.cpp
+++ b/llvm/lib/ObjectYAML/DWARFEmitter.cpp
@@ -262,8 +262,9 @@ static void emitFileEntry(raw_ostream &OS, const 
DWARFYAML::File &File) {
 
 Error DWARFYAML::emitDebugLine(raw_ostream &OS, const DWARFYAML::Data &DI) {
   for (const auto &LineTable : DI.DebugLines) {
-writeInitialLength(LineTable.Length, OS, DI.IsLittleEndian);
-uint64_t SizeOfPrologueLength = LineTable.Length.isDWARF64() ? 8 : 4;
+writeInitialLength(LineTable.Format, LineTable.Length, OS,
+   DI.IsLittleEndian);
+uint64_t SizeOfPrologueLength = LineTable.Format == dwarf::DWARF64 ? 8 : 4;
 writeInteger((uint16_t)LineTable.Version, OS, DI.IsLittleEndian);
 writeVariableSizedInteger(LineTable.PrologueLength, SizeOfPrologueLength,
   OS, DI.IsLittleEndian);

diff  --git a/llvm/lib/ObjectYAML/DWARFYAML.cpp 
b/llvm/lib/ObjectYAML/DWARFYAML.cpp
index 257db357ca73..8298047d8be9 100644
--- a/llvm/lib/ObjectYAML/DWARFYAML.cpp
+++ b/llvm/lib/ObjectYAML/DWARFYAML.cpp
@@ -175,6 +175,7 @@ void MappingTraits::mapping(
 
 void MappingTraits::mapping(
 IO &IO, DWARFYAML::LineTable &LineTable) {
+  IO.mapOptional("Format", LineTable.Format, dwarf::DWARF32);
   IO.mapRequired("Length", LineTable.Length);
   IO.mapRequired("Version", LineTable.Version);
   IO.mapRequired("PrologueLength", LineTable.PrologueLength);

diff  --git a/llvm/test/ObjectYAML/MachO/DWARF-debug_info.yaml 
b/llvm/test/ObjectYAML/MachO/DWARF-debug_info.yaml
index 95f3eae597c2..af997b010b2d 100644
--- a/llvm/test/ObjectYAML/MachO/DWARF-debug_info.yaml
+++ b/llvm/test/ObjectYAML/MachO/DWARF-debug_info.yaml
@@ -453,8 +453,7 @@ DWARF:
 - AbbrCode:0x
   Values:  
   debug_line:  
-- Length:  
-TotalLength: 65
+- Length:  65
   Version: 2
   PrologueLength:  36
   MinInstLength:   1

diff  --git a/llvm/test/ObjectYAML/MachO/DWARF-debug_line.yaml 
b/llvm/test/ObjectYAML/MachO/DWARF-debug_line.yaml
index 5d17deb2fac2..d24fe7c8a4b8 100644
--- a/llvm/test/ObjectYAML/MachO/DWARF-debug_line.yaml
+++ b/llvm/test/ObjectYAML/MachO/DWARF-debug_line.yaml
@@ -492,8 +492,7 @@ DWARF:
 - AbbrCode:0x
   Values:  
   debug_line:  
-- Length:  
-TotalLength: 65
+- Length:  65
   Version: 2
   PrologueLength:  36
   MinInstLength:   1
@@ -534,8 +533,7 @@ DWARF:
 ...
 
 #CHECK:   debug_line:  
-#CH

[Lldb-commits] [lldb] 8a2ff19 - [lldb][test] Trying to fix build bot after 0431e4bcb27bba30156ac49be4c09ac632c5a03a

2020-06-13 Thread Xing GUO via lldb-commits

Author: Xing GUO
Date: 2020-06-13T23:53:13+08:00
New Revision: 8a2ff19272051cfd0ff906eafaee5372773bdbc7

URL: 
https://github.com/llvm/llvm-project/commit/8a2ff19272051cfd0ff906eafaee5372773bdbc7
DIFF: 
https://github.com/llvm/llvm-project/commit/8a2ff19272051cfd0ff906eafaee5372773bdbc7.diff

LOG: [lldb][test] Trying to fix build bot after 
0431e4bcb27bba30156ac49be4c09ac632c5a03a

Added: 


Modified: 
lldb/test/API/functionalities/source-map/a.yaml

Removed: 




diff  --git a/lldb/test/API/functionalities/source-map/a.yaml 
b/lldb/test/API/functionalities/source-map/a.yaml
index d14e9a3b8329..08fd9895d912 100644
--- a/lldb/test/API/functionalities/source-map/a.yaml
+++ b/lldb/test/API/functionalities/source-map/a.yaml
@@ -368,8 +368,7 @@ DWARF:
 - AbbrCode:0x
   Values:  []
   debug_line:  
-- Length:  
-TotalLength: 68
+- Length:  68
   Version: 4
   PrologueLength:  40
   MinInstLength:   1



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] fe08ab5 - [DWARFYAML][debug_info] Replace 'InitialLength' with 'Format' and 'Length'.

2020-06-30 Thread Xing GUO via lldb-commits

Author: Xing GUO
Date: 2020-06-30T16:28:39+08:00
New Revision: fe08ab542bd6328a7906e38ae473cf655eb6a228

URL: 
https://github.com/llvm/llvm-project/commit/fe08ab542bd6328a7906e38ae473cf655eb6a228
DIFF: 
https://github.com/llvm/llvm-project/commit/fe08ab542bd6328a7906e38ae473cf655eb6a228.diff

LOG: [DWARFYAML][debug_info] Replace 'InitialLength' with 'Format' and 'Length'.

'InitialLength' is replaced with 'Format' (DWARF32 by default) and 'Length' in 
this patch.
Besides, test cases for DWARFv4 and DWARFv5, DWARF32 and DWARF64 is
added.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D82622

Added: 


Modified: 
lldb/test/API/functionalities/source-map/a.yaml
lldb/unittests/Expression/DWARFExpressionTest.cpp
lldb/unittests/Symbol/Inputs/inlined-functions.yaml
lldb/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp
llvm/include/llvm/ObjectYAML/DWARFYAML.h
llvm/lib/ObjectYAML/DWARFEmitter.cpp
llvm/lib/ObjectYAML/DWARFVisitor.cpp
llvm/lib/ObjectYAML/DWARFYAML.cpp
llvm/test/ObjectYAML/MachO/DWARF-debug_info.yaml
llvm/test/ObjectYAML/MachO/DWARF-debug_line.yaml
llvm/test/ObjectYAML/MachO/DWARF-debug_ranges.yaml
llvm/test/ObjectYAML/MachO/DWARF2-AddrSize8-FormValues.yaml
llvm/test/ObjectYAML/MachO/DWARF5-debug_info.yaml
llvm/test/tools/llvm-dwarfdump/X86/verify_overlapping_cu_ranges.yaml
llvm/test/tools/llvm-gsymutil/ARM_AArch64/fat-macho-dwarf.yaml
llvm/test/tools/llvm-gsymutil/X86/mach-dwarf.yaml
llvm/test/tools/llvm-objcopy/MachO/Inputs/strip-all-with-dwarf.yaml
llvm/test/tools/yaml2obj/ELF/DWARF/debug-info.yaml
llvm/tools/obj2yaml/dwarf2yaml.cpp
llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
llvm/unittests/DebugInfo/DWARF/DWARFDieTest.cpp
llvm/unittests/DebugInfo/GSYM/GSYMTest.cpp

Removed: 




diff  --git a/lldb/test/API/functionalities/source-map/a.yaml 
b/lldb/test/API/functionalities/source-map/a.yaml
index 08fd9895d912..cf2fe7b75c4e 100644
--- a/lldb/test/API/functionalities/source-map/a.yaml
+++ b/lldb/test/API/functionalities/source-map/a.yaml
@@ -296,8 +296,7 @@ DWARF:
 - Attribute:   DW_AT_type
   Form:DW_FORM_ref4
   debug_info:  
-- Length:  
-TotalLength: 122
+- Length:  122
   Version: 4
   AbbrOffset:  0
   AddrSize:8

diff  --git a/lldb/unittests/Expression/DWARFExpressionTest.cpp 
b/lldb/unittests/Expression/DWARFExpressionTest.cpp
index 572c585c6bfd..78c400c33d4e 100644
--- a/lldb/unittests/Expression/DWARFExpressionTest.cpp
+++ b/lldb/unittests/Expression/DWARFExpressionTest.cpp
@@ -94,8 +94,7 @@ TEST(DWARFExpression, DW_OP_convert) {
   "  - Attribute:   DW_AT_byte_size\n"
   "Form:DW_FORM_data1\n"
   "debug_info:\n"
-  "  - Length:\n"
-  "  TotalLength: 0\n"
+  "  - Length:  0\n"
   "Version: 4\n"
   "AbbrOffset:  0\n"
   "AddrSize:8\n"

diff  --git a/lldb/unittests/Symbol/Inputs/inlined-functions.yaml 
b/lldb/unittests/Symbol/Inputs/inlined-functions.yaml
index 14573da3498d..8ce92115a0b5 100644
--- a/lldb/unittests/Symbol/Inputs/inlined-functions.yaml
+++ b/lldb/unittests/Symbol/Inputs/inlined-functions.yaml
@@ -342,8 +342,7 @@ DWARF:
 - Attribute:   DW_AT_type
   Form:DW_FORM_ref4
   debug_info:  
-- Length:  
-TotalLength: 579
+- Length:  579
   Version: 4
   AbbrOffset:  0
   AddrSize:8

diff  --git a/lldb/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp 
b/lldb/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp
index 44251e944df6..858aa61b19bb 100644
--- a/lldb/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp
+++ b/lldb/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp
@@ -56,8 +56,7 @@ TEST_F(DWARFASTParserClangTests,
   "  - Attribute:   DW_AT_byte_size\n"
   "Form:DW_FORM_data1\n"
   "debug_info:\n"
-  "  - Length:\n"
-  "  TotalLength: 0\n"
+  "  - Length:  0\n"
   "Version: 4\n"
   "AbbrOffset:  0\n"
   "AddrSize:8\n"

diff  --git a/llvm/include/llvm/ObjectYAML/DWARFYAML.h 
b/llvm/include/llvm/ObjectYAML/DWARFYAML.h
index 73965dc6d570..a492972082ee 100644
--- a/llvm/include/llvm/ObjectYAML/DWARFYAML.h
+++ b/llvm/include/llvm/ObjectYAML/DWARFYAML.h
@@ -117,7 +117,8 @@ struct Entry {
 };
 
 struct Unit {
-  InitialLength Length;
+  dwarf::DwarfFormat Format;
+  uint64_t Length;
   uint16_t Version;
   llvm::dwarf::UnitType Type; // Added in DWARF 5
   yaml::Hex64 AbbrOffset;

diff  --git a/llvm/lib/ObjectYAML/DWARFEmitter.cpp 
b/llvm/lib/ObjectYAML/DWARFEmitter.cpp
index 7f8de2c2f30b..67509ba52cf4 100644
--- a/llvm/lib/O