From: Tom de Vries Date: Tue, 27 Aug 2024 07:08:41 +0000 (+0200) Subject: [gdb/symtab] Use [in module %s] notation more consistently in dwarf errors X-Git-Tag: gdb-16-branchpoint~1070 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f6f07a0b923747af8d45c24223b66ea22f33fc97;p=thirdparty%2Fbinutils-gdb.git [gdb/symtab] Use [in module %s] notation more consistently in dwarf errors 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 --- diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index e75bfb7ab04..1d4188b811d 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -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);