[1/4,gdb/symtab] Use [in module %s] notation more consistently in dwarf errors

Message ID 20240822133029.11921-1-tdevries@suse.de
State Committed
Headers
Series [1/4,gdb/symtab] Use [in module %s] notation more consistently in dwarf errors |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Test passed

Commit Message

Tom de Vries Aug. 22, 2024, 1:30 p.m. UTC
  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.
---
 gdb/dwarf2/read.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)


base-commit: 573d8bb08bfff4638405add40a6a61868af1f2a4
  

Comments

Tom Tromey Aug. 23, 2024, 3:41 p.m. UTC | #1
>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:

Tom> In gdb/dwarf2/read.c, I found a few strings "in module %s":
Tom> ...
Tom> $ grep "in module %s" gdb/dwarf2/read.c | fgrep -v '['
Tom> 		     "DIE at %s in module %s"),
Tom>       error (_("Dwarf Error: Dummy CU at %s referenced in module %s"),
Tom>     error (_("Dwarf Error: Cannot find DIE at %s referenced in module %s"),
Tom> 	error (_("Dwarf Error: DIE at %s referenced in module %s "
Tom>       error (_("Dwarf Error: Dummy CU at %s referenced in module %s"),
Tom>     error (_("Dwarf Error: Cannot find DIE at %s referenced in module %s"),
Tom> ...
Tom> that are not using the commonly used "[in module %s]" notation.  Fix these.

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

Looks good, thank you.
Approved-By: Tom Tromey <tom@tromey.com>

Tom
  
Tom de Vries Aug. 27, 2024, 7:09 a.m. UTC | #2
On 8/23/24 17:41, Tom Tromey wrote:
>>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
> 
> Tom> In gdb/dwarf2/read.c, I found a few strings "in module %s":
> Tom> ...
> Tom> $ grep "in module %s" gdb/dwarf2/read.c | fgrep -v '['
> Tom> 		     "DIE at %s in module %s"),
> Tom>       error (_("Dwarf Error: Dummy CU at %s referenced in module %s"),
> Tom>     error (_("Dwarf Error: Cannot find DIE at %s referenced in module %s"),
> Tom> 	error (_("Dwarf Error: DIE at %s referenced in module %s "
> Tom>       error (_("Dwarf Error: Dummy CU at %s referenced in module %s"),
> Tom>     error (_("Dwarf Error: Cannot find DIE at %s referenced in module %s"),
> Tom> ...
> Tom> that are not using the commonly used "[in module %s]" notation.  Fix these.
> 
> Tom> In one case, the string was also used in the middle rather than at the end of
> Tom> the message, so fix that as well.
> 
> Looks good, thank you.
> Approved-By: Tom Tromey <tom@tromey.com>

Thanks for the reviews.

I've pushed this series.

Thanks,
- Tom
  

Patch

diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 04a53980569..be79a3b0ba7 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -17697,7 +17697,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));
     }
@@ -20390,13 +20390,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);
@@ -20455,8 +20455,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 ();
@@ -20529,13 +20529,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);