[4/4,gdb/symtab] Change DWARF_ERROR from Dwarf Error to DWARF Error

Message ID 20240822133029.11921-4-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
  It was suggested here [1] that the canonical prefix for dwarf errors
should not be "Dwarf Error: ", given that the canonical spelling is DWARF
instead of Dwarf.

Fix this by using "DWARF Error: " instead.

Given the use of DWARF_ERROR_PREFIX, that needs to be changed only in a single
location.

Tested on x86_64-linux.

Suggested-By: Tom Tromey <tom@tromey.com>

[1] https://sourceware.org/pipermail/gdb-patches/2024-August/211258.html
---
 gdb/dwarf2/error.h                                  | 2 +-
 gdb/testsuite/gdb.dwarf2/dw2-bad-parameter-type.exp | 2 +-
 gdb/testsuite/gdb.dwarf2/dw2-error.exp              | 2 +-
 gdb/testsuite/gdb.dwarf2/dw2-missing-cu-tag.exp     | 4 ++--
 gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.exp    | 2 +-
 gdb/testsuite/gdb.dwarf2/struct-with-sig-2.exp      | 2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)
  

Comments

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

Tom> It was suggested here [1] that the canonical prefix for dwarf errors
Tom> should not be "Dwarf Error: ", given that the canonical spelling is DWARF
Tom> instead of Dwarf.

Tom> Fix this by using "DWARF Error: " instead.

Tom> Given the use of DWARF_ERROR_PREFIX, that needs to be changed only in a single
Tom> location.

Thank you for doing this.
Approved-By: Tom Tromey <tom@tromey.com>

Tom
  
Aaron Merey Aug. 23, 2024, 8:25 p.m. UTC | #2
Hi Tom,

On Fri, Aug 23, 2024 at 11:44 AM Tom Tromey <tom@tromey.com> wrote:
>
> >>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
>
> Tom> It was suggested here [1] that the canonical prefix for dwarf errors
> Tom> should not be "Dwarf Error: ", given that the canonical spelling is DWARF
> Tom> instead of Dwarf.
>
> Tom> Fix this by using "DWARF Error: " instead.
>
> Tom> Given the use of DWARF_ERROR_PREFIX, that needs to be changed only in a single
> Tom> location.
>
> Thank you for doing this.
> Approved-By: Tom Tromey <tom@tromey.com>

FYI commit aa35682ce5 that I just merged adds another "Dwarf Error"
message in dwarf2/read.c that should be capitalized as well.

Aaron
  
Tom de Vries Aug. 27, 2024, 7:10 a.m. UTC | #3
On 8/23/24 22:25, Aaron Merey wrote:
> Hi Tom,
> 
> On Fri, Aug 23, 2024 at 11:44 AM Tom Tromey <tom@tromey.com> wrote:
>>
>>>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
>>
>> Tom> It was suggested here [1] that the canonical prefix for dwarf errors
>> Tom> should not be "Dwarf Error: ", given that the canonical spelling is DWARF
>> Tom> instead of Dwarf.
>>
>> Tom> Fix this by using "DWARF Error: " instead.
>>
>> Tom> Given the use of DWARF_ERROR_PREFIX, that needs to be changed only in a single
>> Tom> location.
>>
>> Thank you for doing this.
>> Approved-By: Tom Tromey <tom@tromey.com>
> 
> FYI commit aa35682ce5 that I just merged adds another "Dwarf Error"
> message in dwarf2/read.c that should be capitalized as well.

Hi Aaron,

thanks for the reminder, done.

Thanks,
- Tom
  

Patch

diff --git a/gdb/dwarf2/error.h b/gdb/dwarf2/error.h
index 33146240aba..f8861f21e9a 100644
--- a/gdb/dwarf2/error.h
+++ b/gdb/dwarf2/error.h
@@ -21,7 +21,7 @@ 
 #define GDB_DWARF2_ERROR_H
 
 /* Canonical capitalization of "dwarf error".  */
-#define DWARF_ERROR "Dwarf Error"
+#define DWARF_ERROR "DWARF Error"
 
 /* Prefix to be used in dwarf errors.  */
 #define DWARF_ERROR_PREFIX DWARF_ERROR ": "
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-bad-parameter-type.exp b/gdb/testsuite/gdb.dwarf2/dw2-bad-parameter-type.exp
index 547ab819f53..d6b8d2e6f52 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-bad-parameter-type.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-bad-parameter-type.exp
@@ -28,7 +28,7 @@  if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {}] != "
 clean_restart $executable
 
 # The first access (as we do not use -readnow) prints some:
-# Dwarf Error: Cannot find DIE at 0x0 referenced from DIE at 0x29 [in module ...]
+# DWARF Error: Cannot find DIE at 0x0 referenced from DIE at 0x29 [in module ...]
 with_test_prefix "first" {
     gdb_test "ptype f"
 }
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-error.exp b/gdb/testsuite/gdb.dwarf2/dw2-error.exp
index 8081e7fc7cd..526b39416a9 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-error.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-error.exp
@@ -37,7 +37,7 @@  set host_binfile [gdb_remote_download host $binfile]
 
 # First test that reading symbols fails.
 gdb_test "file $host_binfile" \
-    {Reading symbols.*Dwarf Error: wrong version in compilation unit header \(is 153, should be 2, 3, 4 or 5\).*} \
+    {Reading symbols.*DWARF Error: wrong version in compilation unit header \(is 153, should be 2, 3, 4 or 5\).*} \
     "file $testfile"
 
 # We can't use proc readnow, because the PR makes it return 0.
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-missing-cu-tag.exp b/gdb/testsuite/gdb.dwarf2/dw2-missing-cu-tag.exp
index 3eadeb27d9c..f84142ab353 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-missing-cu-tag.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-missing-cu-tag.exp
@@ -56,7 +56,7 @@  gdb_test_no_output "maint set dwarf synchronous on"
 set pattern1 \
     [multi_line \
 	 "Reading symbols from \[^\r\n\]+" \
-	 "Dwarf Error: unexpected tag 'DW_TAG_subprogram' at offset $hex"]
+	 "DWARF Error: unexpected tag 'DW_TAG_subprogram' at offset $hex"]
 
 # This pattern is hit when GDB does use -readnow (e.g. running with
 # --target_board=readnow).
@@ -64,7 +64,7 @@  set pattern2 \
     [multi_line \
 	 "Reading symbols from \[^\r\n\]+" \
 	 "Expanding full symbols from \[^\r\n\]+" \
-	 "Dwarf Error: unexpected tag 'DW_TAG_subprogram' at offset $hex"]
+	 "DWARF Error: unexpected tag 'DW_TAG_subprogram' at offset $hex"]
 
 # Load the executable, we expect an error from the DWARF parser.
 gdb_test_multiple "file $host_binfile" "file $testfile" {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.exp b/gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.exp
index cd3dd0b26b8..c84a5300745 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.exp
@@ -131,7 +131,7 @@  clean_restart
 gdb_test_no_output "maint set dwarf synchronous on"
 
 set line1 "Reading symbols from \[^\r\n\]+"
-set dwarf_error "Dwarf Error: DW_FORM_strp used without required section"
+set dwarf_error "DWARF Error: DW_FORM_strp used without required section"
 
 # This pattern is hit when GDB does not use -readnow (i.e. the default
 # behaviour).
diff --git a/gdb/testsuite/gdb.dwarf2/struct-with-sig-2.exp b/gdb/testsuite/gdb.dwarf2/struct-with-sig-2.exp
index 111de438bda..00af7251f9d 100644
--- a/gdb/testsuite/gdb.dwarf2/struct-with-sig-2.exp
+++ b/gdb/testsuite/gdb.dwarf2/struct-with-sig-2.exp
@@ -128,5 +128,5 @@  save_vars { GDBFLAGS } {
     }
 }
 
-set re "Dwarf Error: .debug_types section not supported in dwz file"
+set re "DWARF Error: .debug_types section not supported in dwz file"
 gdb_assert { [regexp $re $gdb_file_cmd_msg] } "Dwarf Error message"