From: Andrew Burgess Date: Sat, 10 Jan 2026 18:37:05 +0000 (+0000) Subject: gdb: yet more miscellaneous styling fixes X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=141f3b0ce1a4141ec0bbd19f1c5713999113a7de;p=thirdparty%2Fbinutils-gdb.git gdb: yet more miscellaneous styling fixes The previous patch was all about address styling, but I spotted some non-address styling that was missing. This patch covers those cases. There's function name styling for the 'jump' command, and line number, and function name styling for 'maint print symbols'. Other than the extra styling, there should be no user visible changes after this commit. Approved-By: Tom Tromey --- diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 1ddb6ad1447..65c39d53e6e 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -1253,10 +1253,11 @@ jump_command (const char *arg, int from_tty) find_pc_mapped_section (sal.pc)); if (fn != nullptr && sfn != fn) { - if (!query (_("Line %ps is not in `%s'. Jump anyway? "), + if (!query (_("Line %ps is not in `%ps'. Jump anyway? "), styled_string (line_number_style.style (), pulongest (sal.line)), - fn->print_name ())) + styled_string (function_name_style.style (), + fn->print_name ()))) { error (_("Not confirmed.")); /* NOTREACHED */ diff --git a/gdb/symmisc.c b/gdb/symmisc.c index edf6a29a0ae..838c2a002e1 100644 --- a/gdb/symmisc.c +++ b/gdb/symmisc.c @@ -276,7 +276,9 @@ dump_symtab_1 (struct symtab *symtab, struct ui_file *outfile) int len = l->nitems; for (int i = 0; i < len; i++) { - gdb_printf (outfile, _(" line %d at "), l->item[i].line); + gdb_printf (outfile, _(" line %ps at "), + styled_string (line_number_style.style (), + pulongest (l->item[i].line))); fputs_styled (paddress (gdbarch, l->item[i].pc (objfile)), address_style.style (), outfile); if (l->item[i].is_stmt) @@ -317,8 +319,9 @@ dump_symtab_1 (struct symtab *symtab, struct ui_file *outfile) b->function ()->linkage_name ())); if (b->function ()->demangled_name () != NULL) { - gdb_printf (outfile, ", %s", - b->function ()->demangled_name ()); + gdb_printf (outfile, ", %ps", + styled_string (function_name_style.style (), + b->function ()->demangled_name ())); } } gdb_printf (outfile, "\n");