diff --git a/lldb/test/API/functionalities/source-map/a.yaml b/lldb/test/API/functionalities/source-map/a.yaml --- a/lldb/test/API/functionalities/source-map/a.yaml +++ b/lldb/test/API/functionalities/source-map/a.yaml @@ -218,83 +218,84 @@ - argc - argv - char - debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_producer - Form: DW_FORM_strp - - Attribute: DW_AT_language - Form: DW_FORM_data2 - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_stmt_list - Form: DW_FORM_sec_offset - - Attribute: DW_AT_comp_dir - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Code: 0x00000002 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Attribute: DW_AT_frame_base - Form: DW_FORM_exprloc - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_decl_line - Form: DW_FORM_data1 - - Attribute: DW_AT_prototyped - Form: DW_FORM_flag_present - - Attribute: DW_AT_type - Form: DW_FORM_ref4 - - Attribute: DW_AT_external - Form: DW_FORM_flag_present - - Code: 0x00000003 - Tag: DW_TAG_formal_parameter - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_location - Form: DW_FORM_exprloc - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_decl_line - Form: DW_FORM_data1 - - Attribute: DW_AT_type - Form: DW_FORM_ref4 - - Code: 0x00000004 - Tag: DW_TAG_base_type - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_encoding - Form: DW_FORM_data1 - - Attribute: DW_AT_byte_size - Form: DW_FORM_data1 - - Code: 0x00000005 - Tag: DW_TAG_pointer_type - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_type - Form: DW_FORM_ref4 - - Code: 0x00000006 - Tag: DW_TAG_const_type - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_type - Form: DW_FORM_ref4 + debug_abbrev: + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_producer + Form: DW_FORM_strp + - Attribute: DW_AT_language + Form: DW_FORM_data2 + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_stmt_list + Form: DW_FORM_sec_offset + - Attribute: DW_AT_comp_dir + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Code: 0x00000002 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Attribute: DW_AT_frame_base + Form: DW_FORM_exprloc + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_decl_file + Form: DW_FORM_data1 + - Attribute: DW_AT_decl_line + Form: DW_FORM_data1 + - Attribute: DW_AT_prototyped + Form: DW_FORM_flag_present + - Attribute: DW_AT_type + Form: DW_FORM_ref4 + - Attribute: DW_AT_external + Form: DW_FORM_flag_present + - Code: 0x00000003 + Tag: DW_TAG_formal_parameter + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_location + Form: DW_FORM_exprloc + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_decl_file + Form: DW_FORM_data1 + - Attribute: DW_AT_decl_line + Form: DW_FORM_data1 + - Attribute: DW_AT_type + Form: DW_FORM_ref4 + - Code: 0x00000004 + Tag: DW_TAG_base_type + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_encoding + Form: DW_FORM_data1 + - Attribute: DW_AT_byte_size + Form: DW_FORM_data1 + - Code: 0x00000005 + Tag: DW_TAG_pointer_type + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_type + Form: DW_FORM_ref4 + - Code: 0x00000006 + Tag: DW_TAG_const_type + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_type + Form: DW_FORM_ref4 debug_info: - Length: 122 Version: 4 diff --git a/lldb/unittests/Expression/DWARFExpressionTest.cpp b/lldb/unittests/Expression/DWARFExpressionTest.cpp --- a/lldb/unittests/Expression/DWARFExpressionTest.cpp +++ b/lldb/unittests/Expression/DWARFExpressionTest.cpp @@ -79,20 +79,21 @@ /// Auxiliary debug info. const char *yamldata = "debug_abbrev:\n" - " - Code: 0x00000001\n" - " Tag: DW_TAG_compile_unit\n" - " Children: DW_CHILDREN_yes\n" - " Attributes:\n" - " - Attribute: DW_AT_language\n" - " Form: DW_FORM_data2\n" - " - Code: 0x00000002\n" - " Tag: DW_TAG_base_type\n" - " Children: DW_CHILDREN_no\n" - " Attributes:\n" - " - Attribute: DW_AT_encoding\n" - " Form: DW_FORM_data1\n" - " - Attribute: DW_AT_byte_size\n" - " Form: DW_FORM_data1\n" + " - Table:\n" + " - Code: 0x00000001\n" + " Tag: DW_TAG_compile_unit\n" + " Children: DW_CHILDREN_yes\n" + " Attributes:\n" + " - Attribute: DW_AT_language\n" + " Form: DW_FORM_data2\n" + " - Code: 0x00000002\n" + " Tag: DW_TAG_base_type\n" + " Children: DW_CHILDREN_no\n" + " Attributes:\n" + " - Attribute: DW_AT_encoding\n" + " Form: DW_FORM_data1\n" + " - Attribute: DW_AT_byte_size\n" + " Form: DW_FORM_data1\n" "debug_info:\n" " - Version: 4\n" " AbbrOffset: 0\n" diff --git a/lldb/unittests/Symbol/Inputs/inlined-functions.yaml b/lldb/unittests/Symbol/Inputs/inlined-functions.yaml --- a/lldb/unittests/Symbol/Inputs/inlined-functions.yaml +++ b/lldb/unittests/Symbol/Inputs/inlined-functions.yaml @@ -164,183 +164,184 @@ - argv - char - sum - debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_producer - Form: DW_FORM_strp - - Attribute: DW_AT_language - Form: DW_FORM_data2 - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_stmt_list - Form: DW_FORM_sec_offset - - Attribute: DW_AT_comp_dir - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Code: 0x00000002 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Attribute: DW_AT_frame_base - Form: DW_FORM_exprloc - - Attribute: DW_AT_linkage_name - Form: DW_FORM_strp - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_decl_line - Form: DW_FORM_data1 - - Attribute: DW_AT_type - Form: DW_FORM_ref4 - - Attribute: DW_AT_external - Form: DW_FORM_flag_present - - Code: 0x00000003 - Tag: DW_TAG_formal_parameter - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_location - Form: DW_FORM_exprloc - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_decl_line - Form: DW_FORM_data1 - - Attribute: DW_AT_type - Form: DW_FORM_ref4 - - Code: 0x00000004 - Tag: DW_TAG_variable - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_location - Form: DW_FORM_exprloc - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_decl_line - Form: DW_FORM_data1 - - Attribute: DW_AT_type - Form: DW_FORM_ref4 - - Code: 0x00000005 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_linkage_name - Form: DW_FORM_strp - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_decl_line - Form: DW_FORM_data1 - - Attribute: DW_AT_type - Form: DW_FORM_ref4 - - Attribute: DW_AT_external - Form: DW_FORM_flag_present - - Attribute: DW_AT_inline - Form: DW_FORM_data1 - - Code: 0x00000006 - Tag: DW_TAG_formal_parameter - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_decl_line - Form: DW_FORM_data1 - - Attribute: DW_AT_type - Form: DW_FORM_ref4 - - Code: 0x00000007 - Tag: DW_TAG_variable - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_decl_line - Form: DW_FORM_data1 - - Attribute: DW_AT_type - Form: DW_FORM_ref4 - - Code: 0x00000008 - Tag: DW_TAG_base_type - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_encoding - Form: DW_FORM_data1 - - Attribute: DW_AT_byte_size - Form: DW_FORM_data1 - - Code: 0x00000009 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Attribute: DW_AT_frame_base - Form: DW_FORM_exprloc - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_decl_line - Form: DW_FORM_data1 - - Attribute: DW_AT_type - Form: DW_FORM_ref4 - - Attribute: DW_AT_external - Form: DW_FORM_flag_present - - Code: 0x0000000A - Tag: DW_TAG_inlined_subroutine - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_abstract_origin - Form: DW_FORM_ref4 - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Attribute: DW_AT_call_file - Form: DW_FORM_data1 - - Attribute: DW_AT_call_line - Form: DW_FORM_data1 - - Code: 0x0000000B - Tag: DW_TAG_formal_parameter - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_location - Form: DW_FORM_exprloc - - Attribute: DW_AT_abstract_origin - Form: DW_FORM_ref4 - - Code: 0x0000000C - Tag: DW_TAG_variable - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_location - Form: DW_FORM_exprloc - - Attribute: DW_AT_abstract_origin - Form: DW_FORM_ref4 - - Code: 0x0000000D - Tag: DW_TAG_pointer_type - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_type - Form: DW_FORM_ref4 + debug_abbrev: + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_producer + Form: DW_FORM_strp + - Attribute: DW_AT_language + Form: DW_FORM_data2 + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_stmt_list + Form: DW_FORM_sec_offset + - Attribute: DW_AT_comp_dir + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Code: 0x00000002 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Attribute: DW_AT_frame_base + Form: DW_FORM_exprloc + - Attribute: DW_AT_linkage_name + Form: DW_FORM_strp + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_decl_file + Form: DW_FORM_data1 + - Attribute: DW_AT_decl_line + Form: DW_FORM_data1 + - Attribute: DW_AT_type + Form: DW_FORM_ref4 + - Attribute: DW_AT_external + Form: DW_FORM_flag_present + - Code: 0x00000003 + Tag: DW_TAG_formal_parameter + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_location + Form: DW_FORM_exprloc + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_decl_file + Form: DW_FORM_data1 + - Attribute: DW_AT_decl_line + Form: DW_FORM_data1 + - Attribute: DW_AT_type + Form: DW_FORM_ref4 + - Code: 0x00000004 + Tag: DW_TAG_variable + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_location + Form: DW_FORM_exprloc + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_decl_file + Form: DW_FORM_data1 + - Attribute: DW_AT_decl_line + Form: DW_FORM_data1 + - Attribute: DW_AT_type + Form: DW_FORM_ref4 + - Code: 0x00000005 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_linkage_name + Form: DW_FORM_strp + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_decl_file + Form: DW_FORM_data1 + - Attribute: DW_AT_decl_line + Form: DW_FORM_data1 + - Attribute: DW_AT_type + Form: DW_FORM_ref4 + - Attribute: DW_AT_external + Form: DW_FORM_flag_present + - Attribute: DW_AT_inline + Form: DW_FORM_data1 + - Code: 0x00000006 + Tag: DW_TAG_formal_parameter + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_decl_file + Form: DW_FORM_data1 + - Attribute: DW_AT_decl_line + Form: DW_FORM_data1 + - Attribute: DW_AT_type + Form: DW_FORM_ref4 + - Code: 0x00000007 + Tag: DW_TAG_variable + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_decl_file + Form: DW_FORM_data1 + - Attribute: DW_AT_decl_line + Form: DW_FORM_data1 + - Attribute: DW_AT_type + Form: DW_FORM_ref4 + - Code: 0x00000008 + Tag: DW_TAG_base_type + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_encoding + Form: DW_FORM_data1 + - Attribute: DW_AT_byte_size + Form: DW_FORM_data1 + - Code: 0x00000009 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Attribute: DW_AT_frame_base + Form: DW_FORM_exprloc + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_decl_file + Form: DW_FORM_data1 + - Attribute: DW_AT_decl_line + Form: DW_FORM_data1 + - Attribute: DW_AT_type + Form: DW_FORM_ref4 + - Attribute: DW_AT_external + Form: DW_FORM_flag_present + - Code: 0x0000000A + Tag: DW_TAG_inlined_subroutine + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_abstract_origin + Form: DW_FORM_ref4 + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Attribute: DW_AT_call_file + Form: DW_FORM_data1 + - Attribute: DW_AT_call_line + Form: DW_FORM_data1 + - Code: 0x0000000B + Tag: DW_TAG_formal_parameter + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_location + Form: DW_FORM_exprloc + - Attribute: DW_AT_abstract_origin + Form: DW_FORM_ref4 + - Code: 0x0000000C + Tag: DW_TAG_variable + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_location + Form: DW_FORM_exprloc + - Attribute: DW_AT_abstract_origin + Form: DW_FORM_ref4 + - Code: 0x0000000D + Tag: DW_TAG_pointer_type + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_type + Form: DW_FORM_ref4 debug_info: - Length: 579 Version: 4 diff --git a/lldb/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp b/lldb/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp --- a/lldb/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp +++ b/lldb/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp @@ -41,20 +41,21 @@ /// Auxiliary debug info. const char *yamldata = "debug_abbrev:\n" - " - Code: 0x00000001\n" - " Tag: DW_TAG_compile_unit\n" - " Children: DW_CHILDREN_yes\n" - " Attributes:\n" - " - Attribute: DW_AT_language\n" - " Form: DW_FORM_data2\n" - " - Code: 0x00000002\n" - " Tag: DW_TAG_base_type\n" - " Children: DW_CHILDREN_no\n" - " Attributes:\n" - " - Attribute: DW_AT_encoding\n" - " Form: DW_FORM_data1\n" - " - Attribute: DW_AT_byte_size\n" - " Form: DW_FORM_data1\n" + " - Table:\n" + " - Code: 0x00000001\n" + " Tag: DW_TAG_compile_unit\n" + " Children: DW_CHILDREN_yes\n" + " Attributes:\n" + " - Attribute: DW_AT_language\n" + " Form: DW_FORM_data2\n" + " - Code: 0x00000002\n" + " Tag: DW_TAG_base_type\n" + " Children: DW_CHILDREN_no\n" + " Attributes:\n" + " - Attribute: DW_AT_encoding\n" + " Form: DW_FORM_data1\n" + " - Attribute: DW_AT_byte_size\n" + " Form: DW_FORM_data1\n" "debug_info:\n" " - Version: 4\n" " AbbrOffset: 0\n" diff --git a/lldb/unittests/SymbolFile/DWARF/XcodeSDKModuleTests.cpp b/lldb/unittests/SymbolFile/DWARF/XcodeSDKModuleTests.cpp --- a/lldb/unittests/SymbolFile/DWARF/XcodeSDKModuleTests.cpp +++ b/lldb/unittests/SymbolFile/DWARF/XcodeSDKModuleTests.cpp @@ -38,14 +38,15 @@ debug_str: - MacOSX10.9.sdk debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_language - Form: DW_FORM_data2 - - Attribute: DW_AT_APPLE_sdk - Form: DW_FORM_strp + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_language + Form: DW_FORM_data2 + - Attribute: DW_AT_APPLE_sdk + Form: DW_FORM_strp debug_info: - Length: 8 Version: 2 diff --git a/llvm/include/llvm/ObjectYAML/DWARFYAML.h b/llvm/include/llvm/ObjectYAML/DWARFYAML.h --- a/llvm/include/llvm/ObjectYAML/DWARFYAML.h +++ b/llvm/include/llvm/ObjectYAML/DWARFYAML.h @@ -39,6 +39,10 @@ std::vector Attributes; }; +struct AbbrevTable { + std::vector Table; +}; + struct ARangeDescriptor { llvm::yaml::Hex64 Address; yaml::Hex64 Length; @@ -203,7 +207,7 @@ struct Data { bool IsLittleEndian; bool Is64BitAddrSize; - std::vector AbbrevDecls; + std::vector DebugAbbrev; std::vector DebugStrings; Optional> DebugStrOffsets; Optional> DebugAranges; @@ -231,6 +235,7 @@ LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::AttributeAbbrev) LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::Abbrev) +LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::AbbrevTable) LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::ARangeDescriptor) LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::ARange) LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::RangeEntry) @@ -264,6 +269,10 @@ static void mapping(IO &IO, DWARFYAML::Data &DWARF); }; +template <> struct MappingTraits { + static void mapping(IO &IO, DWARFYAML::AbbrevTable &AbbrevTable); +}; + template <> struct MappingTraits { static void mapping(IO &IO, DWARFYAML::Abbrev &Abbrev); }; diff --git a/llvm/lib/ObjectYAML/DWARFEmitter.cpp b/llvm/lib/ObjectYAML/DWARFEmitter.cpp --- a/llvm/lib/ObjectYAML/DWARFEmitter.cpp +++ b/llvm/lib/ObjectYAML/DWARFEmitter.cpp @@ -96,24 +96,27 @@ Error DWARFYAML::emitDebugAbbrev(raw_ostream &OS, const DWARFYAML::Data &DI) { uint64_t AbbrevCode = 0; - for (auto AbbrevDecl : DI.AbbrevDecls) { - AbbrevCode = AbbrevDecl.Code ? (uint64_t)*AbbrevDecl.Code : AbbrevCode + 1; - encodeULEB128(AbbrevCode, OS); - encodeULEB128(AbbrevDecl.Tag, OS); - OS.write(AbbrevDecl.Children); - for (auto Attr : AbbrevDecl.Attributes) { - encodeULEB128(Attr.Attribute, OS); - encodeULEB128(Attr.Form, OS); - if (Attr.Form == dwarf::DW_FORM_implicit_const) - encodeSLEB128(Attr.Value, OS); + for (const DWARFYAML::AbbrevTable &AbbrevTable : DI.DebugAbbrev) { + for (const DWARFYAML::Abbrev &AbbrevDecl : AbbrevTable.Table) { + AbbrevCode = + AbbrevDecl.Code ? (uint64_t)*AbbrevDecl.Code : AbbrevCode + 1; + encodeULEB128(AbbrevCode, OS); + encodeULEB128(AbbrevDecl.Tag, OS); + OS.write(AbbrevDecl.Children); + for (auto Attr : AbbrevDecl.Attributes) { + encodeULEB128(Attr.Attribute, OS); + encodeULEB128(Attr.Form, OS); + if (Attr.Form == dwarf::DW_FORM_implicit_const) + encodeSLEB128(Attr.Value, OS); + } + encodeULEB128(0, OS); + encodeULEB128(0, OS); } - encodeULEB128(0, OS); - encodeULEB128(0, OS); - } - // The abbreviations for a given compilation unit end with an entry consisting - // of a 0 byte for the abbreviation code. - OS.write_zeros(1); + // The abbreviations for a given compilation unit end with an entry + // consisting of a 0 byte for the abbreviation code. + OS.write_zeros(1); + } return Error::success(); } @@ -243,7 +246,7 @@ /*IsGNUStyle=*/true); } -static Expected writeDIE(ArrayRef AbbrevDecls, +static Expected writeDIE(ArrayRef AbbrevTable, const dwarf::FormParams &Params, const DWARFYAML::Entry &Entry, raw_ostream &OS, bool IsLittleEndian) { @@ -253,6 +256,13 @@ if (AbbrCode == 0 || Entry.Values.empty()) return OS.tell() - EntryBegin; + if (AbbrevTable.empty()) + return createStringError( + errc::invalid_argument, + "non-empty compilation unit should have an associated abbrev table"); + + ArrayRef AbbrevDecls(AbbrevTable[0].Table); + if (AbbrCode > AbbrevDecls.size()) return createStringError( errc::invalid_argument, @@ -394,7 +404,7 @@ for (const DWARFYAML::Entry &Entry : Unit.Entries) { if (Expected EntryLength = writeDIE( - DI.AbbrevDecls, Params, Entry, EntryBufferOS, DI.IsLittleEndian)) + DI.DebugAbbrev, Params, Entry, EntryBufferOS, DI.IsLittleEndian)) Length += *EntryLength; else return EntryLength.takeError(); diff --git a/llvm/lib/ObjectYAML/DWARFYAML.cpp b/llvm/lib/ObjectYAML/DWARFYAML.cpp --- a/llvm/lib/ObjectYAML/DWARFYAML.cpp +++ b/llvm/lib/ObjectYAML/DWARFYAML.cpp @@ -32,7 +32,7 @@ SecNames.insert("debug_line"); if (!DebugAddr.empty()) SecNames.insert("debug_addr"); - if (!AbbrevDecls.empty()) + if (!DebugAbbrev.empty()) SecNames.insert("debug_abbrev"); if (!CompileUnits.empty()) SecNames.insert("debug_info"); @@ -60,7 +60,7 @@ DWARFYAML::DWARFContext DWARFCtx; IO.setContext(&DWARFCtx); IO.mapOptional("debug_str", DWARF.DebugStrings); - IO.mapOptional("debug_abbrev", DWARF.AbbrevDecls); + IO.mapOptional("debug_abbrev", DWARF.DebugAbbrev); IO.mapOptional("debug_aranges", DWARF.DebugAranges); if (!DWARF.DebugRanges.empty() || !IO.outputting()) IO.mapOptional("debug_ranges", DWARF.DebugRanges); @@ -78,6 +78,11 @@ IO.setContext(OldContext); } +void MappingTraits::mapping( + IO &IO, DWARFYAML::AbbrevTable &AbbrevTable) { + IO.mapOptional("Table", AbbrevTable.Table); +} + void MappingTraits::mapping(IO &IO, DWARFYAML::Abbrev &Abbrev) { IO.mapOptional("Code", Abbrev.Code); diff --git a/llvm/test/ObjectYAML/MachO/DWARF-BigEndian.yaml b/llvm/test/ObjectYAML/MachO/DWARF-BigEndian.yaml --- a/llvm/test/ObjectYAML/MachO/DWARF-BigEndian.yaml +++ b/llvm/test/ObjectYAML/MachO/DWARF-BigEndian.yaml @@ -274,103 +274,104 @@ - a - N - t - debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_producer - Form: DW_FORM_strp - - Attribute: DW_AT_language - Form: DW_FORM_data2 - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_stmt_list - Form: DW_FORM_sec_offset - - Attribute: DW_AT_comp_dir - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Code: 0x00000002 - Tag: DW_TAG_base_type - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_encoding - Form: DW_FORM_data1 - - Attribute: DW_AT_byte_size - Form: DW_FORM_data1 - - Code: 0x00000003 - Tag: DW_TAG_typedef - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_type - Form: DW_FORM_ref4 - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_decl_line - Form: DW_FORM_data1 - - Code: 0x00000004 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Attribute: DW_AT_frame_base - Form: DW_FORM_exprloc - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_decl_line - Form: DW_FORM_data1 - - Attribute: DW_AT_prototyped - Form: DW_FORM_flag_present - - Attribute: DW_AT_type - Form: DW_FORM_ref4 - - Attribute: DW_AT_external - Form: DW_FORM_flag_present - - Code: 0x00000005 - Tag: DW_TAG_formal_parameter - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_location - Form: DW_FORM_exprloc - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_decl_line - Form: DW_FORM_data1 - - Attribute: DW_AT_type - Form: DW_FORM_ref4 - - Code: 0x00000006 - Tag: DW_TAG_variable - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_location - Form: DW_FORM_exprloc - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_decl_line - Form: DW_FORM_data1 - - Attribute: DW_AT_type - Form: DW_FORM_ref4 - - Code: 0x00000007 - Tag: DW_TAG_const_type - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_type - Form: DW_FORM_ref4 + debug_abbrev: + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_producer + Form: DW_FORM_strp + - Attribute: DW_AT_language + Form: DW_FORM_data2 + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_stmt_list + Form: DW_FORM_sec_offset + - Attribute: DW_AT_comp_dir + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Code: 0x00000002 + Tag: DW_TAG_base_type + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_encoding + Form: DW_FORM_data1 + - Attribute: DW_AT_byte_size + Form: DW_FORM_data1 + - Code: 0x00000003 + Tag: DW_TAG_typedef + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_type + Form: DW_FORM_ref4 + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_decl_file + Form: DW_FORM_data1 + - Attribute: DW_AT_decl_line + Form: DW_FORM_data1 + - Code: 0x00000004 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Attribute: DW_AT_frame_base + Form: DW_FORM_exprloc + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_decl_file + Form: DW_FORM_data1 + - Attribute: DW_AT_decl_line + Form: DW_FORM_data1 + - Attribute: DW_AT_prototyped + Form: DW_FORM_flag_present + - Attribute: DW_AT_type + Form: DW_FORM_ref4 + - Attribute: DW_AT_external + Form: DW_FORM_flag_present + - Code: 0x00000005 + Tag: DW_TAG_formal_parameter + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_location + Form: DW_FORM_exprloc + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_decl_file + Form: DW_FORM_data1 + - Attribute: DW_AT_decl_line + Form: DW_FORM_data1 + - Attribute: DW_AT_type + Form: DW_FORM_ref4 + - Code: 0x00000006 + Tag: DW_TAG_variable + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_location + Form: DW_FORM_exprloc + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_decl_file + Form: DW_FORM_data1 + - Attribute: DW_AT_decl_line + Form: DW_FORM_data1 + - Attribute: DW_AT_type + Form: DW_FORM_ref4 + - Code: 0x00000007 + Tag: DW_TAG_const_type + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_type + Form: DW_FORM_ref4 ... #CHECK: DWARF: diff --git a/llvm/test/ObjectYAML/MachO/DWARF-LittleEndian.yaml b/llvm/test/ObjectYAML/MachO/DWARF-LittleEndian.yaml --- a/llvm/test/ObjectYAML/MachO/DWARF-LittleEndian.yaml +++ b/llvm/test/ObjectYAML/MachO/DWARF-LittleEndian.yaml @@ -263,103 +263,104 @@ - a - N - t - debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_producer - Form: DW_FORM_strp - - Attribute: DW_AT_language - Form: DW_FORM_data2 - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_stmt_list - Form: DW_FORM_sec_offset - - Attribute: DW_AT_comp_dir - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Code: 0x00000002 - Tag: DW_TAG_base_type - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_encoding - Form: DW_FORM_data1 - - Attribute: DW_AT_byte_size - Form: DW_FORM_data1 - - Code: 0x00000003 - Tag: DW_TAG_typedef - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_type - Form: DW_FORM_ref4 - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_decl_line - Form: DW_FORM_data1 - - Code: 0x00000004 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Attribute: DW_AT_frame_base - Form: DW_FORM_exprloc - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_decl_line - Form: DW_FORM_data1 - - Attribute: DW_AT_prototyped - Form: DW_FORM_flag_present - - Attribute: DW_AT_type - Form: DW_FORM_ref4 - - Attribute: DW_AT_external - Form: DW_FORM_flag_present - - Code: 0x00000005 - Tag: DW_TAG_formal_parameter - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_location - Form: DW_FORM_exprloc - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_decl_line - Form: DW_FORM_data1 - - Attribute: DW_AT_type - Form: DW_FORM_ref4 - - Code: 0x00000006 - Tag: DW_TAG_variable - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_location - Form: DW_FORM_exprloc - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_decl_line - Form: DW_FORM_data1 - - Attribute: DW_AT_type - Form: DW_FORM_ref4 - - Code: 0x00000007 - Tag: DW_TAG_const_type - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_type - Form: DW_FORM_ref4 + debug_abbrev: + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_producer + Form: DW_FORM_strp + - Attribute: DW_AT_language + Form: DW_FORM_data2 + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_stmt_list + Form: DW_FORM_sec_offset + - Attribute: DW_AT_comp_dir + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Code: 0x00000002 + Tag: DW_TAG_base_type + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_encoding + Form: DW_FORM_data1 + - Attribute: DW_AT_byte_size + Form: DW_FORM_data1 + - Code: 0x00000003 + Tag: DW_TAG_typedef + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_type + Form: DW_FORM_ref4 + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_decl_file + Form: DW_FORM_data1 + - Attribute: DW_AT_decl_line + Form: DW_FORM_data1 + - Code: 0x00000004 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Attribute: DW_AT_frame_base + Form: DW_FORM_exprloc + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_decl_file + Form: DW_FORM_data1 + - Attribute: DW_AT_decl_line + Form: DW_FORM_data1 + - Attribute: DW_AT_prototyped + Form: DW_FORM_flag_present + - Attribute: DW_AT_type + Form: DW_FORM_ref4 + - Attribute: DW_AT_external + Form: DW_FORM_flag_present + - Code: 0x00000005 + Tag: DW_TAG_formal_parameter + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_location + Form: DW_FORM_exprloc + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_decl_file + Form: DW_FORM_data1 + - Attribute: DW_AT_decl_line + Form: DW_FORM_data1 + - Attribute: DW_AT_type + Form: DW_FORM_ref4 + - Code: 0x00000006 + Tag: DW_TAG_variable + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_location + Form: DW_FORM_exprloc + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_decl_file + Form: DW_FORM_data1 + - Attribute: DW_AT_decl_line + Form: DW_FORM_data1 + - Attribute: DW_AT_type + Form: DW_FORM_ref4 + - Code: 0x00000007 + Tag: DW_TAG_const_type + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_type + Form: DW_FORM_ref4 ... #CHECK: DWARF: diff --git a/llvm/test/ObjectYAML/MachO/DWARF-debug_abbrev.yaml b/llvm/test/ObjectYAML/MachO/DWARF-debug_abbrev.yaml --- a/llvm/test/ObjectYAML/MachO/DWARF-debug_abbrev.yaml +++ b/llvm/test/ObjectYAML/MachO/DWARF-debug_abbrev.yaml @@ -1,421 +1,113 @@ +## Test that yaml2obj is able to emit the __debug_abbrev section and obj2yaml is able to +## convert it back. + # RUN: yaml2obj %s | obj2yaml | FileCheck %s --- !mach-o -FileHeader: - magic: 0xFEEDFACF - cputype: 0x01000007 - cpusubtype: 0x00000003 - filetype: 0x0000000A - ncmds: 5 - sizeofcmds: 1800 - flags: 0x00000000 - reserved: 0x00000000 -LoadCommands: - - cmd: LC_SEGMENT_64 - cmdsize: 72 - segname: __PAGEZERO - vmaddr: 0 - vmsize: 4294967296 - fileoff: 0 - filesize: 0 - maxprot: 0 - initprot: 0 - nsects: 0 - flags: 0 - - cmd: LC_SEGMENT_64 - cmdsize: 472 - segname: __TEXT - vmaddr: 4294967296 - vmsize: 4096 - fileoff: 0 - filesize: 0 - maxprot: 7 - initprot: 5 - nsects: 5 - flags: 0 - Sections: - - sectname: __text - segname: __TEXT - addr: 0x0000000100000F50 - size: 52 - offset: 0x00000000 - align: 4 - reloff: 0x00000000 - nreloc: 0 - flags: 0x80000400 - reserved1: 0x00000000 - reserved2: 0x00000000 - reserved3: 0x00000000 - - sectname: __stubs - segname: __TEXT - addr: 0x0000000100000F84 - size: 6 - offset: 0x00000000 - align: 1 - reloff: 0x00000000 - nreloc: 0 - flags: 0x80000408 - reserved1: 0x00000000 - reserved2: 0x00000006 - reserved3: 0x00000000 - - sectname: __stub_helper - segname: __TEXT - addr: 0x0000000100000F8C - size: 26 - offset: 0x00000000 - align: 2 - reloff: 0x00000000 - nreloc: 0 - flags: 0x80000400 - reserved1: 0x00000000 - reserved2: 0x00000000 - reserved3: 0x00000000 - - sectname: __cstring - segname: __TEXT - addr: 0x0000000100000FA6 - size: 14 - offset: 0x00000000 - align: 0 - reloff: 0x00000000 - nreloc: 0 - flags: 0x00000002 - reserved1: 0x00000000 - reserved2: 0x00000000 - reserved3: 0x00000000 - - sectname: __unwind_info - segname: __TEXT - addr: 0x0000000100000FB4 - size: 72 - offset: 0x00000000 - align: 2 - reloff: 0x00000000 - nreloc: 0 - flags: 0x00000000 - reserved1: 0x00000000 - reserved2: 0x00000000 - reserved3: 0x00000000 - - cmd: LC_SEGMENT_64 - cmdsize: 232 - segname: __DATA - vmaddr: 4294971392 - vmsize: 4096 - fileoff: 0 - filesize: 0 - maxprot: 7 - initprot: 3 - nsects: 2 - flags: 0 - Sections: - - sectname: __nl_symbol_ptr - segname: __DATA - addr: 0x0000000100001000 - size: 16 - offset: 0x00000000 - align: 3 - reloff: 0x00000000 - nreloc: 0 - flags: 0x00000006 - reserved1: 0x00000001 - reserved2: 0x00000000 - reserved3: 0x00000000 - - sectname: __la_symbol_ptr - segname: __DATA - addr: 0x0000000100001010 - size: 8 - offset: 0x00000000 - align: 3 - reloff: 0x00000000 - nreloc: 0 - flags: 0x00000007 - reserved1: 0x00000003 - reserved2: 0x00000000 - reserved3: 0x00000000 - - cmd: LC_SEGMENT_64 - cmdsize: 72 - segname: __LINKEDIT - vmaddr: 4294975488 - vmsize: 4096 - fileoff: 4096 - filesize: 60 - maxprot: 7 - initprot: 1 - nsects: 0 - flags: 0 - - cmd: LC_SEGMENT_64 - cmdsize: 952 - segname: __DWARF - vmaddr: 4294979584 - vmsize: 4096 - fileoff: 8192 - filesize: 764 - maxprot: 7 - initprot: 3 - nsects: 11 - flags: 0 - Sections: - - sectname: __debug_line - segname: __DWARF - addr: 0x0000000100003000 - size: 69 - offset: 0x00002000 - align: 0 - reloff: 0x00000000 - nreloc: 0 - flags: 0x00000000 - reserved1: 0x00000000 - reserved2: 0x00000000 - reserved3: 0x00000000 - - sectname: __debug_pubnames - segname: __DWARF - addr: 0x0000000100003045 - size: 27 - offset: 0x00002045 - align: 0 - reloff: 0x00000000 - nreloc: 0 - flags: 0x00000000 - reserved1: 0x00000000 - reserved2: 0x00000000 - reserved3: 0x00000000 - - sectname: __debug_pubtypes - segname: __DWARF - addr: 0x0000000100003060 - size: 35 - offset: 0x00002060 - align: 0 - reloff: 0x00000000 - nreloc: 0 - flags: 0x00000000 - reserved1: 0x00000000 - reserved2: 0x00000000 - reserved3: 0x00000000 - - sectname: __debug_info - segname: __DWARF - addr: 0x00000001000030B3 - size: 121 - offset: 0x000020B3 - align: 0 - reloff: 0x00000000 - nreloc: 0 - flags: 0x00000000 - reserved1: 0x00000000 - reserved2: 0x00000000 - reserved3: 0x00000000 - - sectname: __debug_abbrev - segname: __DWARF - addr: 0x000000010000312C - size: 76 - offset: 0x0000212C - align: 0 - reloff: 0x00000000 - nreloc: 0 - flags: 0x00000000 - reserved1: 0x00000000 - reserved2: 0x00000000 - reserved3: 0x00000000 - - sectname: __debug_str - segname: __DWARF - addr: 0x0000000100003178 - size: 142 - offset: 0x00002178 - align: 0 - reloff: 0x00000000 - nreloc: 0 - flags: 0x00000000 - reserved1: 0x00000000 - reserved2: 0x00000000 - reserved3: 0x00000000 - - sectname: __apple_names - segname: __DWARF - addr: 0x0000000100003206 - size: 60 - offset: 0x00002206 - align: 0 - reloff: 0x00000000 - nreloc: 0 - flags: 0x00000000 - reserved1: 0x00000000 - reserved2: 0x00000000 - reserved3: 0x00000000 - - sectname: __apple_namespac - segname: __DWARF - addr: 0x0000000100003242 - size: 36 - offset: 0x00002242 - align: 0 - reloff: 0x00000000 - nreloc: 0 - flags: 0x00000000 - reserved1: 0x00000000 - reserved2: 0x00000000 - reserved3: 0x00000000 - - sectname: __apple_types - segname: __DWARF - addr: 0x0000000100003266 - size: 114 - offset: 0x00002266 - align: 0 - reloff: 0x00000000 - nreloc: 0 - flags: 0x00000000 - reserved1: 0x00000000 - reserved2: 0x00000000 - reserved3: 0x00000000 - - sectname: __apple_objc - segname: __DWARF - addr: 0x00000001000032D8 - size: 36 - offset: 0x000022D8 - align: 0 - reloff: 0x00000000 - nreloc: 0 - flags: 0x00000000 - reserved1: 0x00000000 - reserved2: 0x00000000 - reserved3: 0x00000000 -DWARF: - debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_producer - Form: DW_FORM_strp - - Attribute: DW_AT_language - Form: DW_FORM_data2 - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_stmt_list - Form: DW_FORM_sec_offset - - Attribute: DW_AT_comp_dir - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Code: 0x00000002 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Attribute: DW_AT_frame_base - Form: DW_FORM_exprloc - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_decl_line - Form: DW_FORM_data1 - - Attribute: DW_AT_prototyped - Form: DW_FORM_flag_present - - Attribute: DW_AT_type - Form: DW_FORM_ref4 - - Attribute: DW_AT_external - Form: DW_FORM_flag_present - - Code: 0x00000003 - Tag: DW_TAG_formal_parameter - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_location - Form: DW_FORM_exprloc - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_decl_line - Form: DW_FORM_data1 - - Attribute: DW_AT_type - Form: DW_FORM_ref4 - - Code: 0x00000004 - Tag: DW_TAG_base_type - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_encoding - Form: DW_FORM_data1 - - Attribute: DW_AT_byte_size - Form: DW_FORM_data1 - - Code: 0x00000005 - Tag: DW_TAG_pointer_type - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_type - Form: DW_FORM_ref4 -... +FileHeader: + magic: 0xFEEDFACF + cputype: 0x01000007 + cpusubtype: 0x00000003 + filetype: 0x0000000A + ncmds: 1 + sizeofcmds: 1800 + flags: 0x00000000 + reserved: 0x00000000 +LoadCommands: + - cmd: LC_SEGMENT_64 + cmdsize: 152 + segname: __DWARF + vmaddr: 4294979584 + vmsize: 4096 + fileoff: 8192 + filesize: 764 + maxprot: 7 + initprot: 3 + nsects: 1 + flags: 0 + Sections: + - sectname: __debug_abbrev + segname: __DWARF + addr: 0x000000010000312C + size: 38 + offset: 0x0000212C + align: 0 + reloff: 0x00000000 + nreloc: 0 + flags: 0x00000000 + reserved1: 0x00000000 + reserved2: 0x00000000 + reserved3: 0x00000000 +DWARF: + debug_abbrev: + - Table: + - Code: 1 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_producer + Form: DW_FORM_strp + - Attribute: DW_AT_language + Form: DW_FORM_data2 + - Code: 2 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Table: + - Code: 1 + Tag: DW_TAG_formal_parameter + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_location + Form: DW_FORM_exprloc + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Code: 2 + Tag: DW_TAG_base_type + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_encoding + Form: DW_FORM_data1 -#CHECK: DWARF: -#CHECK: debug_abbrev: -#CHECK: - Code: 0x0000000000000001 -#CHECK: Tag: DW_TAG_compile_unit -#CHECK: Children: DW_CHILDREN_yes -#CHECK: Attributes: -#CHECK: - Attribute: DW_AT_producer -#CHECK: Form: DW_FORM_strp -#CHECK: - Attribute: DW_AT_language -#CHECK: Form: DW_FORM_data2 -#CHECK: - Attribute: DW_AT_name -#CHECK: Form: DW_FORM_strp -#CHECK: - Attribute: DW_AT_stmt_list -#CHECK: Form: DW_FORM_sec_offset -#CHECK: - Attribute: DW_AT_comp_dir -#CHECK: Form: DW_FORM_strp -#CHECK: - Attribute: DW_AT_low_pc -#CHECK: Form: DW_FORM_addr -#CHECK: - Attribute: DW_AT_high_pc -#CHECK: Form: DW_FORM_data4 -#CHECK: - Code: 0x0000000000000002 -#CHECK: Tag: DW_TAG_subprogram -#CHECK: Children: DW_CHILDREN_yes -#CHECK: Attributes: -#CHECK: - Attribute: DW_AT_low_pc -#CHECK: Form: DW_FORM_addr -#CHECK: - Attribute: DW_AT_high_pc -#CHECK: Form: DW_FORM_data4 -#CHECK: - Attribute: DW_AT_frame_base -#CHECK: Form: DW_FORM_exprloc -#CHECK: - Attribute: DW_AT_name -#CHECK: Form: DW_FORM_strp -#CHECK: - Attribute: DW_AT_decl_file -#CHECK: Form: DW_FORM_data1 -#CHECK: - Attribute: DW_AT_decl_line -#CHECK: Form: DW_FORM_data1 -#CHECK: - Attribute: DW_AT_prototyped -#CHECK: Form: DW_FORM_flag_present -#CHECK: - Attribute: DW_AT_type -#CHECK: Form: DW_FORM_ref4 -#CHECK: - Attribute: DW_AT_external -#CHECK: Form: DW_FORM_flag_present -#CHECK: - Code: 0x0000000000000003 -#CHECK: Tag: DW_TAG_formal_parameter -#CHECK: Children: DW_CHILDREN_no -#CHECK: Attributes: -#CHECK: - Attribute: DW_AT_location -#CHECK: Form: DW_FORM_exprloc -#CHECK: - Attribute: DW_AT_name -#CHECK: Form: DW_FORM_strp -#CHECK: - Attribute: DW_AT_decl_file -#CHECK: Form: DW_FORM_data1 -#CHECK: - Attribute: DW_AT_decl_line -#CHECK: Form: DW_FORM_data1 -#CHECK: - Attribute: DW_AT_type -#CHECK: Form: DW_FORM_ref4 -#CHECK: - Code: 0x0000000000000004 -#CHECK: Tag: DW_TAG_base_type -#CHECK: Children: DW_CHILDREN_no -#CHECK: Attributes: -#CHECK: - Attribute: DW_AT_name -#CHECK: Form: DW_FORM_strp -#CHECK: - Attribute: DW_AT_encoding -#CHECK: Form: DW_FORM_data1 -#CHECK: - Attribute: DW_AT_byte_size -#CHECK: Form: DW_FORM_data1 -#CHECK: - Code: 0x0000000000000005 -#CHECK: Tag: DW_TAG_pointer_type -#CHECK: Children: DW_CHILDREN_no -#CHECK: Attributes: -#CHECK: - Attribute: DW_AT_type -#CHECK: Form: DW_FORM_ref4 +# CHECK: DWARF: +# CHECK-NEXT: debug_abbrev: +# CHECK-NEXT: - Table: +# CHECK-NEXT: - Code: 0x0000000000000001 +# CHECK-NEXT: Tag: DW_TAG_compile_unit +# CHECK-NEXT: Children: DW_CHILDREN_yes +# CHECK-NEXT: Attributes: +# CHECK-NEXT: - Attribute: DW_AT_producer +# CHECK-NEXT: Form: DW_FORM_strp +# CHECK-NEXT: - Attribute: DW_AT_language +# CHECK-NEXT: Form: DW_FORM_data2 +# CHECK-NEXT: - Code: 0x0000000000000002 +# CHECK-NEXT: Tag: DW_TAG_subprogram +# CHECK-NEXT: Children: DW_CHILDREN_yes +# CHECK-NEXT: Attributes: +# CHECK-NEXT: - Attribute: DW_AT_low_pc +# CHECK-NEXT: Form: DW_FORM_addr +# CHECK-NEXT: - Attribute: DW_AT_high_pc +# CHECK-NEXT: Form: DW_FORM_data4 +# CHECK-NEXT: - Table: +# CHECK-NEXT: - Code: 0x0000000000000001 +# CHECK-NEXT: Tag: DW_TAG_formal_parameter +# CHECK-NEXT: Children: DW_CHILDREN_no +# CHECK-NEXT: Attributes: +# CHECK-NEXT: - Attribute: DW_AT_location +# CHECK-NEXT: Form: DW_FORM_exprloc +# CHECK-NEXT: - Attribute: DW_AT_name +# CHECK-NEXT: Form: DW_FORM_strp +# CHECK-NEXT: - Code: 0x0000000000000002 +# CHECK-NEXT: Tag: DW_TAG_base_type +# CHECK-NEXT: Children: DW_CHILDREN_no +# CHECK-NEXT: Attributes: +# CHECK-NEXT: - Attribute: DW_AT_name +# CHECK-NEXT: Form: DW_FORM_strp +# CHECK-NEXT: - Attribute: DW_AT_encoding +# CHECK-NEXT: Form: DW_FORM_data1 diff --git a/llvm/test/ObjectYAML/MachO/DWARF-debug_info.yaml b/llvm/test/ObjectYAML/MachO/DWARF-debug_info.yaml --- a/llvm/test/ObjectYAML/MachO/DWARF-debug_info.yaml +++ b/llvm/test/ObjectYAML/MachO/DWARF-debug_info.yaml @@ -310,76 +310,77 @@ - _main DWARF: debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_producer - Form: DW_FORM_strp - - Attribute: DW_AT_language - Form: DW_FORM_data2 - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_stmt_list - Form: DW_FORM_sec_offset - - Attribute: DW_AT_comp_dir - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Code: 0x00000002 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Attribute: DW_AT_frame_base - Form: DW_FORM_exprloc - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_decl_line - Form: DW_FORM_data1 - - Attribute: DW_AT_prototyped - Form: DW_FORM_flag_present - - Attribute: DW_AT_type - Form: DW_FORM_ref4 - - Attribute: DW_AT_external - Form: DW_FORM_flag_present - - Code: 0x00000003 - Tag: DW_TAG_formal_parameter - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_location - Form: DW_FORM_exprloc - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_decl_line - Form: DW_FORM_data1 - - Attribute: DW_AT_type - Form: DW_FORM_ref4 - - Code: 0x00000004 - Tag: DW_TAG_base_type - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_encoding - Form: DW_FORM_data1 - - Attribute: DW_AT_byte_size - Form: DW_FORM_data1 - - Code: 0x00000005 - Tag: DW_TAG_pointer_type - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_type - Form: DW_FORM_ref4 + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_producer + Form: DW_FORM_strp + - Attribute: DW_AT_language + Form: DW_FORM_data2 + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_stmt_list + Form: DW_FORM_sec_offset + - Attribute: DW_AT_comp_dir + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Code: 0x00000002 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Attribute: DW_AT_frame_base + Form: DW_FORM_exprloc + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_decl_file + Form: DW_FORM_data1 + - Attribute: DW_AT_decl_line + Form: DW_FORM_data1 + - Attribute: DW_AT_prototyped + Form: DW_FORM_flag_present + - Attribute: DW_AT_type + Form: DW_FORM_ref4 + - Attribute: DW_AT_external + Form: DW_FORM_flag_present + - Code: 0x00000003 + Tag: DW_TAG_formal_parameter + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_location + Form: DW_FORM_exprloc + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_decl_file + Form: DW_FORM_data1 + - Attribute: DW_AT_decl_line + Form: DW_FORM_data1 + - Attribute: DW_AT_type + Form: DW_FORM_ref4 + - Code: 0x00000004 + Tag: DW_TAG_base_type + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_encoding + Form: DW_FORM_data1 + - Attribute: DW_AT_byte_size + Form: DW_FORM_data1 + - Code: 0x00000005 + Tag: DW_TAG_pointer_type + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_type + Form: DW_FORM_ref4 debug_aranges: - Length: 44 Version: 2 @@ -511,10 +512,10 @@ # DWARF32: DWARF: # DWARF32: debug_info: -# DWARF32-NEXT: - Length: 0x0000000000000075 -# DWARF32-NEXT: Version: 4 -# DWARF32-NEXT: AbbrOffset: 0 -# DWARF32-NEXT: AddrSize: 8 +# DWARF32-NEXT: - Length: 0x0000000000000075 +# DWARF32-NEXT: Version: 4 +# DWARF32-NEXT: AbbrOffset: 0 +# DWARF32-NEXT: AddrSize: 8 # DWARF32-NEXT: Entries: # DWARF32-NEXT: - AbbrCode: 0x00000001 # DWARF32-NEXT: Values: @@ -580,10 +581,10 @@ # RUN: obj2yaml | FileCheck %s --check-prefix=DWARF32-YAML # DWARF32-YAML: debug_info: -# DWARF32-YAML-NEXT: - Length: 0x000000000000000C -# DWARF32-YAML-NEXT: Version: 4 -# DWARF32-YAML-NEXT: AbbrOffset: 0 -# DWARF32-YAML-NEXT: AddrSize: 8 +# DWARF32-YAML-NEXT: - Length: 0x000000000000000C +# DWARF32-YAML-NEXT: Version: 4 +# DWARF32-YAML-NEXT: AbbrOffset: 0 +# DWARF32-YAML-NEXT: AddrSize: 8 # DWARF32-YAML-NEXT: Entries: # DWARF32-YAML-NEXT: - AbbrCode: 0x00000001 # DWARF32-YAML-NEXT: Values: @@ -637,13 +638,14 @@ reserved2: 0x00000000 reserved3: 0x00000000 DWARF: - debug_abbrev: - - Code: 1 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr + debug_abbrev: + - Table: + - Code: 1 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr debug_info: - Format: [[FORMAT]] Length: 12 @@ -661,11 +663,11 @@ # RUN: obj2yaml | FileCheck %s --check-prefix=DWARF64-YAML # DWARF64-YAML: debug_info: -# DWARF64-YAML-NEXT: - Format: DWARF64 -# DWARF64-YAML-NEXT: Length: 0x000000000000000C -# DWARF64-YAML-NEXT: Version: 4 -# DWARF64-YAML-NEXT: AbbrOffset: 0 -# DWARF64-YAML-NEXT: AddrSize: 8 +# DWARF64-YAML-NEXT: - Format: DWARF64 +# DWARF64-YAML-NEXT: Length: 0x000000000000000C +# DWARF64-YAML-NEXT: Version: 4 +# DWARF64-YAML-NEXT: AbbrOffset: 0 +# DWARF64-YAML-NEXT: AddrSize: 8 # DWARF64-YAML-NEXT: Entries: # DWARF64-YAML-NEXT: - AbbrCode: 0x00000001 # DWARF64-YAML-NEXT: Values: diff --git a/llvm/test/ObjectYAML/MachO/DWARF-debug_line.yaml b/llvm/test/ObjectYAML/MachO/DWARF-debug_line.yaml --- a/llvm/test/ObjectYAML/MachO/DWARF-debug_line.yaml +++ b/llvm/test/ObjectYAML/MachO/DWARF-debug_line.yaml @@ -322,77 +322,78 @@ - argv - int - char - debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_producer - Form: DW_FORM_strp - - Attribute: DW_AT_language - Form: DW_FORM_data2 - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_stmt_list - Form: DW_FORM_sec_offset - - Attribute: DW_AT_comp_dir - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Code: 0x00000002 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Attribute: DW_AT_frame_base - Form: DW_FORM_exprloc - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_decl_line - Form: DW_FORM_data1 - - Attribute: DW_AT_prototyped - Form: DW_FORM_flag_present - - Attribute: DW_AT_type - Form: DW_FORM_ref4 - - Attribute: DW_AT_external - Form: DW_FORM_flag_present - - Code: 0x00000003 - Tag: DW_TAG_formal_parameter - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_location - Form: DW_FORM_exprloc - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_decl_line - Form: DW_FORM_data1 - - Attribute: DW_AT_type - Form: DW_FORM_ref4 - - Code: 0x00000004 - Tag: DW_TAG_base_type - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_encoding - Form: DW_FORM_data1 - - Attribute: DW_AT_byte_size - Form: DW_FORM_data1 - - Code: 0x00000005 - Tag: DW_TAG_pointer_type - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_type - Form: DW_FORM_ref4 + debug_abbrev: + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_producer + Form: DW_FORM_strp + - Attribute: DW_AT_language + Form: DW_FORM_data2 + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_stmt_list + Form: DW_FORM_sec_offset + - Attribute: DW_AT_comp_dir + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Code: 0x00000002 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Attribute: DW_AT_frame_base + Form: DW_FORM_exprloc + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_decl_file + Form: DW_FORM_data1 + - Attribute: DW_AT_decl_line + Form: DW_FORM_data1 + - Attribute: DW_AT_prototyped + Form: DW_FORM_flag_present + - Attribute: DW_AT_type + Form: DW_FORM_ref4 + - Attribute: DW_AT_external + Form: DW_FORM_flag_present + - Code: 0x00000003 + Tag: DW_TAG_formal_parameter + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_location + Form: DW_FORM_exprloc + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_decl_file + Form: DW_FORM_data1 + - Attribute: DW_AT_decl_line + Form: DW_FORM_data1 + - Attribute: DW_AT_type + Form: DW_FORM_ref4 + - Code: 0x00000004 + Tag: DW_TAG_base_type + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_encoding + Form: DW_FORM_data1 + - Attribute: DW_AT_byte_size + Form: DW_FORM_data1 + - Code: 0x00000005 + Tag: DW_TAG_pointer_type + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_type + Form: DW_FORM_ref4 debug_aranges: - Length: 44 Version: 2 diff --git a/llvm/test/ObjectYAML/MachO/DWARF-debug_ranges.yaml b/llvm/test/ObjectYAML/MachO/DWARF-debug_ranges.yaml --- a/llvm/test/ObjectYAML/MachO/DWARF-debug_ranges.yaml +++ b/llvm/test/ObjectYAML/MachO/DWARF-debug_ranges.yaml @@ -169,38 +169,39 @@ - stripped2 - main debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_language - Form: DW_FORM_data2 - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_ranges - Form: DW_FORM_sec_offset - - Code: 0x00000002 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Code: 0x00000003 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_addr + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_language + Form: DW_FORM_data2 + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_ranges + Form: DW_FORM_sec_offset + - Code: 0x00000002 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Code: 0x00000003 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_addr debug_ranges: - Offset: 0x00000000 Entries: diff --git a/llvm/test/ObjectYAML/MachO/DWARF2-AddrSize8-FormValues.yaml b/llvm/test/ObjectYAML/MachO/DWARF2-AddrSize8-FormValues.yaml --- a/llvm/test/ObjectYAML/MachO/DWARF2-AddrSize8-FormValues.yaml +++ b/llvm/test/ObjectYAML/MachO/DWARF2-AddrSize8-FormValues.yaml @@ -276,63 +276,64 @@ DWARF: debug_str: - World - debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_no - Attributes: - - Attribute: 0x2000 - Form: DW_FORM_addr - - Attribute: 0x2001 - Form: DW_FORM_block - - Attribute: DW_AT_MIPS_loop_begin - Form: DW_FORM_block1 - - Attribute: DW_AT_MIPS_tail_loop_begin - Form: DW_FORM_block2 - - Attribute: DW_AT_MIPS_epilog_begin - Form: DW_FORM_block4 - - Attribute: DW_AT_MIPS_loop_unroll_factor - Form: DW_FORM_data1 - - Attribute: DW_AT_MIPS_software_pipeline_depth - Form: DW_FORM_data2 - - Attribute: DW_AT_MIPS_linkage_name - Form: DW_FORM_data4 - - Attribute: DW_AT_MIPS_stride - Form: DW_FORM_data8 - - Attribute: DW_AT_MIPS_abstract_name - Form: DW_FORM_string - - Attribute: DW_AT_MIPS_clone_origin - Form: DW_FORM_strp - - Attribute: DW_AT_MIPS_has_inlines - Form: DW_FORM_ref_addr - - Attribute: DW_AT_MIPS_stride_byte - Form: DW_FORM_ref1 - - Attribute: DW_AT_MIPS_stride_elem - Form: DW_FORM_ref2 - - Attribute: DW_AT_MIPS_ptr_dopetype - Form: DW_FORM_ref4 - - Attribute: DW_AT_MIPS_allocatable_dopetype - Form: DW_FORM_ref8 - - Attribute: DW_AT_MIPS_assumed_shape_dopetype - Form: DW_FORM_ref_sig8 - - Attribute: DW_AT_MIPS_assumed_size - Form: DW_FORM_ref_udata - - Attribute: 0x2012 - Form: DW_FORM_flag - - Attribute: 0x2013 - Form: DW_FORM_flag - - Attribute: 0x2014 - Form: DW_FORM_flag_present - - Attribute: 0x2015 - Form: DW_FORM_sdata - - Attribute: 0x2017 - Form: DW_FORM_udata - - Attribute: 0x2018 - Form: DW_FORM_GNU_ref_alt - - Attribute: 0x2019 - Form: DW_FORM_sec_offset - - Attribute: 0x201A - Form: DW_FORM_addr + debug_abbrev: + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_no + Attributes: + - Attribute: 0x2000 + Form: DW_FORM_addr + - Attribute: 0x2001 + Form: DW_FORM_block + - Attribute: DW_AT_MIPS_loop_begin + Form: DW_FORM_block1 + - Attribute: DW_AT_MIPS_tail_loop_begin + Form: DW_FORM_block2 + - Attribute: DW_AT_MIPS_epilog_begin + Form: DW_FORM_block4 + - Attribute: DW_AT_MIPS_loop_unroll_factor + Form: DW_FORM_data1 + - Attribute: DW_AT_MIPS_software_pipeline_depth + Form: DW_FORM_data2 + - Attribute: DW_AT_MIPS_linkage_name + Form: DW_FORM_data4 + - Attribute: DW_AT_MIPS_stride + Form: DW_FORM_data8 + - Attribute: DW_AT_MIPS_abstract_name + Form: DW_FORM_string + - Attribute: DW_AT_MIPS_clone_origin + Form: DW_FORM_strp + - Attribute: DW_AT_MIPS_has_inlines + Form: DW_FORM_ref_addr + - Attribute: DW_AT_MIPS_stride_byte + Form: DW_FORM_ref1 + - Attribute: DW_AT_MIPS_stride_elem + Form: DW_FORM_ref2 + - Attribute: DW_AT_MIPS_ptr_dopetype + Form: DW_FORM_ref4 + - Attribute: DW_AT_MIPS_allocatable_dopetype + Form: DW_FORM_ref8 + - Attribute: DW_AT_MIPS_assumed_shape_dopetype + Form: DW_FORM_ref_sig8 + - Attribute: DW_AT_MIPS_assumed_size + Form: DW_FORM_ref_udata + - Attribute: 0x2012 + Form: DW_FORM_flag + - Attribute: 0x2013 + Form: DW_FORM_flag + - Attribute: 0x2014 + Form: DW_FORM_flag_present + - Attribute: 0x2015 + Form: DW_FORM_sdata + - Attribute: 0x2017 + Form: DW_FORM_udata + - Attribute: 0x2018 + Form: DW_FORM_GNU_ref_alt + - Attribute: 0x2019 + Form: DW_FORM_sec_offset + - Attribute: 0x201A + Form: DW_FORM_addr debug_info: - Length: 168 Version: 2 diff --git a/llvm/test/ObjectYAML/MachO/DWARF5-abbrevValues.yaml b/llvm/test/ObjectYAML/MachO/DWARF5-abbrevValues.yaml --- a/llvm/test/ObjectYAML/MachO/DWARF5-abbrevValues.yaml +++ b/llvm/test/ObjectYAML/MachO/DWARF5-abbrevValues.yaml @@ -274,14 +274,15 @@ reserved2: 0x00000000 reserved3: 0x00000000 DWARF: - debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: 0x2001 - Form: DW_FORM_implicit_const - Value: 0x12345678 + debug_abbrev: + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: 0x2001 + Form: DW_FORM_implicit_const + Value: 0x12345678 ... #CHECK: DWARF: diff --git a/llvm/test/ObjectYAML/MachO/DWARF5-debug_info.yaml b/llvm/test/ObjectYAML/MachO/DWARF5-debug_info.yaml --- a/llvm/test/ObjectYAML/MachO/DWARF5-debug_info.yaml +++ b/llvm/test/ObjectYAML/MachO/DWARF5-debug_info.yaml @@ -310,76 +310,77 @@ - _main DWARF: debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_producer - Form: DW_FORM_strp - - Attribute: DW_AT_language - Form: DW_FORM_data2 - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_stmt_list - Form: DW_FORM_sec_offset - - Attribute: DW_AT_comp_dir - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Code: 0x00000002 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Attribute: DW_AT_frame_base - Form: DW_FORM_exprloc - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_decl_line - Form: DW_FORM_data1 - - Attribute: DW_AT_prototyped - Form: DW_FORM_flag_present - - Attribute: DW_AT_type - Form: DW_FORM_ref4 - - Attribute: DW_AT_external - Form: DW_FORM_flag_present - - Code: 0x00000003 - Tag: DW_TAG_formal_parameter - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_location - Form: DW_FORM_exprloc - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_decl_line - Form: DW_FORM_data1 - - Attribute: DW_AT_type - Form: DW_FORM_ref4 - - Code: 0x00000004 - Tag: DW_TAG_base_type - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_encoding - Form: DW_FORM_data1 - - Attribute: DW_AT_byte_size - Form: DW_FORM_data1 - - Code: 0x00000005 - Tag: DW_TAG_pointer_type - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_type - Form: DW_FORM_ref4 + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_producer + Form: DW_FORM_strp + - Attribute: DW_AT_language + Form: DW_FORM_data2 + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_stmt_list + Form: DW_FORM_sec_offset + - Attribute: DW_AT_comp_dir + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Code: 0x00000002 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Attribute: DW_AT_frame_base + Form: DW_FORM_exprloc + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_decl_file + Form: DW_FORM_data1 + - Attribute: DW_AT_decl_line + Form: DW_FORM_data1 + - Attribute: DW_AT_prototyped + Form: DW_FORM_flag_present + - Attribute: DW_AT_type + Form: DW_FORM_ref4 + - Attribute: DW_AT_external + Form: DW_FORM_flag_present + - Code: 0x00000003 + Tag: DW_TAG_formal_parameter + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_location + Form: DW_FORM_exprloc + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_decl_file + Form: DW_FORM_data1 + - Attribute: DW_AT_decl_line + Form: DW_FORM_data1 + - Attribute: DW_AT_type + Form: DW_FORM_ref4 + - Code: 0x00000004 + Tag: DW_TAG_base_type + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_encoding + Form: DW_FORM_data1 + - Attribute: DW_AT_byte_size + Form: DW_FORM_data1 + - Code: 0x00000005 + Tag: DW_TAG_pointer_type + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_type + Form: DW_FORM_ref4 debug_aranges: - Length: 44 Version: 2 @@ -511,11 +512,11 @@ # DWARF32: DWARF: # DWARF32: debug_info: -# DWARF32-NEXT: - Length: 0x0000000000000076 -# DWARF32-NEXT: Version: 5 -# DWARF32-NEXT: UnitType: DW_UT_compile -# DWARF32-NEXT: AbbrOffset: 0 -# DWARF32-NEXT: AddrSize: 8 +# DWARF32-NEXT: - Length: 0x0000000000000076 +# DWARF32-NEXT: Version: 5 +# DWARF32-NEXT: UnitType: DW_UT_compile +# DWARF32-NEXT: AbbrOffset: 0 +# DWARF32-NEXT: AddrSize: 8 # DWARF32-NEXT: Entries: # DWARF32-NEXT: - AbbrCode: 0x00000001 # DWARF32-NEXT: Values: @@ -581,11 +582,11 @@ # RUN: obj2yaml | FileCheck %s --check-prefix=DWARF32-YAML # DWARF32-YAML: debug_info: -# DWARF32-YAML-NEXT: - Length: 0x000000000000000C -# DWARF32-YAML-NEXT: Version: 5 -# DWARF32-YAML-NEXT: UnitType: DW_UT_compile -# DWARF32-YAML-NEXT: AbbrOffset: 0x0000000000000000 -# DWARF32-YAML-NEXT: AddrSize: 8 +# DWARF32-YAML-NEXT: - Length: 0x000000000000000C +# DWARF32-YAML-NEXT: Version: 5 +# DWARF32-YAML-NEXT: UnitType: DW_UT_compile +# DWARF32-YAML-NEXT: AbbrOffset: 0x0000000000000000 +# DWARF32-YAML-NEXT: AddrSize: 8 # DWARF32-YAML-NEXT: Entries: # DWARF32-YAML-NEXT: - AbbrCode: 0x00000001 # DWARF32-YAML-NEXT: Values: @@ -640,12 +641,13 @@ reserved3: 0x00000000 DWARF: debug_abbrev: - - Code: 1 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr + - Table: + - Code: 1 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr debug_info: - Format: [[FORMAT]] Length: [[LENGTH]] @@ -664,12 +666,12 @@ # RUN: obj2yaml | FileCheck %s --check-prefix=DWARF64-YAML # DWARF64-YAML: debug_info: -# DWARF64-YAML-NEXT: - Format: DWARF64 -# DWARF64-YAML-NEXT: Length: 0x0000000000000014 -# DWARF64-YAML-NEXT: Version: 5 -# DWARF64-YAML-NEXT: UnitType: DW_UT_compile -# DWARF64-YAML-NEXT: AbbrOffset: 0x0000000000000000 -# DWARF64-YAML-NEXT: AddrSize: 8 +# DWARF64-YAML-NEXT: - Format: DWARF64 +# DWARF64-YAML-NEXT: Length: 0x0000000000000014 +# DWARF64-YAML-NEXT: Version: 5 +# DWARF64-YAML-NEXT: UnitType: DW_UT_compile +# DWARF64-YAML-NEXT: AbbrOffset: 0x0000000000000000 +# DWARF64-YAML-NEXT: AddrSize: 8 # DWARF64-YAML-NEXT: Entries: # DWARF64-YAML-NEXT: - AbbrCode: 0x00000001 # DWARF64-YAML-NEXT: Values: 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 --- a/llvm/test/tools/llvm-dwarfdump/X86/verify_attr_file_indexes.yaml +++ b/llvm/test/tools/llvm-dwarfdump/X86/verify_attr_file_indexes.yaml @@ -30,46 +30,47 @@ - main - inline1 debug_abbrev: - - Code: 0x0000000000000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_language - Form: DW_FORM_data2 - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_stmt_list - Form: DW_FORM_sec_offset - - Code: 0x0000000000000002 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_addr - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_call_line - Form: DW_FORM_data1 - - Code: 0x0000000000000003 - Tag: DW_TAG_inlined_subroutine - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Attribute: DW_AT_call_file - Form: DW_FORM_data1 - - Attribute: DW_AT_call_line - Form: DW_FORM_data1 + - Table: + - Code: 0x0000000000000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_language + Form: DW_FORM_data2 + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_stmt_list + Form: DW_FORM_sec_offset + - Code: 0x0000000000000002 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_addr + - Attribute: DW_AT_decl_file + Form: DW_FORM_data1 + - Attribute: DW_AT_call_line + Form: DW_FORM_data1 + - Code: 0x0000000000000003 + Tag: DW_TAG_inlined_subroutine + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Attribute: DW_AT_call_file + Form: DW_FORM_data1 + - Attribute: DW_AT_call_line + Form: DW_FORM_data1 debug_info: - Length: 0x0000000000000046 Version: 4 diff --git a/llvm/test/tools/llvm-dwarfdump/X86/verify_attr_file_indexes_no_files.yaml b/llvm/test/tools/llvm-dwarfdump/X86/verify_attr_file_indexes_no_files.yaml --- a/llvm/test/tools/llvm-dwarfdump/X86/verify_attr_file_indexes_no_files.yaml +++ b/llvm/test/tools/llvm-dwarfdump/X86/verify_attr_file_indexes_no_files.yaml @@ -30,46 +30,47 @@ - main - inline1 debug_abbrev: - - Code: 0x0000000000000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_language - Form: DW_FORM_data2 - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_stmt_list - Form: DW_FORM_sec_offset - - Code: 0x0000000000000002 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_addr - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_call_line - Form: DW_FORM_data1 - - Code: 0x0000000000000003 - Tag: DW_TAG_inlined_subroutine - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Attribute: DW_AT_call_file - Form: DW_FORM_data1 - - Attribute: DW_AT_call_line - Form: DW_FORM_data1 + - Table: + - Code: 0x0000000000000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_language + Form: DW_FORM_data2 + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_stmt_list + Form: DW_FORM_sec_offset + - Code: 0x0000000000000002 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_addr + - Attribute: DW_AT_decl_file + Form: DW_FORM_data1 + - Attribute: DW_AT_call_line + Form: DW_FORM_data1 + - Code: 0x0000000000000003 + Tag: DW_TAG_inlined_subroutine + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Attribute: DW_AT_call_file + Form: DW_FORM_data1 + - Attribute: DW_AT_call_line + Form: DW_FORM_data1 debug_info: - Length: 0x0000000000000046 Version: 4 diff --git a/llvm/test/tools/llvm-dwarfdump/X86/verify_file_encoding.yaml b/llvm/test/tools/llvm-dwarfdump/X86/verify_file_encoding.yaml --- a/llvm/test/tools/llvm-dwarfdump/X86/verify_file_encoding.yaml +++ b/llvm/test/tools/llvm-dwarfdump/X86/verify_file_encoding.yaml @@ -29,44 +29,45 @@ - '' - inline1 debug_abbrev: - - Code: 0x0000000000000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_language - Form: DW_FORM_data2 - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Code: 0x0000000000000002 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_addr - - Attribute: DW_AT_decl_file - Form: DW_FORM_strp - - Attribute: DW_AT_call_line - Form: DW_FORM_data1 - - Code: 0x0000000000000003 - Tag: DW_TAG_inlined_subroutine - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Attribute: DW_AT_call_file - Form: DW_FORM_strp - - Attribute: DW_AT_call_line - Form: DW_FORM_data1 + - Table: + - Code: 0x0000000000000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_language + Form: DW_FORM_data2 + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Code: 0x0000000000000002 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_addr + - Attribute: DW_AT_decl_file + Form: DW_FORM_strp + - Attribute: DW_AT_call_line + Form: DW_FORM_data1 + - Code: 0x0000000000000003 + Tag: DW_TAG_inlined_subroutine + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Attribute: DW_AT_call_file + Form: DW_FORM_strp + - Attribute: DW_AT_call_line + Form: DW_FORM_data1 debug_info: - Length: 0x0000000000000048 Version: 4 diff --git a/llvm/test/tools/llvm-dwarfdump/X86/verify_overlapping_cu_ranges.yaml b/llvm/test/tools/llvm-dwarfdump/X86/verify_overlapping_cu_ranges.yaml --- a/llvm/test/tools/llvm-dwarfdump/X86/verify_overlapping_cu_ranges.yaml +++ b/llvm/test/tools/llvm-dwarfdump/X86/verify_overlapping_cu_ranges.yaml @@ -178,38 +178,39 @@ - main - foo debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_language - Form: DW_FORM_data2 - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_ranges - Form: DW_FORM_sec_offset - - Code: 0x00000002 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Code: 0x00000003 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_addr + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_language + Form: DW_FORM_data2 + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_ranges + Form: DW_FORM_sec_offset + - Code: 0x00000002 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Code: 0x00000003 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_addr debug_ranges: - Offset: 0x00000000 AddrSize: 0x08 diff --git a/llvm/test/tools/llvm-gsymutil/ARM_AArch64/fat-macho-dwarf.yaml b/llvm/test/tools/llvm-gsymutil/ARM_AArch64/fat-macho-dwarf.yaml --- a/llvm/test/tools/llvm-gsymutil/ARM_AArch64/fat-macho-dwarf.yaml +++ b/llvm/test/tools/llvm-gsymutil/ARM_AArch64/fat-macho-dwarf.yaml @@ -299,84 +299,85 @@ - int - char debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_producer - Form: DW_FORM_strp - - Attribute: DW_AT_language - Form: DW_FORM_data2 - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_stmt_list - Form: DW_FORM_sec_offset - - Attribute: DW_AT_comp_dir - Form: DW_FORM_strp - - Attribute: DW_AT_GNU_pubnames - Form: DW_FORM_flag_present - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Code: 0x00000002 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Attribute: DW_AT_frame_base - Form: DW_FORM_exprloc - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_decl_line - Form: DW_FORM_data1 - - Attribute: DW_AT_type - Form: DW_FORM_ref_addr - - Attribute: DW_AT_external - Form: DW_FORM_flag_present - - Attribute: DW_AT_APPLE_isa - Form: DW_FORM_flag - - Code: 0x00000003 - Tag: DW_TAG_formal_parameter - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_location - Form: DW_FORM_exprloc - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_decl_line - Form: DW_FORM_data1 - - Attribute: DW_AT_type - Form: DW_FORM_ref_addr - - Code: 0x00000004 - Tag: DW_TAG_base_type - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_encoding - Form: DW_FORM_data1 - - Attribute: DW_AT_byte_size - Form: DW_FORM_data1 - - Code: 0x00000005 - Tag: DW_TAG_pointer_type - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_type - Form: DW_FORM_ref_addr - - Code: 0x00000006 - Tag: DW_TAG_const_type - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_type - Form: DW_FORM_ref_addr + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_producer + Form: DW_FORM_strp + - Attribute: DW_AT_language + Form: DW_FORM_data2 + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_stmt_list + Form: DW_FORM_sec_offset + - Attribute: DW_AT_comp_dir + Form: DW_FORM_strp + - Attribute: DW_AT_GNU_pubnames + Form: DW_FORM_flag_present + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Code: 0x00000002 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Attribute: DW_AT_frame_base + Form: DW_FORM_exprloc + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_decl_file + Form: DW_FORM_data1 + - Attribute: DW_AT_decl_line + Form: DW_FORM_data1 + - Attribute: DW_AT_type + Form: DW_FORM_ref_addr + - Attribute: DW_AT_external + Form: DW_FORM_flag_present + - Attribute: DW_AT_APPLE_isa + Form: DW_FORM_flag + - Code: 0x00000003 + Tag: DW_TAG_formal_parameter + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_location + Form: DW_FORM_exprloc + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_decl_file + Form: DW_FORM_data1 + - Attribute: DW_AT_decl_line + Form: DW_FORM_data1 + - Attribute: DW_AT_type + Form: DW_FORM_ref_addr + - Code: 0x00000004 + Tag: DW_TAG_base_type + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_encoding + Form: DW_FORM_data1 + - Attribute: DW_AT_byte_size + Form: DW_FORM_data1 + - Code: 0x00000005 + Tag: DW_TAG_pointer_type + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_type + Form: DW_FORM_ref_addr + - Code: 0x00000006 + Tag: DW_TAG_const_type + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_type + Form: DW_FORM_ref_addr debug_aranges: - Length: 28 Version: 2 @@ -777,82 +778,83 @@ - int - char debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_producer - Form: DW_FORM_strp - - Attribute: DW_AT_language - Form: DW_FORM_data2 - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_stmt_list - Form: DW_FORM_sec_offset - - Attribute: DW_AT_comp_dir - Form: DW_FORM_strp - - Attribute: DW_AT_GNU_pubnames - Form: DW_FORM_flag_present - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Code: 0x00000002 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Attribute: DW_AT_frame_base - Form: DW_FORM_exprloc - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_decl_line - Form: DW_FORM_data1 - - Attribute: DW_AT_type - Form: DW_FORM_ref_addr - - Attribute: DW_AT_external - Form: DW_FORM_flag_present - - Code: 0x00000003 - Tag: DW_TAG_formal_parameter - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_location - Form: DW_FORM_exprloc - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_decl_line - Form: DW_FORM_data1 - - Attribute: DW_AT_type - Form: DW_FORM_ref_addr - - Code: 0x00000004 - Tag: DW_TAG_base_type - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_encoding - Form: DW_FORM_data1 - - Attribute: DW_AT_byte_size - Form: DW_FORM_data1 - - Code: 0x00000005 - Tag: DW_TAG_pointer_type - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_type - Form: DW_FORM_ref_addr - - Code: 0x00000006 - Tag: DW_TAG_const_type - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_type - Form: DW_FORM_ref_addr + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_producer + Form: DW_FORM_strp + - Attribute: DW_AT_language + Form: DW_FORM_data2 + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_stmt_list + Form: DW_FORM_sec_offset + - Attribute: DW_AT_comp_dir + Form: DW_FORM_strp + - Attribute: DW_AT_GNU_pubnames + Form: DW_FORM_flag_present + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Code: 0x00000002 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Attribute: DW_AT_frame_base + Form: DW_FORM_exprloc + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_decl_file + Form: DW_FORM_data1 + - Attribute: DW_AT_decl_line + Form: DW_FORM_data1 + - Attribute: DW_AT_type + Form: DW_FORM_ref_addr + - Attribute: DW_AT_external + Form: DW_FORM_flag_present + - Code: 0x00000003 + Tag: DW_TAG_formal_parameter + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_location + Form: DW_FORM_exprloc + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_decl_file + Form: DW_FORM_data1 + - Attribute: DW_AT_decl_line + Form: DW_FORM_data1 + - Attribute: DW_AT_type + Form: DW_FORM_ref_addr + - Code: 0x00000004 + Tag: DW_TAG_base_type + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_encoding + Form: DW_FORM_data1 + - Attribute: DW_AT_byte_size + Form: DW_FORM_data1 + - Code: 0x00000005 + Tag: DW_TAG_pointer_type + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_type + Form: DW_FORM_ref_addr + - Code: 0x00000006 + Tag: DW_TAG_const_type + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_type + Form: DW_FORM_ref_addr debug_aranges: - Length: 44 Version: 2 diff --git a/llvm/test/tools/llvm-gsymutil/X86/mach-dwarf.yaml b/llvm/test/tools/llvm-gsymutil/X86/mach-dwarf.yaml --- a/llvm/test/tools/llvm-gsymutil/X86/mach-dwarf.yaml +++ b/llvm/test/tools/llvm-gsymutil/X86/mach-dwarf.yaml @@ -384,160 +384,161 @@ - argv - char debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_producer - Form: DW_FORM_strp - - Attribute: DW_AT_language - Form: DW_FORM_data2 - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_stmt_list - Form: DW_FORM_sec_offset - - Attribute: DW_AT_comp_dir - Form: DW_FORM_strp - - Attribute: DW_AT_GNU_pubnames - Form: DW_FORM_flag_present - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Code: 0x00000002 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Attribute: DW_AT_frame_base - Form: DW_FORM_exprloc - - Attribute: DW_AT_abstract_origin - Form: DW_FORM_ref_addr - - Code: 0x00000003 - Tag: DW_TAG_formal_parameter - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_location - Form: DW_FORM_exprloc - - Attribute: DW_AT_abstract_origin - Form: DW_FORM_ref_addr - - Code: 0x00000004 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_linkage_name - Form: DW_FORM_strp - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_decl_line - Form: DW_FORM_data1 - - Attribute: DW_AT_type - Form: DW_FORM_ref_addr - - Attribute: DW_AT_external - Form: DW_FORM_flag_present - - Attribute: DW_AT_inline - Form: DW_FORM_data1 - - Code: 0x00000005 - Tag: DW_TAG_formal_parameter - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_decl_line - Form: DW_FORM_data1 - - Attribute: DW_AT_type - Form: DW_FORM_ref_addr - - Code: 0x00000006 - Tag: DW_TAG_base_type - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_encoding - Form: DW_FORM_data1 - - Attribute: DW_AT_byte_size - Form: DW_FORM_data1 - - Code: 0x00000007 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Attribute: DW_AT_frame_base - Form: DW_FORM_exprloc - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_decl_line - Form: DW_FORM_data1 - - Attribute: DW_AT_type - Form: DW_FORM_ref_addr - - Attribute: DW_AT_external - Form: DW_FORM_flag_present - - Code: 0x00000008 - Tag: DW_TAG_formal_parameter - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_location - Form: DW_FORM_exprloc - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_decl_line - Form: DW_FORM_data1 - - Attribute: DW_AT_type - Form: DW_FORM_ref_addr - - Code: 0x00000009 - Tag: DW_TAG_variable - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_location - Form: DW_FORM_exprloc - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_decl_line - Form: DW_FORM_data1 - - Attribute: DW_AT_type - Form: DW_FORM_ref_addr - - Code: 0x0000000A - Tag: DW_TAG_inlined_subroutine - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_abstract_origin - Form: DW_FORM_ref_addr - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Attribute: DW_AT_call_file - Form: DW_FORM_data1 - - Attribute: DW_AT_call_line - Form: DW_FORM_data1 - - Code: 0x0000000B - Tag: DW_TAG_pointer_type - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_type - Form: DW_FORM_ref_addr - - Code: 0x0000000C - Tag: DW_TAG_const_type - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_type - Form: DW_FORM_ref_addr + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_producer + Form: DW_FORM_strp + - Attribute: DW_AT_language + Form: DW_FORM_data2 + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_stmt_list + Form: DW_FORM_sec_offset + - Attribute: DW_AT_comp_dir + Form: DW_FORM_strp + - Attribute: DW_AT_GNU_pubnames + Form: DW_FORM_flag_present + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Code: 0x00000002 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Attribute: DW_AT_frame_base + Form: DW_FORM_exprloc + - Attribute: DW_AT_abstract_origin + Form: DW_FORM_ref_addr + - Code: 0x00000003 + Tag: DW_TAG_formal_parameter + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_location + Form: DW_FORM_exprloc + - Attribute: DW_AT_abstract_origin + Form: DW_FORM_ref_addr + - Code: 0x00000004 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_linkage_name + Form: DW_FORM_strp + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_decl_file + Form: DW_FORM_data1 + - Attribute: DW_AT_decl_line + Form: DW_FORM_data1 + - Attribute: DW_AT_type + Form: DW_FORM_ref_addr + - Attribute: DW_AT_external + Form: DW_FORM_flag_present + - Attribute: DW_AT_inline + Form: DW_FORM_data1 + - Code: 0x00000005 + Tag: DW_TAG_formal_parameter + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_decl_file + Form: DW_FORM_data1 + - Attribute: DW_AT_decl_line + Form: DW_FORM_data1 + - Attribute: DW_AT_type + Form: DW_FORM_ref_addr + - Code: 0x00000006 + Tag: DW_TAG_base_type + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_encoding + Form: DW_FORM_data1 + - Attribute: DW_AT_byte_size + Form: DW_FORM_data1 + - Code: 0x00000007 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Attribute: DW_AT_frame_base + Form: DW_FORM_exprloc + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_decl_file + Form: DW_FORM_data1 + - Attribute: DW_AT_decl_line + Form: DW_FORM_data1 + - Attribute: DW_AT_type + Form: DW_FORM_ref_addr + - Attribute: DW_AT_external + Form: DW_FORM_flag_present + - Code: 0x00000008 + Tag: DW_TAG_formal_parameter + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_location + Form: DW_FORM_exprloc + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_decl_file + Form: DW_FORM_data1 + - Attribute: DW_AT_decl_line + Form: DW_FORM_data1 + - Attribute: DW_AT_type + Form: DW_FORM_ref_addr + - Code: 0x00000009 + Tag: DW_TAG_variable + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_location + Form: DW_FORM_exprloc + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_decl_file + Form: DW_FORM_data1 + - Attribute: DW_AT_decl_line + Form: DW_FORM_data1 + - Attribute: DW_AT_type + Form: DW_FORM_ref_addr + - Code: 0x0000000A + Tag: DW_TAG_inlined_subroutine + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_abstract_origin + Form: DW_FORM_ref_addr + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Attribute: DW_AT_call_file + Form: DW_FORM_data1 + - Attribute: DW_AT_call_line + Form: DW_FORM_data1 + - Code: 0x0000000B + Tag: DW_TAG_pointer_type + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_type + Form: DW_FORM_ref_addr + - Code: 0x0000000C + Tag: DW_TAG_const_type + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_type + Form: DW_FORM_ref_addr debug_aranges: - Length: 60 Version: 2 diff --git a/llvm/test/tools/llvm-objcopy/MachO/Inputs/strip-all-with-dwarf.yaml b/llvm/test/tools/llvm-objcopy/MachO/Inputs/strip-all-with-dwarf.yaml --- a/llvm/test/tools/llvm-objcopy/MachO/Inputs/strip-all-with-dwarf.yaml +++ b/llvm/test/tools/llvm-objcopy/MachO/Inputs/strip-all-with-dwarf.yaml @@ -312,84 +312,85 @@ - bar - main debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_producer - Form: DW_FORM_strp - - Attribute: DW_AT_language - Form: DW_FORM_data2 - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_stmt_list - Form: DW_FORM_sec_offset - - Attribute: DW_AT_comp_dir - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Code: 0x00000002 - Tag: DW_TAG_variable - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_type - Form: DW_FORM_ref4 - - Attribute: DW_AT_external - Form: DW_FORM_flag_present - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_decl_line - Form: DW_FORM_data1 - - Attribute: DW_AT_location - Form: DW_FORM_exprloc - - Code: 0x00000003 - Tag: DW_TAG_base_type - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_encoding - Form: DW_FORM_data1 - - Attribute: DW_AT_byte_size - Form: DW_FORM_data1 - - Code: 0x00000004 - Tag: DW_TAG_variable - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_type - Form: DW_FORM_ref4 - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_decl_line - Form: DW_FORM_data1 - - Attribute: DW_AT_location - Form: DW_FORM_exprloc - - Code: 0x00000005 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Attribute: DW_AT_frame_base - Form: DW_FORM_exprloc - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_decl_line - Form: DW_FORM_data1 - - Attribute: DW_AT_type - Form: DW_FORM_ref4 - - Attribute: DW_AT_external - Form: DW_FORM_flag_present + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_producer + Form: DW_FORM_strp + - Attribute: DW_AT_language + Form: DW_FORM_data2 + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_stmt_list + Form: DW_FORM_sec_offset + - Attribute: DW_AT_comp_dir + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Code: 0x00000002 + Tag: DW_TAG_variable + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_type + Form: DW_FORM_ref4 + - Attribute: DW_AT_external + Form: DW_FORM_flag_present + - Attribute: DW_AT_decl_file + Form: DW_FORM_data1 + - Attribute: DW_AT_decl_line + Form: DW_FORM_data1 + - Attribute: DW_AT_location + Form: DW_FORM_exprloc + - Code: 0x00000003 + Tag: DW_TAG_base_type + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_encoding + Form: DW_FORM_data1 + - Attribute: DW_AT_byte_size + Form: DW_FORM_data1 + - Code: 0x00000004 + Tag: DW_TAG_variable + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_type + Form: DW_FORM_ref4 + - Attribute: DW_AT_decl_file + Form: DW_FORM_data1 + - Attribute: DW_AT_decl_line + Form: DW_FORM_data1 + - Attribute: DW_AT_location + Form: DW_FORM_exprloc + - Code: 0x00000005 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Attribute: DW_AT_frame_base + Form: DW_FORM_exprloc + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_decl_file + Form: DW_FORM_data1 + - Attribute: DW_AT_decl_line + Form: DW_FORM_data1 + - Attribute: DW_AT_type + Form: DW_FORM_ref4 + - Attribute: DW_AT_external + Form: DW_FORM_flag_present debug_info: - Length: 113 Version: 4 diff --git a/llvm/test/tools/yaml2obj/ELF/DWARF/debug-abbrev.yaml b/llvm/test/tools/yaml2obj/ELF/DWARF/debug-abbrev.yaml --- a/llvm/test/tools/yaml2obj/ELF/DWARF/debug-abbrev.yaml +++ b/llvm/test/tools/yaml2obj/ELF/DWARF/debug-abbrev.yaml @@ -4,7 +4,7 @@ # RUN: yaml2obj --docnum=1 %s -o %t1.o # RUN: llvm-readobj --sections --section-data %t1.o | \ -# RUN: FileCheck -DSIZE=39 -DADDRALIGN=1 %s --check-prefixes=SHDR,CONTENT +# RUN: FileCheck -DSIZE=54 -DADDRALIGN=1 %s --check-prefixes=SHDR,CONTENT # SHDR: Index: 1 # SHDR-NEXT: Name: .debug_abbrev (1) @@ -42,9 +42,21 @@ ## ^--- Form: invalid ULEB128 (0x81) ^--- Attribute: reserved ULEB128 (0x2020) ## ^- Attribute: reserved ULEB128 ^- DW_FORM_implicit_const ULEB128 ## -# CONTENT-NEXT: 0020: CEC2F105 000000 |.......| +# CONTENT-NEXT: 0020: CEC2F105 00000001 ## ^------- Value SLEB128 (12345678) ^--- attr terminator ## ^- abbrev terminator +## ^- abbreviation code ULEB128 +# CONTENT: 1101250E 0000022E |..........%.....| +## ^- DW_TAG_compile_unit ULEB128 ^--- attr terminator +## ^- DW_CHILDREN_yes 1-byte ^- abbreviation code ULEB128 +## ^- DW_AT_producer ULEB128 ^- DW_TAG_subprogram ULEB128 +## ^- DW_FORM_strp ULEB128 +# CONTENT-NEXT: 0030: 01110100 0000 |......| +## ^- DW_CHILDREN_yes 1-byte +## ^- DW_AT_low_pc ULEB128 +## ^- DW_FORM_addr UELB128 +## ^---- attr terminator +## ^- abbrev table terminator # CONTENT-NEXT: ) --- !ELF @@ -55,42 +67,56 @@ Machine: EM_X86_64 DWARF: debug_abbrev: - - Code: 1 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_producer - Form: DW_FORM_strp - - Attribute: DW_AT_language - Form: DW_FORM_data2 - - Attribute: DW_AT_name - Form: DW_FORM_strx - - Code: 2 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_addrx - - Code: 3 - ## Test a reserved tag value. - Tag: 0x06 - Children: DW_CHILDREN_no - Attributes: - ## Test an attribute value that is more than one byte. - - Attribute: DW_AT_call_pc - ## Test a form value that is more than one byte. - Form: 0x81 - ## Test a reserved attribute value. - - Attribute: 0x04 - ## Test a reserved form value. - Form: 0x02 - - Attribute: 0x2020 - ## Test one special attribute form DW_FORM_implicit_const, - ## who is followed by a SLEB128 value. - Form: DW_FORM_implicit_const - Value: 12345678 + - Table: + - Code: 1 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_producer + Form: DW_FORM_strp + - Attribute: DW_AT_language + Form: DW_FORM_data2 + - Attribute: DW_AT_name + Form: DW_FORM_strx + - Code: 2 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_addrx + - Code: 3 + ## Test a reserved tag value. + Tag: 0x06 + Children: DW_CHILDREN_no + Attributes: + ## Test an attribute value that is more than one byte. + - Attribute: DW_AT_call_pc + ## Test a form value that is more than one byte. + Form: 0x81 + ## Test a reserved attribute value. + - Attribute: 0x04 + ## Test a reserved form value. + Form: 0x02 + - Attribute: 0x2020 + ## Test one special attribute form DW_FORM_implicit_const, + ## who is followed by a SLEB128 value. + Form: DW_FORM_implicit_const + Value: 12345678 + - Table: + - Code: 1 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_producer + Form: DW_FORM_strp + - Code: 2 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr ## b) Generate the .debug_abbrev section from raw section content. @@ -153,10 +179,11 @@ Size: 0x10 DWARF: debug_abbrev: - - Code: 1 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_no - Attributes: [] + - Table: + - Code: 1 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_no + Attributes: [] ## e) Test that yaml2obj emits an error message when both the "Content" and the ## "debug_abbrev" entry are specified at the same time. @@ -175,10 +202,11 @@ Content: "00" DWARF: debug_abbrev: - - Code: 1 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_no - Attributes: [] + - Table: + - Code: 1 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_no + Attributes: [] ## f) Test that all the properties can be overridden by the section header when ## the "debug_abbrev" entry doesn't exist. @@ -236,10 +264,11 @@ Type: SHT_STRTAB DWARF: debug_abbrev: - - Code: 1 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_no - Attributes: [] + - Table: + - Code: 1 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_no + Attributes: [] ## h) Test that yaml2obj automatically generates abbreviation codes for us. @@ -264,23 +293,24 @@ Machine: EM_X86_64 DWARF: debug_abbrev: - - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_no - Attributes: [] - - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_no - Attributes: [] - - Code: 4 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_no - Attributes: [] - - Code: 4 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_no - Attributes: [] - - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_no - Attributes: [] - - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_no - Attributes: [] + - Table: + - Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_no + Attributes: [] + - Tag: DW_TAG_subprogram + Children: DW_CHILDREN_no + Attributes: [] + - Code: 4 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_no + Attributes: [] + - Code: 4 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_no + Attributes: [] + - Tag: DW_TAG_subprogram + Children: DW_CHILDREN_no + Attributes: [] + - Tag: DW_TAG_subprogram + Children: DW_CHILDREN_no + Attributes: [] diff --git a/llvm/test/tools/yaml2obj/ELF/DWARF/debug-info.yaml b/llvm/test/tools/yaml2obj/ELF/DWARF/debug-info.yaml --- a/llvm/test/tools/yaml2obj/ELF/DWARF/debug-info.yaml +++ b/llvm/test/tools/yaml2obj/ELF/DWARF/debug-info.yaml @@ -116,95 +116,96 @@ Machine: EM_X86_64 DWARF: debug_abbrev: - - Code: 1 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_no - Attributes: - - Attribute: 0x01 - Form: DW_FORM_addr ## 0x01 - - Attribute: 0x01 - Form: DW_FORM_block2 ## 0x03 - - Attribute: 0x01 - Form: DW_FORM_block4 ## 0x04 - - Attribute: 0x01 - Form: DW_FORM_data2 ## 0x05 - - Attribute: 0x01 - Form: DW_FORM_data4 ## 0x06 - - Attribute: 0x01 - Form: DW_FORM_data8 ## 0x07 - - Attribute: 0x01 - Form: DW_FORM_string ## 0x08 - - Attribute: 0x01 - Form: DW_FORM_block ## 0x09 - - Attribute: 0x01 - Form: DW_FORM_block1 ## 0x0a - - Attribute: 0x01 - Form: DW_FORM_data1 ## 0x0b - - Attribute: 0x01 - Form: DW_FORM_flag ## 0x0c - - Attribute: 0x01 - Form: DW_FORM_sdata ## 0x0d - - Attribute: 0x01 - Form: DW_FORM_strp ## 0x0e - - Attribute: 0x01 - Form: DW_FORM_udata ## 0x0f - - Attribute: 0x01 - Form: DW_FORM_ref_addr ## 0x10 - - Attribute: 0x01 - Form: DW_FORM_ref1 ## 0x11 - - Attribute: 0x01 - Form: DW_FORM_ref2 ## 0x12 - - Attribute: 0x01 - Form: DW_FORM_ref4 ## 0x13 - - Attribute: 0x01 - Form: DW_FORM_ref8 ## 0x14 - - Attribute: 0x01 - Form: DW_FORM_ref_udata ## 0x15 - - Attribute: 0x01 - Form: DW_FORM_indirect ## 0x16 - - Attribute: 0x01 - Form: DW_FORM_sec_offset ## 0x17 - - Attribute: 0x01 - Form: DW_FORM_exprloc ## 0x18 - - Attribute: 0x01 - Form: DW_FORM_strx ## 0x1a - - Attribute: 0x01 - Form: DW_FORM_addrx ## 0x1b - - Attribute: 0x01 - Form: DW_FORM_ref_sup4 ## 0x1c - - Attribute: 0x01 - Form: DW_FORM_strp_sup ## 0x1d - - Attribute: 0x01 - Form: DW_FORM_data16 ## 0x1e - - Attribute: 0x01 - Form: DW_FORM_line_strp ## 0x1f - - Attribute: 0x01 - Form: DW_FORM_ref_sig8 ## 0x20 - - Attribute: 0x01 - Form: DW_FORM_implicit_const ## 0x21 - Value: 0x01 - - Attribute: 0x01 - Form: DW_FORM_loclistx ## 0x22 - - Attribute: 0x01 - Form: DW_FORM_rnglistx ## 0x23 - - Attribute: 0x01 - Form: DW_FORM_ref_sup8 ## 0x24 - - Attribute: 0x01 - Form: DW_FORM_strx1 ## 0x25 - - Attribute: 0x01 - Form: DW_FORM_strx2 ## 0x26 - - Attribute: 0x01 - Form: DW_FORM_strx3 ## 0x27 - - Attribute: 0x01 - Form: DW_FORM_strx4 ## 0x28 - - Attribute: 0x01 - Form: DW_FORM_addrx1 ## 0x29 - - Attribute: 0x01 - Form: DW_FORM_addrx2 ## 0x2a - - Attribute: 0x01 - Form: DW_FORM_addrx3 ## 0x2b - - Attribute: 0x01 - Form: DW_FORM_addrx4 ## 0x2c + - Table: + - Code: 1 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_no + Attributes: + - Attribute: 0x01 + Form: DW_FORM_addr ## 0x01 + - Attribute: 0x01 + Form: DW_FORM_block2 ## 0x03 + - Attribute: 0x01 + Form: DW_FORM_block4 ## 0x04 + - Attribute: 0x01 + Form: DW_FORM_data2 ## 0x05 + - Attribute: 0x01 + Form: DW_FORM_data4 ## 0x06 + - Attribute: 0x01 + Form: DW_FORM_data8 ## 0x07 + - Attribute: 0x01 + Form: DW_FORM_string ## 0x08 + - Attribute: 0x01 + Form: DW_FORM_block ## 0x09 + - Attribute: 0x01 + Form: DW_FORM_block1 ## 0x0a + - Attribute: 0x01 + Form: DW_FORM_data1 ## 0x0b + - Attribute: 0x01 + Form: DW_FORM_flag ## 0x0c + - Attribute: 0x01 + Form: DW_FORM_sdata ## 0x0d + - Attribute: 0x01 + Form: DW_FORM_strp ## 0x0e + - Attribute: 0x01 + Form: DW_FORM_udata ## 0x0f + - Attribute: 0x01 + Form: DW_FORM_ref_addr ## 0x10 + - Attribute: 0x01 + Form: DW_FORM_ref1 ## 0x11 + - Attribute: 0x01 + Form: DW_FORM_ref2 ## 0x12 + - Attribute: 0x01 + Form: DW_FORM_ref4 ## 0x13 + - Attribute: 0x01 + Form: DW_FORM_ref8 ## 0x14 + - Attribute: 0x01 + Form: DW_FORM_ref_udata ## 0x15 + - Attribute: 0x01 + Form: DW_FORM_indirect ## 0x16 + - Attribute: 0x01 + Form: DW_FORM_sec_offset ## 0x17 + - Attribute: 0x01 + Form: DW_FORM_exprloc ## 0x18 + - Attribute: 0x01 + Form: DW_FORM_strx ## 0x1a + - Attribute: 0x01 + Form: DW_FORM_addrx ## 0x1b + - Attribute: 0x01 + Form: DW_FORM_ref_sup4 ## 0x1c + - Attribute: 0x01 + Form: DW_FORM_strp_sup ## 0x1d + - Attribute: 0x01 + Form: DW_FORM_data16 ## 0x1e + - Attribute: 0x01 + Form: DW_FORM_line_strp ## 0x1f + - Attribute: 0x01 + Form: DW_FORM_ref_sig8 ## 0x20 + - Attribute: 0x01 + Form: DW_FORM_implicit_const ## 0x21 + Value: 0x01 + - Attribute: 0x01 + Form: DW_FORM_loclistx ## 0x22 + - Attribute: 0x01 + Form: DW_FORM_rnglistx ## 0x23 + - Attribute: 0x01 + Form: DW_FORM_ref_sup8 ## 0x24 + - Attribute: 0x01 + Form: DW_FORM_strx1 ## 0x25 + - Attribute: 0x01 + Form: DW_FORM_strx2 ## 0x26 + - Attribute: 0x01 + Form: DW_FORM_strx3 ## 0x27 + - Attribute: 0x01 + Form: DW_FORM_strx4 ## 0x28 + - Attribute: 0x01 + Form: DW_FORM_addrx1 ## 0x29 + - Attribute: 0x01 + Form: DW_FORM_addrx2 ## 0x2a + - Attribute: 0x01 + Form: DW_FORM_addrx3 ## 0x2b + - Attribute: 0x01 + Form: DW_FORM_addrx4 ## 0x2c debug_info: - Length: 0x1234 Version: 5 @@ -267,20 +268,20 @@ - Value: 0x1234 ## DW_FORM_addrx2 - Value: 0x123456 ## DW_FORM_addrx3 (unimplemented) - Value: 0x12345678 ## DW_FORM_addrx4 - - Length: 0x1234 - Version: 5 + - Length: 0x1234 + Version: 5 ## Test another unit type. - UnitType: DW_UT_compile - AbbrOffset: 0x1234 - AddrSize: 4 + UnitType: DW_UT_compile + AbbrOffset: 0x1234 + AddrSize: 4 Entries: - AbbrCode: 0 Values: [] - - Length: 0x5678 + - Length: 0x5678 ## Test DWARFv4 - Version: 4 - AbbrOffset: 0x5678 - AddrSize: 4 + Version: 4 + AbbrOffset: 0x5678 + AddrSize: 4 Entries: - AbbrCode: 1 Values: @@ -444,10 +445,11 @@ Size: 0x10 DWARF: debug_abbrev: - - Code: 1 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_no - Attributes: [] + - Table: + - Code: 1 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_no + Attributes: [] debug_info: - Length: 0x1234 Version: 5 @@ -472,10 +474,11 @@ Content: "00" DWARF: debug_abbrev: - - Code: 1 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_no - Attributes: [] + - Table: + - Code: 1 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_no + Attributes: [] debug_info: - Length: 0x1234 Version: 5 @@ -539,10 +542,11 @@ Type: SHT_STRTAB DWARF: debug_abbrev: - - Code: 1 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_no - Attributes: [] + - Table: + - Code: 1 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_no + Attributes: [] debug_info: - Length: 0x1234 Version: 5 @@ -606,20 +610,21 @@ Machine: EM_X86_64 DWARF: debug_abbrev: - - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_low_pc - Form: DW_FORM_data4 - - Attribute: DW_AT_high_pc - Form: DW_FORM_data2 - - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_low_pc - Form: DW_FORM_data2 - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 + - Table: + - Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_low_pc + Form: DW_FORM_data4 + - Attribute: DW_AT_high_pc + Form: DW_FORM_data2 + - Tag: DW_TAG_subprogram + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_low_pc + Form: DW_FORM_data2 + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 debug_info: - Length: 0x1234 Version: 5 @@ -657,6 +662,8 @@ Type: ET_EXEC Machine: EM_X86_64 DWARF: + debug_abbrev: + - Table: [] debug_info: - Length: 0x1234 Version: 5 @@ -787,34 +794,35 @@ - "/home/v/x/llvm/playground" - "main" debug_abbrev: - - Code: 1 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_producer - Form: DW_FORM_strp - - Attribute: DW_AT_language - Form: DW_FORM_data2 - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_stmt_list - Form: DW_FORM_sec_offset - - Attribute: DW_AT_comp_dir - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Code: 2 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Attribute: DW_AT_name - Form: DW_FORM_strp + - Table: + - Code: 1 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_producer + Form: DW_FORM_strp + - Attribute: DW_AT_language + Form: DW_FORM_data2 + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_stmt_list + Form: DW_FORM_sec_offset + - Attribute: DW_AT_comp_dir + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Code: 2 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Attribute: DW_AT_name + Form: DW_FORM_strp debug_info: - Version: 4 AbbrOffset: 0x00 @@ -888,3 +896,24 @@ debug_info: - Version: 4 AbbrOffset: 0x00 + +## 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 + +# NO-ABBREV: yaml2obj: error: non-empty compilation unit should have an associated abbrev table + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_EXEC + Machine: EM_X86_64 +DWARF: + debug_info: + - Version: 4 + AbbrOffset: 0x00 + Entries: + - AbbrCode: 1 + Values: + - Value: 0x1234 diff --git a/llvm/tools/obj2yaml/dwarf2yaml.cpp b/llvm/tools/obj2yaml/dwarf2yaml.cpp --- a/llvm/tools/obj2yaml/dwarf2yaml.cpp +++ b/llvm/tools/obj2yaml/dwarf2yaml.cpp @@ -23,6 +23,7 @@ auto AbbrevSetPtr = DCtx.getDebugAbbrev(); if (AbbrevSetPtr) { for (auto AbbrvDeclSet : *AbbrevSetPtr) { + Y.DebugAbbrev.emplace_back(); for (auto AbbrvDecl : AbbrvDeclSet.second) { DWARFYAML::Abbrev Abbrv; Abbrv.Code = AbbrvDecl.getCode(); @@ -37,7 +38,7 @@ AttAbrv.Value = Attribute.getImplicitConstValue(); Abbrv.Attributes.push_back(AttAbrv); } - Y.AbbrevDecls.push_back(Abbrv); + Y.DebugAbbrev.back().Table.push_back(Abbrv); } } } diff --git a/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp b/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp --- a/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp +++ b/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp @@ -1363,10 +1363,11 @@ TEST(DWARFDebugInfo, TestEmptyChildren) { const char *yamldata = "debug_abbrev:\n" - " - Code: 0x00000001\n" - " Tag: DW_TAG_compile_unit\n" - " Children: DW_CHILDREN_yes\n" - " Attributes:\n" + " - Table:\n" + " - Code: 0x00000001\n" + " Tag: DW_TAG_compile_unit\n" + " Children: DW_CHILDREN_yes\n" + " Attributes:\n" "debug_info:\n" " - Version: 4\n" " AbbrOffset: 0\n" @@ -1885,20 +1886,21 @@ - /tmp/main.c - main debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Code: 0x00000002 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_type - Form: DW_FORM_ref4 + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Code: 0x00000002 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_type + Form: DW_FORM_ref4 debug_info: - Length: 22 Version: 4 @@ -1933,20 +1935,21 @@ - /tmp/main.c - main debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Code: 0x00000002 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_type - Form: DW_FORM_ref_addr + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Code: 0x00000002 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_type + Form: DW_FORM_ref_addr debug_info: - Length: 22 Version: 4 @@ -1979,14 +1982,15 @@ - '' - /tmp/main.c debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_ranges - Form: DW_FORM_sec_offset + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_ranges + Form: DW_FORM_sec_offset debug_info: - Length: 16 Version: 4 @@ -2016,14 +2020,15 @@ - '' - /tmp/main.c debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_ranges - Form: DW_FORM_sec_offset + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_ranges + Form: DW_FORM_sec_offset debug_info: - Length: 17 Version: 5 @@ -2053,14 +2058,15 @@ - '' - /tmp/main.c debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_stmt_list - Form: DW_FORM_sec_offset + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_stmt_list + Form: DW_FORM_sec_offset debug_info: - Length: 16 Version: 4 @@ -2089,12 +2095,13 @@ debug_str: - '' debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp debug_info: - Length: 12 Version: 4 @@ -2122,20 +2129,21 @@ - /tmp/main.c - main debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Code: 0x00000002 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_type - Form: DW_FORM_ref_addr + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Code: 0x00000002 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_type + Form: DW_FORM_ref_addr debug_info: - Length: 22 Version: 4 @@ -2169,14 +2177,15 @@ - '' - /tmp/main.c debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_stmt_list - Form: DW_FORM_sec_offset + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_stmt_list + Form: DW_FORM_sec_offset debug_info: - Length: 16 Version: 4 @@ -2237,14 +2246,15 @@ - '' - /tmp/main.c debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_stmt_list - Form: DW_FORM_sec_offset + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_stmt_list + Form: DW_FORM_sec_offset debug_info: - Length: 16 Version: 4 @@ -2307,14 +2317,15 @@ - '' - /tmp/main.c debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_stmt_list - Form: DW_FORM_sec_offset + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_stmt_list + Form: DW_FORM_sec_offset debug_info: - Length: 16 Version: 4 @@ -2378,14 +2389,15 @@ - '' - /tmp/main.c debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_stmt_list - Form: DW_FORM_sec_offset + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_stmt_list + Form: DW_FORM_sec_offset debug_info: - Length: 16 Version: 4 @@ -2454,14 +2466,15 @@ - /tmp/main.c - /tmp/foo.c debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_stmt_list - Form: DW_FORM_sec_offset + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_stmt_list + Form: DW_FORM_sec_offset debug_info: - Length: 16 Version: 4 @@ -2569,24 +2582,25 @@ - '' - /tmp/main.c debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_addr - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Code: 0x00000002 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_addr + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_addr + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Code: 0x00000002 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_addr debug_info: - Length: 46 Version: 4 @@ -2622,30 +2636,31 @@ - /tmp/main.c - main debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Code: 0x00000002 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_addr - - Code: 0x00000003 - Tag: DW_TAG_lexical_block - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_addr + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Code: 0x00000002 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_addr + - Code: 0x00000003 + Tag: DW_TAG_lexical_block + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_addr debug_info: - Length: 52 Version: 4 @@ -2687,22 +2702,23 @@ - main - foo debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Code: 0x00000002 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_addr + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Code: 0x00000002 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_addr debug_info: - Length: 55 Version: 4 @@ -2741,34 +2757,35 @@ - /tmp/main.c - main debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_addr - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Code: 0x00000002 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_addr - - Code: 0x00000003 - Tag: DW_TAG_lexical_block - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_addr + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_addr + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Code: 0x00000002 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_addr + - Code: 0x00000003 + Tag: DW_TAG_lexical_block + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_addr debug_info: - Length: 85 Version: 4 @@ -2814,22 +2831,23 @@ - /tmp/main.c - main debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Code: 0x00000002 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_addr + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Code: 0x00000002 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_addr debug_info: - Length: 34 Version: 4 @@ -2866,26 +2884,27 @@ - main - elided debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_addr - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Code: 0x00000002 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_addr + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_addr + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Code: 0x00000002 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_addr debug_info: - Length: 71 Version: 4 @@ -2928,26 +2947,27 @@ - main - nested debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_addr - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Code: 0x00000002 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_addr + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_addr + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Code: 0x00000002 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_addr debug_info: - Length: 73 Version: 4 diff --git a/llvm/unittests/DebugInfo/DWARF/DWARFDieTest.cpp b/llvm/unittests/DebugInfo/DWARF/DWARFDieTest.cpp --- a/llvm/unittests/DebugInfo/DWARF/DWARFDieTest.cpp +++ b/llvm/unittests/DebugInfo/DWARF/DWARFDieTest.cpp @@ -21,18 +21,19 @@ TEST(DWARFDie, getLocations) { const char *yamldata = R"( debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_location - Form: DW_FORM_sec_offset - - Attribute: DW_AT_data_member_location - Form: DW_FORM_exprloc - - Attribute: DW_AT_vtable_elem_location - Form: DW_FORM_sec_offset - - Attribute: DW_AT_call_data_location - Form: DW_FORM_sec_offset + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_location + Form: DW_FORM_sec_offset + - Attribute: DW_AT_data_member_location + Form: DW_FORM_exprloc + - Attribute: DW_AT_vtable_elem_location + Form: DW_FORM_sec_offset + - Attribute: DW_AT_call_data_location + Form: DW_FORM_sec_offset debug_info: - Version: 5 UnitType: DW_UT_compile diff --git a/llvm/unittests/DebugInfo/GSYM/GSYMTest.cpp b/llvm/unittests/DebugInfo/GSYM/GSYMTest.cpp --- a/llvm/unittests/DebugInfo/GSYM/GSYMTest.cpp +++ b/llvm/unittests/DebugInfo/GSYM/GSYMTest.cpp @@ -1414,28 +1414,29 @@ - /tmp/main.c - main debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_addr - - Attribute: DW_AT_language - Form: DW_FORM_data2 - - Code: 0x00000002 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_addr + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_addr + - Attribute: DW_AT_language + Form: DW_FORM_data2 + - Code: 0x00000002 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_addr debug_info: - Length: 52 Version: 4 @@ -1493,28 +1494,29 @@ - /tmp/main.c - main debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Attribute: DW_AT_language - Form: DW_FORM_data2 - - Code: 0x00000002 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Attribute: DW_AT_language + Form: DW_FORM_data2 + - Code: 0x00000002 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 debug_info: - Length: 44 Version: 4 @@ -1576,44 +1578,45 @@ - dump - this debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_addr - - Attribute: DW_AT_language - Form: DW_FORM_data2 - - Code: 0x00000002 - Tag: DW_TAG_structure_type - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Code: 0x00000003 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_addr - - Code: 0x00000004 - Tag: DW_TAG_formal_parameter - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_type - Form: DW_FORM_ref4 - - Attribute: DW_AT_artificial - Form: DW_FORM_flag_present + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_addr + - Attribute: DW_AT_language + Form: DW_FORM_data2 + - Code: 0x00000002 + Tag: DW_TAG_structure_type + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Code: 0x00000003 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_addr + - Code: 0x00000004 + Tag: DW_TAG_formal_parameter + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_type + Form: DW_FORM_ref4 + - Attribute: DW_AT_artificial + Form: DW_FORM_flag_present debug_info: - Length: 68 Version: 4 @@ -1696,28 +1699,29 @@ - dead_stripped - dead_stripped2 debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Attribute: DW_AT_language - Form: DW_FORM_data2 - - Code: 0x00000002 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Attribute: DW_AT_language + Form: DW_FORM_data2 + - Code: 0x00000002 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 debug_info: - Length: 78 Version: 4 @@ -1793,44 +1797,45 @@ - main - inline1 debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Attribute: DW_AT_language - Form: DW_FORM_data2 - - Attribute: DW_AT_stmt_list - Form: DW_FORM_sec_offset - - Code: 0x00000002 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Code: 0x00000003 - Tag: DW_TAG_inlined_subroutine - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Attribute: DW_AT_call_file - Form: DW_FORM_data4 - - Attribute: DW_AT_call_line - Form: DW_FORM_data4 + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Attribute: DW_AT_language + Form: DW_FORM_data2 + - Attribute: DW_AT_stmt_list + Form: DW_FORM_sec_offset + - Code: 0x00000002 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Code: 0x00000003 + Tag: DW_TAG_inlined_subroutine + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Attribute: DW_AT_call_file + Form: DW_FORM_data4 + - Attribute: DW_AT_call_line + Form: DW_FORM_data4 debug_info: - Length: 74 Version: 4 @@ -2048,44 +2053,45 @@ - no_lines_no_decl - no_lines_with_decl debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Attribute: DW_AT_language - Form: DW_FORM_data2 - - Attribute: DW_AT_stmt_list - Form: DW_FORM_sec_offset - - Code: 0x00000002 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Code: 0x00000003 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Attribute: DW_AT_decl_file - Form: DW_FORM_data1 - - Attribute: DW_AT_decl_line - Form: DW_FORM_data1 + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Attribute: DW_AT_language + Form: DW_FORM_data2 + - Attribute: DW_AT_stmt_list + Form: DW_FORM_sec_offset + - Code: 0x00000002 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Code: 0x00000003 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Attribute: DW_AT_decl_file + Form: DW_FORM_data1 + - Attribute: DW_AT_decl_line + Form: DW_FORM_data1 debug_info: - Length: 103 Version: 4 @@ -2293,7 +2299,6 @@ // // 0x0000004e: NULL - StringRef yamldata = R"( debug_str: - '' @@ -2303,38 +2308,39 @@ - stripped2 - stripped3 debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Attribute: DW_AT_language - Form: DW_FORM_data2 - - Code: 0x00000002 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Code: 0x00000003 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_addr + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Attribute: DW_AT_language + Form: DW_FORM_data2 + - Code: 0x00000002 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Code: 0x00000003 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_addr debug_info: - Length: 75 Version: 4 @@ -2445,38 +2451,39 @@ - stripped2 - stripped3 debug_abbrev: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_yes - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Attribute: DW_AT_language - Form: DW_FORM_data2 - - Code: 0x00000002 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_data4 - - Code: 0x00000003 - Tag: DW_TAG_subprogram - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_name - Form: DW_FORM_strp - - Attribute: DW_AT_low_pc - Form: DW_FORM_addr - - Attribute: DW_AT_high_pc - Form: DW_FORM_addr + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Attribute: DW_AT_language + Form: DW_FORM_data2 + - Code: 0x00000002 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Code: 0x00000003 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_name + Form: DW_FORM_strp + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_addr debug_info: - Length: 103 Version: 4