]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Use double quotes in some gdb output
authorTom Tromey <tromey@adacore.com>
Wed, 22 Apr 2026 18:31:57 +0000 (12:31 -0600)
committerTom Tromey <tromey@adacore.com>
Fri, 5 Jun 2026 21:09:09 +0000 (15:09 -0600)
I looked for spots where gdb was using `...' or ``...'' quoting, and
changed these to use double quotes instead.

I think it might be good to regularize output quoting in gdb.  My
proposal is to use double quotes, though single quotes would also be
fine.  Using `...', though, is a kind of older style and has fallen
out of favor in GNU; the relevant node is here:

    https://www.gnu.org/prep/standards/html_node/Quote-Characters.html

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34044

gdb/mi/mi-getopt.c
gdb/std-regs.c
gdb/testsuite/gdb.base/radix.exp
gdb/testsuite/gdb.base/setshow.exp
gdb/testsuite/gdb.trace/mi-trace-save.exp
gdb/valprint.c

index 865bba9abf8e99fd27ca1d72d63c0671418775f1..14360fd78b5111927d3d100b58ad0168de856abf 100644 (file)
@@ -72,7 +72,7 @@ mi_getopt_1 (const char *prefix, int argc, const char *const *argv,
     }
 
   if (error_on_unknown)
-    error (_("%s: Unknown option ``%s''"), prefix, arg + 1);
+    error (_("%s: Unknown option \"%s\""), prefix, arg + 1);
   else
     return -1;
 }
index d5d946895d6021b29f2a69bf5343863307607d32..e85361873231524af6d35a94a6d9456f2d9c8c4f 100644 (file)
@@ -79,7 +79,7 @@ value_of_builtin_frame_sp_reg (const frame_info_ptr &frame, const void *baton)
   if (gdbarch_sp_regnum (gdbarch) >= 0)
     return value_of_register (gdbarch_sp_regnum (gdbarch),
                              get_next_frame_sentinel_okay (frame));
-  error (_("Standard register ``$sp'' is not available for this target"));
+  error (_("Standard register \"$sp\" is not available for this target"));
 }
 
 static struct value *
@@ -90,7 +90,7 @@ value_of_builtin_frame_ps_reg (const frame_info_ptr &frame, const void *baton)
   if (gdbarch_ps_regnum (gdbarch) >= 0)
     return value_of_register (gdbarch_ps_regnum (gdbarch),
                              get_next_frame_sentinel_okay (frame));
-  error (_("Standard register ``$ps'' is not available for this target"));
+  error (_("Standard register \"$ps\" is not available for this target"));
 }
 
 INIT_GDB_FILE (frame_reg)
index 7a4320bbf361f8f1213787ae44b67d61bbd47455..51fac418de889ba619110335d1679a5d362efe3a 100644 (file)
@@ -157,34 +157,34 @@ gdb_test "set radix" \
     "reset radices"
 
 gdb_test "set input-radix 0" \
-    "Nonsense input radix ``decimal 0''; input radix unchanged\\." \
+    "Nonsense input radix \"decimal 0\"; input radix unchanged\\." \
     "Reject input-radix 0"
 gdb_test "show input-radix" \
     "Default input radix for entering numbers is 10\\." \
     "input radix unchanged after rejecting 0"
 
 gdb_test "set input-radix 1" \
-    "Nonsense input radix ``decimal 1''; input radix unchanged\\." \
+    "Nonsense input radix \"decimal 1\"; input radix unchanged\\." \
     "Reject input-radix 1"
 gdb_test "show input-radix" \
     "Default input radix for entering numbers is 10\\." \
     "input radix unchanged after rejecting 1"
 
 gdb_test "set output-radix 0" \
-    "Unsupported output radix ``decimal 0''; output radix unchanged\\." \
+    "Unsupported output radix \"decimal 0\"; output radix unchanged\\." \
     "Reject output-radix 0"
 gdb_test "show output-radix" \
     "Default output radix for printing of values is 10\\." \
     "Output radix unchanged after rejecting 0"
 gdb_test "set output-radix 1" \
-    "Unsupported output radix ``decimal 1''; output radix unchanged\\." \
+    "Unsupported output radix \"decimal 1\"; output radix unchanged\\." \
     "Reject output-radix 1"
 gdb_test "show output-radix" \
     "Default output radix for printing of values is 10\\." \
     "output radix unchanged after rejecting 1"
 
 gdb_test "set radix 7" \
-    "Unsupported output radix ``decimal 7''; output radix unchanged\\." \
+    "Unsupported output radix \"decimal 7\"; output radix unchanged\\." \
     "set radix 7 rejected"
 gdb_test "show output-radix" \
     "Default output radix for printing of values is 10\\." \
index b8923492e4b806c6ee2171af875b9b33c116a438..def07ff7c382d462b9b58402f8e9a4568555fd12 100644 (file)
@@ -441,7 +441,7 @@ proc_with_prefix test_setshow_radix {} {
     clean_restart
 
     #test set radix 11
-    gdb_test "set radix 11" "Unsupported output radix ``decimal 11''; output radix unchanged..*"
+    gdb_test "set radix 11" "Unsupported output radix \"decimal 11\"; output radix unchanged..*"
 
     #test set radix 16
     gdb_test "set radix 16" "Input and output radices now set to decimal 16, hex 10, octal 20..*"
index a6493d593399450db38c7bd6cb6f7429b266c4e5..ab2a70083079b754182220d00739f380454355dc 100644 (file)
@@ -33,7 +33,7 @@ proc test_trace_save_wrong_num_args { } {
 # Test with an unrecognized option.
 
 proc test_trace_save_wrong_opt { } {
-    set err_re [string_to_regexp "^error,msg=\"-trace-save: Unknown option ``hey''\""]
+    set err_re [string_to_regexp "^error,msg=\"-trace-save: Unknown option \\\"hey\\\"\""]
 
     mi_gdb_test "-trace-save -hey" "$err_re" "-trace-save with wrong option"
 }
index b266db550d18ff06ebb29cdb23f08b380a45e4ea..01699c075c6ba9c1369cc5e3e2b0ff60a083a8ef 100644 (file)
@@ -2257,7 +2257,7 @@ set_input_radix_1 (int from_tty, unsigned radix)
   if (radix < 2)
     {
       input_radix_1 = input_radix;
-      error (_("Nonsense input radix ``decimal %u''; input radix unchanged."),
+      error (_("Nonsense input radix \"decimal %u\"; input radix unchanged."),
             radix);
     }
   input_radix_1 = input_radix = radix;
@@ -2299,7 +2299,7 @@ set_output_radix_1 (int from_tty, unsigned radix)
       break;
     default:
       output_radix_1 = output_radix;
-      error (_("Unsupported output radix ``decimal %u''; "
+      error (_("Unsupported output radix \"decimal %u\"; "
               "output radix unchanged."),
             radix);
     }