Add codes for DWARF v5 .dwp sections to dwarf2.h.
authorCaroline Tice <cmtice@google.com>
Tue, 8 Sep 2020 16:14:29 +0000 (09:14 -0700)
committerCaroline Tice <cmtice@google.com>
Wed, 9 Sep 2020 21:05:04 +0000 (14:05 -0700)
(Note: This patch has already been accepted/committed in binutils/GDB.
This will bring the same change into the GCC tree.)

For DWARF v5 Dwarf Package Files (.dwp files), the section identifier encodings
have changed. This patch updates dwarf2.h to contain the new
encodings.  The table below shows the old & new encodings:
[ref http://dwarfstd.org/doc/DWARF5.pdf, section 7.3.5. ]

Val  DW4 section       DW4 section id  DW5 section         DW5 section id
--- -----------------  --------------  -----------------   --------------
 1  .debug_info.dwo    DW_SECT_INFO    .debug_info.dwo     DW_SECT_INFO
 2  .debug_types.dwo   DW_SECT_TYPES         --              reserved
 3  .debug_abbrev.dwo  DW_SECT_ABBREV  .debug_abbrev.dwo   DW_SECT_ABBREV
 4  .debug_line.dwo    DW_SECT_LINE    .debug_line.dwo     DW_SECT_LINE
 5  .debug_loc.dwo     DW_SECT_LOC     .debug_loclists.dwo DW_SECT_LOCLISTS
 6  .debug_str_offsets.dwo             .debug_str_offsets.dwo
                       DW_SECT_STR_OFFSETS                 DW_SECT_STR_OFFSETS
 7  .debug_macinfo.dwo DW_SECT_MACINFO .debug_macro.dwo    DW_SECT_MACRO
 8  .debug_macro.dwo   DW_SECT_MACRO   .debug_rnglists.dwo DW_SECT_RNGLISTS

2020-09-09  Caroline Tice  <cmtice@google.com>

include/

* dwarf2.h (enum dwarf_sect_v5): A new enum section for the
sections in a DWARF 5 DWP file (DWP version 5).

include/dwarf2.h

index 0b6facfd4cf4c02320c7328114231b128ab42d5e..34273e84a5aaad14a0b31fc28e8abec1dedfa353 100644 (file)
@@ -489,19 +489,36 @@ enum dwarf_unit_type
 #define DW_EH_PE_indirect      0x80
 
 /* Codes for the debug sections in a dwarf package (.dwp) file.
-   Extensions for Fission.  See http://gcc.gnu.org/wiki/DebugFissionDWP.  */
+   (From the pre-standard formats Extensions for Fission.
+   See http://gcc.gnu.org/wiki/DebugFissionDWP).  */
 enum dwarf_sect
-  {
-    DW_SECT_INFO = 1,
-    DW_SECT_TYPES = 2,
-    DW_SECT_ABBREV = 3,
-    DW_SECT_LINE = 4,
-    DW_SECT_LOC = 5,
-    DW_SECT_STR_OFFSETS = 6,
-    DW_SECT_MACINFO = 7,
-    DW_SECT_MACRO = 8,
-    DW_SECT_MAX = 8
-  };
+{
+  DW_SECT_INFO = 1,
+  DW_SECT_TYPES = 2,
+  DW_SECT_ABBREV = 3,
+  DW_SECT_LINE = 4,
+  DW_SECT_LOC = 5,
+  DW_SECT_STR_OFFSETS = 6,
+  DW_SECT_MACINFO = 7,
+  DW_SECT_MACRO = 8,
+  DW_SECT_MAX = 8
+};
+
+/* Codes for the debug sections in a dwarf package (.dwp) file.
+   (From the official DWARF v5 spec.
+   See http://dwarfstd.org/doc/DWARF5.pdf, section 7.3.5).  */
+enum dwarf_sect_v5
+{
+  DW_SECT_INFO_V5 = 1,
+  DW_SECT_RESERVED_V5 = 2,
+  DW_SECT_ABBREV_V5 = 3,
+  DW_SECT_LINE_V5 = 4,
+  DW_SECT_LOCLISTS_V5 = 5,
+  DW_SECT_STR_OFFSETS_V5 = 6,
+  DW_SECT_MACRO_V5 = 7,
+  DW_SECT_RNGLISTS_V5 = 8,
+  DW_SECT_MAX_V5 = 8
+};
 
 #ifdef __cplusplus
 extern "C" {