Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@adacore.com>
Subject: [PATCH] Use double quotes in some gdb output
Date: Fri,  8 May 2026 08:22:21 -0600	[thread overview]
Message-ID: <20260508142221.3434435-1-tromey@adacore.com> (raw)

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                        |  2 +-
 gdb/std-regs.c                            |  4 ++--
 gdb/testsuite/gdb.base/radix.exp          | 10 +++++-----
 gdb/testsuite/gdb.base/setshow.exp        |  2 +-
 gdb/testsuite/gdb.trace/mi-trace-save.exp |  2 +-
 gdb/valprint.c                            |  4 ++--
 6 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/gdb/mi/mi-getopt.c b/gdb/mi/mi-getopt.c
index 865bba9abf8..14360fd78b5 100644
--- a/gdb/mi/mi-getopt.c
+++ b/gdb/mi/mi-getopt.c
@@ -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;
 }
diff --git a/gdb/std-regs.c b/gdb/std-regs.c
index d5d946895d6..e8536187323 100644
--- a/gdb/std-regs.c
+++ b/gdb/std-regs.c
@@ -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)
diff --git a/gdb/testsuite/gdb.base/radix.exp b/gdb/testsuite/gdb.base/radix.exp
index 7a4320bbf36..51fac418de8 100644
--- a/gdb/testsuite/gdb.base/radix.exp
+++ b/gdb/testsuite/gdb.base/radix.exp
@@ -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\\." \
diff --git a/gdb/testsuite/gdb.base/setshow.exp b/gdb/testsuite/gdb.base/setshow.exp
index feac4e993ac..7ad420e1cf6 100644
--- a/gdb/testsuite/gdb.base/setshow.exp
+++ b/gdb/testsuite/gdb.base/setshow.exp
@@ -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..*"
diff --git a/gdb/testsuite/gdb.trace/mi-trace-save.exp b/gdb/testsuite/gdb.trace/mi-trace-save.exp
index a6493d59339..ab2a7008307 100644
--- a/gdb/testsuite/gdb.trace/mi-trace-save.exp
+++ b/gdb/testsuite/gdb.trace/mi-trace-save.exp
@@ -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"
 }
diff --git a/gdb/valprint.c b/gdb/valprint.c
index 62b1b33bb66..b5b92eb0b3c 100644
--- a/gdb/valprint.c
+++ b/gdb/valprint.c
@@ -2272,7 +2272,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;
@@ -2314,7 +2314,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);
     }

base-commit: c7c8e5bf414b7512fb19df8bf153372d56cb7fc1
-- 
2.54.0


             reply	other threads:[~2026-05-08 14:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-08 14:22 Tom Tromey [this message]
2026-06-05 21:06 ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260508142221.3434435-1-tromey@adacore.com \
    --to=tromey@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox