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/DWARFEmitter.h b/llvm/include/llvm/ObjectYAML/DWARFEmitter.h --- a/llvm/include/llvm/ObjectYAML/DWARFEmitter.h +++ b/llvm/include/llvm/ObjectYAML/DWARFEmitter.h @@ -17,6 +17,7 @@ #include "llvm/Support/Error.h" #include "llvm/Support/Host.h" #include "llvm/Support/MemoryBuffer.h" +#include #include namespace llvm { @@ -28,23 +29,35 @@ struct Data; struct PubSection; -Error emitDebugAbbrev(raw_ostream &OS, const Data &DI); -Error emitDebugStr(raw_ostream &OS, const Data &DI); - -Error emitDebugAranges(raw_ostream &OS, const Data &DI); -Error emitDebugRanges(raw_ostream &OS, const Data &DI); -Error emitDebugPubnames(raw_ostream &OS, const Data &DI); -Error emitDebugPubtypes(raw_ostream &OS, const Data &DI); -Error emitDebugGNUPubnames(raw_ostream &OS, const Data &DI); -Error emitDebugGNUPubtypes(raw_ostream &OS, const Data &DI); -Error emitDebugInfo(raw_ostream &OS, const Data &DI); -Error emitDebugLine(raw_ostream &OS, const Data &DI); -Error emitDebugAddr(raw_ostream &OS, const Data &DI); -Error emitDebugStrOffsets(raw_ostream &OS, const Data &DI); -Error emitDebugRnglists(raw_ostream &OS, const Data &DI); -Error emitDebugLoclists(raw_ostream &OS, const Data &DI); - -std::function +class DWARFState { +private: + Data &DWARF; + std::map AbbrevID2Index; + + DWARFState(Data &DI, Error &Err); + +public: + static Expected create(Data &DI); + Data &getDWARFData() const { return DWARF; } + Optional getAbbrevTableIndexByID(uint64_t ID) const; +}; + +Error emitDebugAbbrev(raw_ostream &OS, const DWARFState &DS); +Error emitDebugStr(raw_ostream &OS, const DWARFState &DS); +Error emitDebugAranges(raw_ostream &OS, const DWARFState &DS); +Error emitDebugRanges(raw_ostream &OS, const DWARFState &DS); +Error emitDebugPubnames(raw_ostream &OS, const DWARFState &DS); +Error emitDebugPubtypes(raw_ostream &OS, const DWARFState &DS); +Error emitDebugGNUPubnames(raw_ostream &OS, const DWARFState &DS); +Error emitDebugGNUPubtypes(raw_ostream &OS, const DWARFState &DS); +Error emitDebugInfo(raw_ostream &OS, const DWARFState &DS); +Error emitDebugLine(raw_ostream &OS, const DWARFState &DS); +Error emitDebugAddr(raw_ostream &OS, const DWARFState &DS); +Error emitDebugStrOffsets(raw_ostream &OS, const DWARFState &DS); +Error emitDebugRnglists(raw_ostream &OS, const DWARFState &DS); +Error emitDebugLoclists(raw_ostream &OS, const DWARFState &DS); + +std::function getDWARFEmitterByName(StringRef SecName); Expected>> emitDebugSections(StringRef YAMLString, 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,11 @@ std::vector Attributes; }; +struct AbbrevTable { + Optional ID; + std::vector Table; +}; + struct ARangeDescriptor { llvm::yaml::Hex64 Address; yaml::Hex64 Length; @@ -106,6 +111,7 @@ uint16_t Version; Optional AddrSize; llvm::dwarf::UnitType Type; // Added in DWARF 5 + Optional AbbrevTableID; yaml::Hex64 AbbrOffset; std::vector Entries; }; @@ -203,7 +209,7 @@ struct Data { bool IsLittleEndian; bool Is64BitAddrSize; - std::vector AbbrevDecls; + std::vector DebugAbbrev; std::vector DebugStrings; Optional> DebugStrOffsets; Optional> DebugAranges; @@ -231,6 +237,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 +271,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 @@ -85,7 +85,46 @@ OS, IsLittleEndian)); } -Error DWARFYAML::emitDebugStr(raw_ostream &OS, const DWARFYAML::Data &DI) { +DWARFYAML::DWARFState::DWARFState(DWARFYAML::Data &DI, Error &Err) : DWARF(DI) { + ErrorAsOutParameter EAO(&Err); + + for (uint64_t I = 0; I < DI.DebugAbbrev.size(); ++I) { + // If the abbrev table's ID isn't specified, we use the index as its ID. + uint64_t ID = I; + if (DI.DebugAbbrev[I].ID) + ID = *DI.DebugAbbrev[I].ID; + + if (AbbrevID2Index.count(ID)) { + Err = createStringError(errc::invalid_argument, + "the ID (%" PRIu64 + ") of abbrev table with index %" PRIu64 + " has been used", + ID, I); + return; + } + AbbrevID2Index.insert({ID, I}); + } +} + +Optional +DWARFYAML::DWARFState::getAbbrevTableIndexByID(uint64_t ID) const { + auto It = AbbrevID2Index.find(ID); + if (It == AbbrevID2Index.end()) + return None; + return It->second; +} + +Expected +DWARFYAML::DWARFState::create(DWARFYAML::Data &DI) { + Error Err = Error::success(); + DWARFState DS(DI, Err); + if (Err) + return std::move(Err); + return std::move(DS); +} + +Error DWARFYAML::emitDebugStr(raw_ostream &OS, const DWARFState &DS) { + const DWARFYAML::Data &DI = DS.getDWARFData(); for (auto Str : DI.DebugStrings) { OS.write(Str.data(), Str.size()); OS.write('\0'); @@ -94,31 +133,36 @@ return Error::success(); } -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); +Error DWARFYAML::emitDebugAbbrev(raw_ostream &OS, const DWARFState &DS) { + const DWARFYAML::Data &DI = DS.getDWARFData(); + for (const DWARFYAML::AbbrevTable &AbbrevTable : DI.DebugAbbrev) { + uint64_t AbbrevCode = 0; + for (auto 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(); } -Error DWARFYAML::emitDebugAranges(raw_ostream &OS, const DWARFYAML::Data &DI) { +Error DWARFYAML::emitDebugAranges(raw_ostream &OS, const DWARFState &DS) { + const DWARFYAML::Data &DI = DS.getDWARFData(); assert(DI.DebugAranges && "unexpected emitDebugAranges() call"); for (auto Range : *DI.DebugAranges) { uint8_t AddrSize; @@ -167,7 +211,8 @@ return Error::success(); } -Error DWARFYAML::emitDebugRanges(raw_ostream &OS, const DWARFYAML::Data &DI) { +Error DWARFYAML::emitDebugRanges(raw_ostream &OS, const DWARFState &DS) { + const DWARFYAML::Data &DI = DS.getDWARFData(); const size_t RangesOffset = OS.tell(); uint64_t EntryIndex = 0; for (auto DebugRanges : DI.DebugRanges) { @@ -221,29 +266,34 @@ return Error::success(); } -Error DWARFYAML::emitDebugPubnames(raw_ostream &OS, const Data &DI) { +Error DWARFYAML::emitDebugPubnames(raw_ostream &OS, const DWARFState &DS) { + const DWARFYAML::Data &DI = DS.getDWARFData(); assert(DI.PubNames && "unexpected emitDebugPubnames() call"); return emitPubSection(OS, *DI.PubNames, DI.IsLittleEndian); } -Error DWARFYAML::emitDebugPubtypes(raw_ostream &OS, const Data &DI) { +Error DWARFYAML::emitDebugPubtypes(raw_ostream &OS, const DWARFState &DS) { + const DWARFYAML::Data &DI = DS.getDWARFData(); assert(DI.PubTypes && "unexpected emitDebugPubtypes() call"); return emitPubSection(OS, *DI.PubTypes, DI.IsLittleEndian); } -Error DWARFYAML::emitDebugGNUPubnames(raw_ostream &OS, const Data &DI) { +Error DWARFYAML::emitDebugGNUPubnames(raw_ostream &OS, const DWARFState &DS) { + const DWARFYAML::Data &DI = DS.getDWARFData(); assert(DI.GNUPubNames && "unexpected emitDebugGNUPubnames() call"); return emitPubSection(OS, *DI.GNUPubNames, DI.IsLittleEndian, /*IsGNUStyle=*/true); } -Error DWARFYAML::emitDebugGNUPubtypes(raw_ostream &OS, const Data &DI) { +Error DWARFYAML::emitDebugGNUPubtypes(raw_ostream &OS, const DWARFState &DS) { + const DWARFYAML::Data &DI = DS.getDWARFData(); assert(DI.GNUPubTypes && "unexpected emitDebugGNUPubtypes() call"); return emitPubSection(OS, *DI.GNUPubTypes, DI.IsLittleEndian, /*IsGNUStyle=*/true); } -static Expected writeDIE(ArrayRef AbbrevDecls, +static Expected writeDIE(const DWARFYAML::DWARFState &DS, + uint64_t AbbrevTableID, const dwarf::FormParams &Params, const DWARFYAML::Entry &Entry, raw_ostream &OS, bool IsLittleEndian) { @@ -253,6 +303,15 @@ if (AbbrCode == 0 || Entry.Values.empty()) return OS.tell() - EntryBegin; + Optional AbbrevTableIndex = + DS.getAbbrevTableIndexByID(AbbrevTableID); + if (!AbbrevTableIndex) + return createStringError(errc::invalid_argument, + "cannot find abbrev table whose ID is " + + utostr(AbbrevTableID)); + ArrayRef AbbrevDecls( + DS.getDWARFData().DebugAbbrev[*AbbrevTableIndex].Table); + if (AbbrCode > AbbrevDecls.size()) return createStringError( errc::invalid_argument, @@ -373,8 +432,10 @@ return OS.tell() - EntryBegin; } -Error DWARFYAML::emitDebugInfo(raw_ostream &OS, const DWARFYAML::Data &DI) { - for (const DWARFYAML::Unit &Unit : DI.CompileUnits) { +Error DWARFYAML::emitDebugInfo(raw_ostream &OS, const DWARFState &DS) { + const DWARFYAML::Data &DI = DS.getDWARFData(); + for (uint64_t I = 0; I < DI.CompileUnits.size(); ++I) { + const DWARFYAML::Unit &Unit = DI.CompileUnits[I]; uint8_t AddrSize; if (Unit.AddrSize) AddrSize = *Unit.AddrSize; @@ -392,9 +453,16 @@ std::string EntryBuffer; raw_string_ostream EntryBufferOS(EntryBuffer); + // If the abbrev table's ID isn't specified, we use the compilation unit's + // index as the ID. + uint64_t AbbrevTableID = I; + if (Unit.AbbrevTableID) + AbbrevTableID = *Unit.AbbrevTableID; + for (const DWARFYAML::Entry &Entry : Unit.Entries) { - if (Expected EntryLength = writeDIE( - DI.AbbrevDecls, Params, Entry, EntryBufferOS, DI.IsLittleEndian)) + if (Expected EntryLength = + writeDIE(DS, AbbrevTableID, Params, Entry, EntryBufferOS, + DI.IsLittleEndian)) Length += *EntryLength; else return EntryLength.takeError(); @@ -430,7 +498,8 @@ encodeULEB128(File.Length, OS); } -Error DWARFYAML::emitDebugLine(raw_ostream &OS, const DWARFYAML::Data &DI) { +Error DWARFYAML::emitDebugLine(raw_ostream &OS, const DWARFState &DS) { + const DWARFYAML::Data &DI = DS.getDWARFData(); for (const auto &LineTable : DI.DebugLines) { writeInitialLength(LineTable.Format, LineTable.Length, OS, DI.IsLittleEndian); @@ -520,7 +589,8 @@ return Error::success(); } -Error DWARFYAML::emitDebugAddr(raw_ostream &OS, const Data &DI) { +Error DWARFYAML::emitDebugAddr(raw_ostream &OS, const DWARFState &DS) { + const DWARFYAML::Data &DI = DS.getDWARFData(); for (const AddrTableEntry &TableEntry : DI.DebugAddr) { uint8_t AddrSize; if (TableEntry.AddrSize) @@ -561,7 +631,8 @@ return Error::success(); } -Error DWARFYAML::emitDebugStrOffsets(raw_ostream &OS, const Data &DI) { +Error DWARFYAML::emitDebugStrOffsets(raw_ostream &OS, const DWARFState &DS) { + const DWARFYAML::Data &DI = DS.getDWARFData(); assert(DI.DebugStrOffsets && "unexpected emitDebugStrOffsets() call"); for (const DWARFYAML::StringOffsetsTable &Table : *DI.DebugStrOffsets) { uint64_t Length; @@ -885,23 +956,26 @@ return Error::success(); } -Error DWARFYAML::emitDebugRnglists(raw_ostream &OS, const Data &DI) { +Error DWARFYAML::emitDebugRnglists(raw_ostream &OS, const DWARFState &DS) { + const DWARFYAML::Data &DI = DS.getDWARFData(); assert(DI.DebugRnglists && "unexpected emitDebugRnglists() call"); return writeDWARFLists( OS, *DI.DebugRnglists, DI.IsLittleEndian, DI.Is64BitAddrSize); } -Error DWARFYAML::emitDebugLoclists(raw_ostream &OS, const Data &DI) { +Error DWARFYAML::emitDebugLoclists(raw_ostream &OS, const DWARFState &DS) { + const DWARFYAML::Data &DI = DS.getDWARFData(); assert(DI.DebugLoclists && "unexpected emitDebugRnglists() call"); return writeDWARFLists( OS, *DI.DebugLoclists, DI.IsLittleEndian, DI.Is64BitAddrSize); } -std::function +std::function DWARFYAML::getDWARFEmitterByName(StringRef SecName) { auto EmitFunc = StringSwitch< - std::function>(SecName) + std::function>( + SecName) .Case("debug_abbrev", DWARFYAML::emitDebugAbbrev) .Case("debug_addr", DWARFYAML::emitDebugAddr) .Case("debug_aranges", DWARFYAML::emitDebugAranges) @@ -916,7 +990,7 @@ .Case("debug_rnglists", DWARFYAML::emitDebugRnglists) .Case("debug_str", DWARFYAML::emitDebugStr) .Case("debug_str_offsets", DWARFYAML::emitDebugStrOffsets) - .Default([&](raw_ostream &, const DWARFYAML::Data &) { + .Default([&](raw_ostream &, const DWARFYAML::DWARFState &) { return createStringError(errc::not_supported, SecName + " is not supported"); }); @@ -925,14 +999,14 @@ } static Error -emitDebugSectionImpl(const DWARFYAML::Data &DI, StringRef Sec, +emitDebugSectionImpl(const DWARFYAML::DWARFState &DS, StringRef Sec, StringMap> &OutputBuffers) { std::string Data; raw_string_ostream DebugInfoStream(Data); auto EmitFunc = DWARFYAML::getDWARFEmitterByName(Sec); - if (Error Err = EmitFunc(DebugInfoStream, DI)) + if (Error Err = EmitFunc(DebugInfoStream, DS)) return Err; DebugInfoStream.flush(); if (!Data.empty()) @@ -964,9 +1038,13 @@ Error Err = Error::success(); cantFail(std::move(Err)); + Expected DSOrErr = DWARFState::create(DI); + if (!DSOrErr) + return DSOrErr.takeError(); + for (StringRef SecName : DI.getNonEmptySectionNames()) Err = joinErrors(std::move(Err), - emitDebugSectionImpl(DI, SecName, DebugSections)); + emitDebugSectionImpl(*DSOrErr, SecName, DebugSections)); if (Err) return std::move(Err); 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,12 @@ IO.setContext(OldContext); } +void MappingTraits::mapping( + IO &IO, DWARFYAML::AbbrevTable &AbbrevTable) { + IO.mapOptional("ID", AbbrevTable.ID); + IO.mapOptional("Table", AbbrevTable.Table); +} + void MappingTraits::mapping(IO &IO, DWARFYAML::Abbrev &Abbrev) { IO.mapOptional("Code", Abbrev.Code); @@ -148,6 +154,7 @@ IO.mapRequired("Version", Unit.Version); if (Unit.Version >= 5) IO.mapRequired("UnitType", Unit.Type); + IO.mapOptional("AbbrevTableID", Unit.AbbrevTableID); IO.mapRequired("AbbrOffset", Unit.AbbrOffset); IO.mapOptional("AddrSize", Unit.AddrSize); IO.mapOptional("Entries", Unit.Entries); diff --git a/llvm/lib/ObjectYAML/ELFEmitter.cpp b/llvm/lib/ObjectYAML/ELFEmitter.cpp --- a/llvm/lib/ObjectYAML/ELFEmitter.cpp +++ b/llvm/lib/ObjectYAML/ELFEmitter.cpp @@ -193,6 +193,7 @@ NameToIdxMap SymN2I; NameToIdxMap DynSymN2I; ELFYAML::Object &Doc; + Optional DWARFState; StringSet<> ExcludedSectionHeaders; @@ -354,11 +355,19 @@ ImplicitSections.insert(ImplicitSections.end(), {".dynsym", ".dynstr"}); if (Doc.Symbols) ImplicitSections.push_back(".symtab"); - if (Doc.DWARF) - for (StringRef DebugSecName : Doc.DWARF->getNonEmptySectionNames()) { - std::string SecName = ("." + DebugSecName).str(); - ImplicitSections.push_back(StringRef(SecName).copy(StringAlloc)); + if (Doc.DWARF) { + if (Expected DSOrErr = + DWARFYAML::DWARFState::create(*Doc.DWARF)) { + DWARFState.emplace(*DSOrErr); + for (StringRef DebugSecName : + DWARFState->getDWARFData().getNonEmptySectionNames()) { + std::string SecName = ("." + DebugSecName).str(); + ImplicitSections.push_back(StringRef(SecName).copy(StringAlloc)); + } + } else { + reportError(DSOrErr.takeError()); } + } ImplicitSections.insert(ImplicitSections.end(), {".strtab", ".shstrtab"}); // Insert placeholders for implicit sections that are not @@ -932,14 +941,14 @@ assignSectionAddress(SHeader, YAMLSec); } -static bool shouldEmitDWARF(DWARFYAML::Data &DWARF, StringRef Name) { +static bool shouldEmitDWARF(const DWARFYAML::Data &DWARF, StringRef Name) { SetVector DebugSecNames = DWARF.getNonEmptySectionNames(); return Name.consume_front(".") && DebugSecNames.count(Name); } template Expected emitDWARF(typename ELFT::Shdr &SHeader, StringRef Name, - const DWARFYAML::Data &DWARF, + const DWARFYAML::DWARFState &DS, ContiguousBlobAccumulator &CBA) { // We are unable to predict the size of debug data, so we request to write 0 // bytes. This should always return us an output stream unless CBA is already @@ -951,7 +960,7 @@ uint64_t BeginOffset = CBA.tell(); auto EmitFunc = DWARFYAML::getDWARFEmitterByName(Name.substr(1)); - if (Error Err = EmitFunc(*OS, DWARF)) + if (Error Err = EmitFunc(*OS, DS)) return std::move(Err); return CBA.tell() - BeginOffset; @@ -970,14 +979,14 @@ ELFYAML::RawContentSection *RawSec = dyn_cast_or_null(YAMLSec); - if (Doc.DWARF && shouldEmitDWARF(*Doc.DWARF, Name)) { + if (DWARFState && shouldEmitDWARF(DWARFState->getDWARFData(), Name)) { if (RawSec && (RawSec->Content || RawSec->Size)) reportError("cannot specify section '" + Name + "' contents in the 'DWARF' entry and the 'Content' " "or 'Size' in the 'Sections' entry at the same time"); else { if (Expected ShSizeOrErr = - emitDWARF(SHeader, Name, *Doc.DWARF, CBA)) + emitDWARF(SHeader, Name, *DWARFState, CBA)) SHeader.sh_size = *ShSizeOrErr; else reportError(ShSizeOrErr.takeError()); diff --git a/llvm/lib/ObjectYAML/MachOEmitter.cpp b/llvm/lib/ObjectYAML/MachOEmitter.cpp --- a/llvm/lib/ObjectYAML/MachOEmitter.cpp +++ b/llvm/lib/ObjectYAML/MachOEmitter.cpp @@ -13,6 +13,7 @@ #include "llvm/BinaryFormat/MachO.h" #include "llvm/ObjectYAML/DWARFEmitter.h" +#include "llvm/ObjectYAML/DWARFYAML.h" #include "llvm/ObjectYAML/ObjectYAML.h" #include "llvm/ObjectYAML/yaml2obj.h" #include "llvm/Support/Errc.h" @@ -266,6 +267,18 @@ } Error MachOWriter::writeSectionData(raw_ostream &OS) { + // There might be DWARF sections and they might be interlinked. We use + // DWARFState to get them interlinked. + Optional DWARFState; + if (!Obj.DWARF.isEmpty()) { + Expected DSOrErr = + DWARFYAML::DWARFState::create(Obj.DWARF); + if (DSOrErr) + DWARFState.emplace(*DSOrErr); + else + return DSOrErr.takeError(); + } + for (auto &LC : Obj.LoadCommands) { switch (LC.Data.load_command_data.cmd) { case MachO::LC_SEGMENT: @@ -285,13 +298,15 @@ return createStringError( errc::invalid_argument, "wrote too much data somewhere, section offsets don't line up"); - if (0 == strncmp(&Sec.segname[0], "__DWARF", sizeof(Sec.segname))) { + if (0 == strncmp(&Sec.segname[0], "__DWARF", sizeof(Sec.segname)) && + DWARFState) { StringRef SectName(Sec.sectname, strnlen(Sec.sectname, sizeof(Sec.sectname))); - if (Obj.DWARF.getNonEmptySectionNames().count(SectName.substr(2))) { + const DWARFYAML::Data &DWARF = DWARFState->getDWARFData(); + if (DWARF.getNonEmptySectionNames().count(SectName.substr(2))) { auto EmitFunc = DWARFYAML::getDWARFEmitterByName(SectName.substr(2)); - if (Error Err = EmitFunc(OS, Obj.DWARF)) + if (Error Err = EmitFunc(OS, *DWARFState)) return Err; } 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 @@ -274,77 +274,78 @@ 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 + 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 ... #CHECK: DWARF: 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,11 @@ # 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: AbbrevTableID: 0 +# DWARF32-NEXT: AbbrOffset: 0 +# DWARF32-NEXT: AddrSize: 8 # DWARF32-NEXT: Entries: # DWARF32-NEXT: - AbbrCode: 0x00000001 # DWARF32-NEXT: Values: @@ -580,10 +582,11 @@ # 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: AbbrevTableID: 0 +# 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 +640,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,12 +665,299 @@ # 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: AbbrevTableID: 0 +# DWARF64-YAML-NEXT: AbbrOffset: 0 +# DWARF64-YAML-NEXT: AddrSize: 8 # DWARF64-YAML-NEXT: Entries: # DWARF64-YAML-NEXT: - AbbrCode: 0x00000001 # DWARF64-YAML-NEXT: Values: # DWARF64-YAML-NEXT: - Value: 0x0000000000001234 + +## c) Test that yaml2obj is able to generate compilation units according to the +## associated abbrev table that is referenced by the 'AbbrevTableID' and obj2yaml +## is able to convert it back. + +# RUN: yaml2obj --docnum=3 %s | obj2yaml | FileCheck %s --check-prefix=MULTI-TABLES + +# MULTI-TABLES: DWARF: +# MULTI-TABLES-NEXT: debug_abbrev: +# MULTI-TABLES-NEXT: - ID: 0 +# MULTI-TABLES-NEXT: Table: +# MULTI-TABLES-NEXT: - Code: 0x0000000000000001 +# MULTI-TABLES-NEXT: Tag: DW_TAG_compile_unit +# MULTI-TABLES-NEXT: Children: DW_CHILDREN_no +# MULTI-TABLES-NEXT: Attributes: +# MULTI-TABLES-NEXT: - Attribute: DW_AT_low_pc +# MULTI-TABLES-NEXT: Form: DW_FORM_addr +# MULTI-TABLES-NEXT: - ID: 1 +# MULTI-TABLES-NEXT: Table: +# MULTI-TABLES-NEXT: - Code: 0x0000000000000001 +# MULTI-TABLES-NEXT: Tag: DW_TAG_compile_unit +# MULTI-TABLES-NEXT: Children: DW_CHILDREN_no +# MULTI-TABLES-NEXT: Attributes: +# MULTI-TABLES-NEXT: - Attribute: DW_AT_low_pc +# MULTI-TABLES-NEXT: Form: DW_FORM_data4 +# MULTI-TABLES-NEXT: - ID: 2 +# MULTI-TABLES-NEXT: Table: +# MULTI-TABLES-NEXT: - Code: 0x0000000000000001 +# MULTI-TABLES-NEXT: Tag: DW_TAG_compile_unit +# MULTI-TABLES-NEXT: Children: DW_CHILDREN_no +# MULTI-TABLES-NEXT: Attributes: +# MULTI-TABLES-NEXT: - Attribute: DW_AT_low_pc +# MULTI-TABLES-NEXT: Form: DW_FORM_udata +# MULTI-TABLES-NEXT: debug_info: +# MULTI-TABLES-NEXT: - Length: 0x000000000000000C +# MULTI-TABLES-NEXT: Version: 4 +# MULTI-TABLES-NEXT: AbbrevTableID: 1 +# MULTI-TABLES-NEXT: AbbrOffset: 0x0000000000000008 +# MULTI-TABLES-NEXT: AddrSize: 8 +# MULTI-TABLES-NEXT: Entries: +# MULTI-TABLES-NEXT: - AbbrCode: 0x00000001 +# MULTI-TABLES-NEXT: Values: +# MULTI-TABLES-NEXT: - Value: 0x0000000000001234 +# MULTI-TABLES-NEXT: - Length: 0x000000000000000C +# MULTI-TABLES-NEXT: Version: 4 +# MULTI-TABLES-NEXT: AbbrevTableID: 1 +# MULTI-TABLES-NEXT: AbbrOffset: 0x0000000000000008 +# MULTI-TABLES-NEXT: AddrSize: 8 +# MULTI-TABLES-NEXT: Entries: +# MULTI-TABLES-NEXT: - AbbrCode: 0x00000001 +# MULTI-TABLES-NEXT: Values: +# MULTI-TABLES-NEXT: - Value: 0x0000000000004321 +# MULTI-TABLES-NEXT: - Length: 0x0000000000000010 +# MULTI-TABLES-NEXT: Version: 4 +# MULTI-TABLES-NEXT: AbbrevTableID: 0 +# MULTI-TABLES-NEXT: AbbrOffset: 0x0000000000000000 +# MULTI-TABLES-NEXT: AddrSize: 8 +# MULTI-TABLES-NEXT: Entries: +# MULTI-TABLES-NEXT: - AbbrCode: 0x00000001 +# MULTI-TABLES-NEXT: Values: +# MULTI-TABLES-NEXT: - Value: 0x0000000000005678 +# MULTI-TABLES-NEXT: ... + +--- !mach-o +FileHeader: + magic: 0xFEEDFACF + cputype: 0x01000007 + cpusubtype: 0x00000003 + filetype: 0x0000000A + ncmds: 1 + sizeofcmds: 232 + flags: 0x00000000 + reserved: 0x00000000 +LoadCommands: + - cmd: LC_SEGMENT_64 + cmdsize: 232 + segname: __DWARF + vmaddr: 0x00 + vmsize: 0x00 + fileoff: 0x00 + filesize: 0x00 + maxprot: 0 + initprot: 0 + nsects: 2 + flags: 0 + Sections: + - sectname: __debug_abbrev + segname: __DWARF + addr: 0x00 + size: 24 + offset: 528 + align: 0 + reloff: 0x00000000 + nreloc: 0 + flags: 0x00000000 + reserved1: 0x00000000 + reserved2: 0x00000000 + reserved3: 0x00000000 + - sectname: __debug_info + segname: __DWARF + addr: 0x00 + size: 64 + offset: 1070 + 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_no + Attributes: + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - ID: 2 + Table: + - Code: 1 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_low_pc + Form: DW_FORM_data4 + - ID: 1 + Table: + - Code: 1 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_low_pc + Form: DW_FORM_udata + debug_info: + - Version: 4 + AbbrevTableID: 2 + AbbrOffset: 8 + Entries: + - AbbrCode: 1 + Values: + - Value: 0x1234 + - Version: 4 + AbbrevTableID: 2 + AbbrOffset: 8 + Entries: + - AbbrCode: 1 + Values: + - Value: 0x4321 + - Version: 4 + AbbrevTableID: 0 + AbbrOffset: 0 + Entries: + - AbbrCode: 1 + Values: + - Value: 0x5678 + - Version: 4 + AbbrevTableID: 1 + AbbrOffset: 16 + Entries: + - AbbrCode: 1 + Values: + - Value: 0x8765 + +## d) Test that yaml2obj emits an error message when a compilation unit doesn't have +## an associated abbrev table. + +# RUN: not yaml2obj --docnum=4 %s 2>&1 | FileCheck %s --check-prefix=MISSING-ABBREV + +# MISSING-ABBREV: yaml2obj: error: cannot find abbrev table whose ID is 0 + +--- !mach-o +FileHeader: + magic: 0xFEEDFACF + cputype: 0x01000007 + cpusubtype: 0x00000003 + filetype: 0x0000000A + ncmds: 1 + sizeofcmds: 232 + flags: 0x00000000 + reserved: 0x00000000 +LoadCommands: + - cmd: LC_SEGMENT_64 + cmdsize: 232 + segname: __DWARF + vmaddr: 0x00 + vmsize: 0x00 + fileoff: 0x00 + filesize: 0x00 + maxprot: 0 + initprot: 0 + nsects: 2 + flags: 0 + Sections: + - sectname: __debug_abbrev + segname: __DWARF + addr: 0x00 + size: 24 + offset: 528 + align: 0 + reloff: 0x00000000 + nreloc: 0 + flags: 0x00000000 + reserved1: 0x00000000 + reserved2: 0x00000000 + reserved3: 0x00000000 + - sectname: __debug_info + segname: __DWARF + addr: 0x00 + size: 64 + offset: 1070 + align: 0 + reloff: 0x00000000 + nreloc: 0 + flags: 0x00000000 + reserved1: 0x00000000 + reserved2: 0x00000000 + reserved3: 0x00000000 +DWARF: + debug_info: + - Version: 4 + AbbrOffset: 0x00 + Entries: + - AbbrCode: 1 + Values: + - Value: 0x1234 + +## e) Test that yaml2obj emits an error message when multiple abbrev tables are assigned +## the same ID. + +# RUN: not yaml2obj --docnum=5 %s 2>&1 | FileCheck %s --check-prefix=ID-COLLISION + +# ID-COLLISION: yaml2obj: error: the ID (1) of abbrev table with index 1 has been used + +--- !mach-o +FileHeader: + magic: 0xFEEDFACF + cputype: 0x01000007 + cpusubtype: 0x00000003 + filetype: 0x0000000A + ncmds: 1 + sizeofcmds: 232 + flags: 0x00000000 + reserved: 0x00000000 +LoadCommands: + - cmd: LC_SEGMENT_64 + cmdsize: 232 + segname: __DWARF + vmaddr: 0x00 + vmsize: 0x00 + fileoff: 0x00 + filesize: 0x00 + maxprot: 0 + initprot: 0 + nsects: 2 + flags: 0 + Sections: + - sectname: __debug_abbrev + segname: __DWARF + addr: 0x00 + size: 24 + offset: 528 + align: 0 + reloff: 0x00000000 + nreloc: 0 + flags: 0x00000000 + reserved1: 0x00000000 + reserved2: 0x00000000 + reserved3: 0x00000000 + - sectname: __debug_info + segname: __DWARF + addr: 0x00 + size: 64 + offset: 1070 + align: 0 + reloff: 0x00000000 + nreloc: 0 + flags: 0x00000000 + reserved1: 0x00000000 + reserved2: 0x00000000 + reserved3: 0x00000000 +DWARF: + debug_abbrev: + - ID: 1 + - ID: 1 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,12 @@ # 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: AbbrevTableID: 0 +# DWARF32-NEXT: AbbrOffset: 0 +# DWARF32-NEXT: AddrSize: 8 # DWARF32-NEXT: Entries: # DWARF32-NEXT: - AbbrCode: 0x00000001 # DWARF32-NEXT: Values: @@ -581,11 +583,12 @@ # 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: AbbrevTableID: 0 +# 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 +643,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 +668,13 @@ # 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: AbbrevTableID: 0 +# 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 @@ -55,42 +55,43 @@ 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 ## b) Generate the .debug_abbrev section from raw section content. @@ -153,10 +154,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 +177,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 +239,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 +268,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,22 @@ - 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 + AbbrevTableID: 0 + AbbrOffset: 0x1234 + AddrSize: 4 Entries: - AbbrCode: 0 Values: [] - - Length: 0x5678 + - Length: 0x5678 ## Test DWARFv4 - Version: 4 - AbbrOffset: 0x5678 - AddrSize: 4 + Version: 4 + AbbrevTableID: 0 + AbbrOffset: 0x5678 + AddrSize: 4 Entries: - AbbrCode: 1 Values: @@ -444,10 +447,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 +476,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 +544,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 +612,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 +664,8 @@ Type: ET_EXEC Machine: EM_X86_64 DWARF: + debug_abbrev: + - ID: 0 debug_info: - Length: 0x1234 Version: 5 @@ -787,34 +796,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 +898,43 @@ debug_info: - Version: 4 AbbrOffset: 0x00 + +## n) Test that yaml2obj emits an error message when a compilation unit doesn't have +## an associated abbrev table. + +# RUN: not yaml2obj --docnum=16 %s 2>&1 | FileCheck %s --check-prefix=MISSING-ABBREV + +# MISSING-ABBREV: yaml2obj: error: cannot find abbrev table whose ID is 0 + +--- !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 + +## o) Test that yaml2obj emits an error message when multiple abbrev tables are assigned +## the same ID. + +# RUN: not yaml2obj --docnum=17 %s 2>&1 | FileCheck %s --check-prefix=ID-COLLISION + +# ID-COLLISION: yaml2obj: error: the ID (1) of abbrev table with index 1 has been used + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_EXEC + Machine: EM_X86_64 +DWARF: + debug_abbrev: + - ID: 1 + - ID: 1 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 @@ -22,7 +22,9 @@ void dumpDebugAbbrev(DWARFContext &DCtx, DWARFYAML::Data &Y) { auto AbbrevSetPtr = DCtx.getDebugAbbrev(); if (AbbrevSetPtr) { + uint64_t AbbrevTableID = 0; for (auto AbbrvDeclSet : *AbbrevSetPtr) { + DWARFYAML::AbbrevTable AbbrevTable; for (auto AbbrvDecl : AbbrvDeclSet.second) { DWARFYAML::Abbrev Abbrv; Abbrv.Code = AbbrvDecl.getCode(); @@ -37,8 +39,10 @@ AttAbrv.Value = Attribute.getImplicitConstValue(); Abbrv.Attributes.push_back(AttAbrv); } - Y.AbbrevDecls.push_back(Abbrv); + AbbrevTable.Table.push_back(Abbrv); + AbbrevTable.ID = AbbrevTableID++; } + Y.DebugAbbrev.push_back(AbbrevTable); } } } @@ -178,6 +182,14 @@ NewUnit.Version = CU->getVersion(); if (NewUnit.Version >= 5) NewUnit.Type = (dwarf::UnitType)CU->getUnitType(); + const DWARFDebugAbbrev *DebugAbbrev = DCtx.getDebugAbbrev(); + NewUnit.AbbrevTableID = std::distance( + DebugAbbrev->begin(), + std::find_if( + DebugAbbrev->begin(), DebugAbbrev->end(), + [&](const std::pair &P) { + return P.first == CU->getAbbreviations()->getOffset(); + })); NewUnit.AbbrOffset = CU->getAbbreviations()->getOffset(); NewUnit.AddrSize = CU->getAddressByteSize(); for (auto DIE : CU->dies()) { 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 @@ -2474,6 +2487,7 @@ - Value: 0x0000000000000000 - Length: 16 Version: 4 + AbbrevTableID: 0 AbbrOffset: 0 AddrSize: 8 Entries: @@ -2569,24 +2583,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 +2637,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 +2703,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 +2758,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 +2832,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 +2885,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 +2948,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