From: Tom Tromey Date: Thu, 11 Dec 2025 22:12:30 +0000 (-0700) Subject: Rewrite cli-style.c:do_show X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a444416787a19041dee2aa9b97c71f39085412c8;p=thirdparty%2Fbinutils-gdb.git Rewrite cli-style.c:do_show IMO it looks a little nicer if cli-style.c:do_show uses a single printf to display its output. This is also slightly more i18-friendly. I noticed this while debugging a case where multiple redundant ANSI escapes were sent. In conjunction with a subsequent patch, this approach happens to fix that problem. FWIW I don't consider such redundancies to be bugs, but it was convenient to change this one. Approved-By: Andrew Burgess --- diff --git a/gdb/cli/cli-style.c b/gdb/cli/cli-style.c index 411d8d91347..ac4fb27e725 100644 --- a/gdb/cli/cli-style.c +++ b/gdb/cli/cli-style.c @@ -262,9 +262,8 @@ do_show (const char *what, struct ui_file *file, const char *value) { cli_style_option *cso = (cli_style_option *) cmd->context (); - gdb_puts (_("The "), file); - fprintf_styled (file, cso->style (), _("\"%s\" style"), cso->name ()); - gdb_printf (file, _(" %s is: %s\n"), what, value); + gdb_printf (file, _("The %p[\"%s\" style%p] %s is: %s\n"), + cso->style ().ptr (), cso->name (), nullptr, what, value); } /* See cli-style.h. */