PR23431, Messages composed from pieces can't be properly translated
authorAlan Modra <amodra@gmail.com>
Mon, 23 Jul 2018 23:41:35 +0000 (09:11 +0930)
committerAlan Modra <amodra@gmail.com>
Tue, 24 Jul 2018 10:29:11 +0000 (19:59 +0930)
PR 23431
* dwarf.c (display_formatted_table): Replace "what" parameter
with "is_dir".  Expand messages.  Fix capitalisation.
* testsuite/binutils-all/dw5.W: Update expected output.

binutils/ChangeLog
binutils/dwarf.c
binutils/testsuite/binutils-all/dw5.W

index 25caf2977b65835f78890d18eba33ebbd8cb00ea..b09e93d60ab3f2263b256b17dcb625e72d58275d 100644 (file)
@@ -1,3 +1,10 @@
+2018-07-24  Alan Modra  <amodra@gmail.com>
+
+       PR 23431
+       * dwarf.c (display_formatted_table): Replace "what" parameter
+       with "is_dir".  Expand messages.  Fix capitalisation.
+       * testsuite/binutils-all/dw5.W: Update expected output.
+
 2018-07-24  Alan Modra  <amodra@gmail.com>
 
        PR 23430
index b6c0a3af86913a0d175eafd4b13b1d3383c55c75..81060bfa462a2f53bed78566660e6db1c2418101 100644 (file)
@@ -3424,7 +3424,7 @@ display_formatted_table (unsigned char *                   data,
                         unsigned char *                   end,
                         const DWARF2_Internal_LineInfo *  linfo,
                         struct dwarf_section *            section,
-                        const char *                      what)
+                        bfd_boolean                       is_dir)
 {
   unsigned char *format_start, format_count, *format, formati;
   dwarf_vma data_count, datai;
@@ -3440,7 +3440,10 @@ display_formatted_table (unsigned char *                   data,
       data += bytes_read;
       if (data == end)
        {
-         warn (_("Corrupt %s format table entry\n"), what);
+         if (is_dir)
+           warn (_("Corrupt directory format table entry\n"));
+         else
+           warn (_("Corrupt file name format table entry\n"));
          return data;
        }
     }
@@ -3449,18 +3452,28 @@ display_formatted_table (unsigned char *                   data,
   data += bytes_read;
   if (data == end)
     {
-      warn (_("Corrupt %s list\n"), what);
+      if (is_dir)
+       warn (_("Corrupt directory list\n"));
+      else
+       warn (_("Corrupt file name list\n"));
       return data;
     }
 
   if (data_count == 0)
     {
-      printf (_("\n The %s Table is empty.\n"), what);
+      if (is_dir)
+       printf (_("\n The Directory Table is empty.\n"));
+      else
+       printf (_("\n The File Name Table is empty.\n"));
       return data;
     }
 
-  printf (_("\n The %s Table (offset 0x%lx):\n"), what,
-         (long)(data - start));
+  if (is_dir)
+    printf (_("\n The Directory Table (offset 0x%lx):\n"),
+           (long) (data - start));
+  else
+    printf (_("\n The File Name Table (offset 0x%lx):\n"),
+           (long) (data - start));
 
   printf (_("  Entry"));
   /* Delay displaying name as the last entry for better screen layout.  */ 
@@ -3528,7 +3541,10 @@ display_formatted_table (unsigned char *                   data,
        }
       if (data == end)
        {
-         warn (_("Corrupt %s entries list\n"), what);
+         if (is_dir)
+           warn (_("Corrupt directory entries list\n"));
+         else
+           warn (_("Corrupt file name entries list\n"));
          return data;
        }
       putchar ('\n');
@@ -3636,9 +3652,9 @@ display_debug_lines_raw (struct dwarf_section *  section,
              load_debug_section_with_follow (line_str, file);
 
              data = display_formatted_table (data, start, end, &linfo, section,
-                                             _("Directory"));
+                                             TRUE);
              data = display_formatted_table (data, start, end, &linfo, section,
-                                             _("File name"));
+                                             FALSE);
            }
          else
            {
index 489fa272de60c0b64485c727ecc8b8905640975d..8ea0b28ba584ed8cf922363d68c47f9785c01486 100644 (file)
@@ -319,7 +319,7 @@ Raw dump of debug contents of section .debug_line:
   1    \(indirect line string, offset: 0x1\): 
   2    \(indirect line string, offset: 0x22\): /usr/include
 
- The File name Table \(offset 0x34\):
+ The File Name Table \(offset 0x34\):
   Entry        Dir     Name
   0    0       \(indirect line string, offset: 0x14\): main.c
   1    1       \(indirect line string, offset: 0x1b\): main.c
This page took 0.044921 seconds and 4 git commands to generate.