* [PATCH] Use double quotes in some gdb output
@ 2026-05-08 14:22 Tom Tromey
2026-06-05 21:06 ` Tom Tromey
0 siblings, 1 reply; 2+ messages in thread
From: Tom Tromey @ 2026-05-08 14:22 UTC (permalink / raw)
To: gdb-patches; +Cc: Tom Tromey
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Use double quotes in some gdb output
2026-05-08 14:22 [PATCH] Use double quotes in some gdb output Tom Tromey
@ 2026-06-05 21:06 ` Tom Tromey
0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2026-06-05 21:06 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches
>>>>> "Tom" == Tom Tromey <tromey@adacore.com> writes:
Tom> I looked for spots where gdb was using `...' or ``...'' quoting, and
Tom> changed these to use double quotes instead.
Tom> I think it might be good to regularize output quoting in gdb. My
Tom> proposal is to use double quotes, though single quotes would also be
Tom> fine. Using `...', though, is a kind of older style and has fallen
Tom> out of favor in GNU; the relevant node is here:
Tom> https://www.gnu.org/prep/standards/html_node/Quote-Characters.html
I'm going to check this in now.
I may also look at changing '...' to "..." in the output; that is,
standardize on double quotes.
Tom
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-06-05 21:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-08 14:22 [PATCH] Use double quotes in some gdb output Tom Tromey
2026-06-05 21:06 ` Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox