DWARF-5: Macros
authorJan Kratochvil <jan.kratochvil@redhat.com>
Thu, 23 Feb 2017 21:54:01 +0000 (22:54 +0100)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Thu, 23 Feb 2017 21:57:52 +0000 (22:57 +0100)
binutils/
2017-02-23  Jan Kratochvil  <jan.kratochvil@redhat.com>

* dwarf.c (display_debug_macro): Support DWARF-5.  Rename
DW_MACRO_GNU_*.

binutils/ChangeLog
binutils/dwarf.c

index 0187cdd5e9d37c74c19e60c3700b978dcd68ee7f..24bf6637ed08497d1cf1e0e3cbd2b291070ecddb 100644 (file)
@@ -1,3 +1,8 @@
+2017-02-23  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * dwarf.c (display_debug_macro): Support DWARF-5.  Rename
+       DW_MACRO_GNU_*.
+
 2017-02-23  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        * dwarf.c (decode_location_expression): Support DW_OP_implicit_pointer,
index 2540293e87921abcb5dc2217a4029e3e81468c82..136e45616514ef7997fd89d18257155fb60c8526 100644 (file)
@@ -4543,9 +4543,9 @@ display_debug_macro (struct dwarf_section *section,
       unsigned char **extended_ops = NULL;
 
       SAFE_BYTE_GET_AND_INC (version, curr, 2, end);
-      if (version != 4)
+      if (version != 4 && version != 5)
        {
-         error (_("Only GNU extension to DWARF 4 of %s is currently supported.\n"),
+         error (_("Only GNU extension to DWARF 4 or 5 of %s is currently supported.\n"),
                 section->name);
          return 0;
        }
@@ -4582,10 +4582,10 @@ display_debug_macro (struct dwarf_section *section,
                  nargs = read_uleb128 (curr, &bytes_read, end);
                  curr += bytes_read;
                  if (nargs == 0)
-                   printf (_("    DW_MACRO_GNU_%02x has no arguments\n"), op);
+                   printf (_("    DW_MACRO_%02x has no arguments\n"), op);
                  else
                    {
-                     printf (_("    DW_MACRO_GNU_%02x arguments: "), op);
+                     printf (_("    DW_MACRO_%02x arguments: "), op);
                      for (n = 0; n < nargs; n++)
                        {
                          unsigned int form;
@@ -4638,7 +4638,7 @@ display_debug_macro (struct dwarf_section *section,
 
          switch (op)
            {
-           case DW_MACRO_GNU_start_file:
+           case DW_MACRO_start_file:
              {
                unsigned int filenum;
                unsigned char *file_name = NULL, *dir_name = NULL;
@@ -4649,87 +4649,87 @@ display_debug_macro (struct dwarf_section *section,
                curr += bytes_read;
 
                if ((flags & 2) == 0)
-                 error (_("DW_MACRO_GNU_start_file used, but no .debug_line offset provided.\n"));
+                 error (_("DW_MACRO_start_file used, but no .debug_line offset provided.\n"));
                else
                  file_name
                    = get_line_filename_and_dirname (line_offset, filenum,
                                                     &dir_name);
                if (file_name == NULL)
-                 printf (_(" DW_MACRO_GNU_start_file - lineno: %d filenum: %d\n"),
+                 printf (_(" DW_MACRO_start_file - lineno: %d filenum: %d\n"),
                          lineno, filenum);
                else
-                 printf (_(" DW_MACRO_GNU_start_file - lineno: %d filenum: %d filename: %s%s%s\n"),
+                 printf (_(" DW_MACRO_start_file - lineno: %d filenum: %d filename: %s%s%s\n"),
                          lineno, filenum,
                          dir_name != NULL ? (const char *) dir_name : "",
                          dir_name != NULL ? "/" : "", file_name);
              }
              break;
 
-           case DW_MACRO_GNU_end_file:
-             printf (_(" DW_MACRO_GNU_end_file\n"));
+           case DW_MACRO_end_file:
+             printf (_(" DW_MACRO_end_file\n"));
              break;
 
-           case DW_MACRO_GNU_define:
+           case DW_MACRO_define:
              lineno = read_uleb128 (curr, &bytes_read, end);
              curr += bytes_read;
              string = curr;
              curr += strnlen ((char *) string, end - string) + 1;
-             printf (_(" DW_MACRO_GNU_define - lineno : %d macro : %s\n"),
+             printf (_(" DW_MACRO_define - lineno : %d macro : %s\n"),
                      lineno, string);
              break;
 
-           case DW_MACRO_GNU_undef:
+           case DW_MACRO_undef:
              lineno = read_uleb128 (curr, &bytes_read, end);
              curr += bytes_read;
              string = curr;
              curr += strnlen ((char *) string, end - string) + 1;
-             printf (_(" DW_MACRO_GNU_undef - lineno : %d macro : %s\n"),
+             printf (_(" DW_MACRO_undef - lineno : %d macro : %s\n"),
                      lineno, string);
              break;
 
-           case DW_MACRO_GNU_define_indirect:
+           case DW_MACRO_define_strp:
              lineno = read_uleb128 (curr, &bytes_read, end);
              curr += bytes_read;
              SAFE_BYTE_GET_AND_INC (offset, curr, offset_size, end);
              string = fetch_indirect_string (offset);
-             printf (_(" DW_MACRO_GNU_define_indirect - lineno : %d macro : %s\n"),
+             printf (_(" DW_MACRO_define_strp - lineno : %d macro : %s\n"),
                      lineno, string);
              break;
 
-           case DW_MACRO_GNU_undef_indirect:
+           case DW_MACRO_undef_strp:
              lineno = read_uleb128 (curr, &bytes_read, end);
              curr += bytes_read;
              SAFE_BYTE_GET_AND_INC (offset, curr, offset_size, end);
              string = fetch_indirect_string (offset);
-             printf (_(" DW_MACRO_GNU_undef_indirect - lineno : %d macro : %s\n"),
+             printf (_(" DW_MACRO_undef_strp - lineno : %d macro : %s\n"),
                      lineno, string);
              break;
 
-           case DW_MACRO_GNU_transparent_include:
+           case DW_MACRO_import:
              SAFE_BYTE_GET_AND_INC (offset, curr, offset_size, end);
-             printf (_(" DW_MACRO_GNU_transparent_include - offset : 0x%lx\n"),
+             printf (_(" DW_MACRO_import - offset : 0x%lx\n"),
                      (unsigned long) offset);
              break;
 
-           case DW_MACRO_GNU_define_indirect_alt:
+           case DW_MACRO_define_sup:
              lineno = read_uleb128 (curr, &bytes_read, end);
              curr += bytes_read;
              SAFE_BYTE_GET_AND_INC (offset, curr, offset_size, end);
-             printf (_(" DW_MACRO_GNU_define_indirect_alt - lineno : %d macro offset : 0x%lx\n"),
+             printf (_(" DW_MACRO_define_sup - lineno : %d macro offset : 0x%lx\n"),
                      lineno, (unsigned long) offset);
              break;
 
-           case DW_MACRO_GNU_undef_indirect_alt:
+           case DW_MACRO_undef_sup:
              lineno = read_uleb128 (curr, &bytes_read, end);
              curr += bytes_read;
              SAFE_BYTE_GET_AND_INC (offset, curr, offset_size, end);
-             printf (_(" DW_MACRO_GNU_undef_indirect_alt - lineno : %d macro offset : 0x%lx\n"),
+             printf (_(" DW_MACRO_undef_sup - lineno : %d macro offset : 0x%lx\n"),
                      lineno, (unsigned long) offset);
              break;
 
-           case DW_MACRO_GNU_transparent_include_alt:
+           case DW_MACRO_import_sup:
              SAFE_BYTE_GET_AND_INC (offset, curr, offset_size, end);
-             printf (_(" DW_MACRO_GNU_transparent_include_alt - offset : 0x%lx\n"),
+             printf (_(" DW_MACRO_import_sup - offset : 0x%lx\n"),
                      (unsigned long) offset);
              break;
 
@@ -4748,10 +4748,10 @@ display_debug_macro (struct dwarf_section *section,
                  desc += bytes_read;
                  if (nargs == 0)
                    {
-                     printf (_(" DW_MACRO_GNU_%02x\n"), op);
+                     printf (_(" DW_MACRO_%02x\n"), op);
                      break;
                    }
-                 printf (_(" DW_MACRO_GNU_%02x -"), op);
+                 printf (_(" DW_MACRO_%02x -"), op);
                  for (n = 0; n < nargs; n++)
                    {
                      int val;