]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/symtab] Use [in module %s] notation more consistently in dwarf errors
authorTom de Vries <tdevries@suse.de>
Tue, 27 Aug 2024 07:08:41 +0000 (09:08 +0200)
committerTom de Vries <tdevries@suse.de>
Tue, 27 Aug 2024 07:08:41 +0000 (09:08 +0200)
In gdb/dwarf2/read.c, I found a few strings "in module %s":
...
$ grep "in module %s" gdb/dwarf2/read.c | fgrep -v '['
     "DIE at %s in module %s"),
      error (_("Dwarf Error: Dummy CU at %s referenced in module %s"),
    error (_("Dwarf Error: Cannot find DIE at %s referenced in module %s"),
error (_("Dwarf Error: DIE at %s referenced in module %s "
      error (_("Dwarf Error: Dummy CU at %s referenced in module %s"),
    error (_("Dwarf Error: Cannot find DIE at %s referenced in module %s"),
...
that are not using the commonly used "[in module %s]" notation.  Fix these.

In one case, the string was also used in the middle rather than at the end of
the message, so fix that as well.

Tested on x86_64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
gdb/dwarf2/read.c

index e75bfb7ab04367c6a0730a34688ca14b9dd1518c..1d4188b811dd91fa9cdcd889e844d1173c5e6c75 100644 (file)
@@ -17704,7 +17704,7 @@ dwarf2_string_attr (struct die_info *die, unsigned int name, struct dwarf2_cu *c
       str = attr->as_string ();
       if (str == nullptr)
        complaint (_("string type expected for attribute %s for "
-                    "DIE at %s in module %s"),
+                    "DIE at %s [in module %s]"),
                   dwarf_attr_name (name), sect_offset_str (die->sect_off),
                   objfile_name (cu->per_objfile->objfile));
     }
@@ -20400,13 +20400,13 @@ dwarf2_fetch_die_loc_sect_off (sect_offset sect_off,
     {
       /* We shouldn't get here for a dummy CU, but don't crash on the user.
         Instead just throw an error, not much else we can do.  */
-      error (_("Dwarf Error: Dummy CU at %s referenced in module %s"),
+      error (_("Dwarf Error: Dummy CU at %s referenced [in module %s]"),
             sect_offset_str (sect_off), objfile_name (objfile));
     }
 
   die = follow_die_offset (sect_off, per_cu->is_dwz, &cu);
   if (!die)
-    error (_("Dwarf Error: Cannot find DIE at %s referenced in module %s"),
+    error (_("Dwarf Error: Cannot find DIE at %s referenced [in module %s]"),
           sect_offset_str (sect_off), objfile_name (objfile));
 
   attr = dwarf2_attr (die, DW_AT_location, cu);
@@ -20465,8 +20465,8 @@ dwarf2_fetch_die_loc_sect_off (sect_offset sect_off,
   else
     {
       if (!attr->form_is_block ())
-       error (_("Dwarf Error: DIE at %s referenced in module %s "
-                "is neither DW_FORM_block* nor DW_FORM_exprloc"),
+       error (_("Dwarf Error: DIE at %s is neither DW_FORM_block* nor"
+                " DW_FORM_exprloc [in module %s]"),
               sect_offset_str (sect_off), objfile_name (objfile));
 
       struct dwarf_block *block = attr->as_block ();
@@ -20539,13 +20539,13 @@ dwarf2_fetch_constant_bytes (sect_offset sect_off,
     {
       /* We shouldn't get here for a dummy CU, but don't crash on the user.
         Instead just throw an error, not much else we can do.  */
-      error (_("Dwarf Error: Dummy CU at %s referenced in module %s"),
+      error (_("Dwarf Error: Dummy CU at %s referenced [in module %s]"),
             sect_offset_str (sect_off), objfile_name (objfile));
     }
 
   die = follow_die_offset (sect_off, per_cu->is_dwz, &cu);
   if (!die)
-    error (_("Dwarf Error: Cannot find DIE at %s referenced in module %s"),
+    error (_("Dwarf Error: Cannot find DIE at %s referenced [in module %s]"),
           sect_offset_str (sect_off), objfile_name (objfile));
 
   attr = dwarf2_attr (die, DW_AT_const_value, cu);