]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: yet more miscellaneous styling fixes
authorAndrew Burgess <aburgess@redhat.com>
Sat, 10 Jan 2026 18:37:05 +0000 (18:37 +0000)
committerAndrew Burgess <aburgess@redhat.com>
Tue, 13 Jan 2026 10:38:22 +0000 (10:38 +0000)
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 <tom@tromey.com>
gdb/infcmd.c
gdb/symmisc.c

index 1ddb6ad144784dd44c3afd5f7ac19548c27e3642..65c39d53e6e36d5f1dcb24096c26532ff734a216 100644 (file)
@@ -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 */
index edf6a29a0aee818e55f0d278fb1419dea74ef534..838c2a002e15544593a6b8fae23911e4bb694b69 100644 (file)
@@ -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");