From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id 640F43858C39; Mon, 28 Feb 2022 18:34:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 640F43858C39 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Add more filename styling X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 29928b8e3b79e14abb11cfa78daec447158b79d4 X-Git-Newrev: 972f7a4b97f81a0a5e6f46b9fb163796dc12ead5 Message-Id: <20220228183458.640F43858C39@sourceware.org> Date: Mon, 28 Feb 2022 18:34:58 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2022 18:34:58 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D972f7a4b97f8= 1a0a5e6f46b9fb163796dc12ead5 commit 972f7a4b97f81a0a5e6f46b9fb163796dc12ead5 Author: Tom Tromey Date: Mon Feb 28 08:21:55 2022 -0700 Add more filename styling =20 I found a few spots where filename styling ought to be applied, but is not. Diff: --- gdb/auto-load.c | 9 ++++++--- gdb/gdb_bfd.c | 4 +++- gdb/infcmd.c | 3 ++- gdb/inferior.c | 4 +++- gdb/linux-thread-db.c | 3 ++- gdb/progspace.c | 4 +++- gdb/symtab.c | 3 ++- 7 files changed, 21 insertions(+), 9 deletions(-) diff --git a/gdb/auto-load.c b/gdb/auto-load.c index 680b87936b1..9a1ccec87ce 100644 --- a/gdb/auto-load.c +++ b/gdb/auto-load.c @@ -476,15 +476,18 @@ file_is_auto_load_safe (const char *filename) printf_filtered (_("\ To enable execution of this file add\n\ \tadd-auto-load-safe-path %s\n\ -line to your configuration file \"%s\".\n\ +line to your configuration file \"%ps\".\n\ To completely disable this security protection add\n\ \tset auto-load safe-path /\n\ -line to your configuration file \"%s\".\n\ +line to your configuration file \"%ps\".\n\ For more information about this security protection see the\n\ \"Auto-loading safe path\" section in the GDB manual. E.g., run from the = shell:\n\ \tinfo \"(gdb)Auto-loading safe path\"\n"), filename_real.get (), - home_config.c_str (), home_config.c_str ()); + styled_string (file_name_style.style (), + home_config.c_str ()), + styled_string (file_name_style.style (), + home_config.c_str ())); advice_printed =3D true; } =20 diff --git a/gdb/gdb_bfd.c b/gdb/gdb_bfd.c index d28c32352bc..b2e896f7c52 100644 --- a/gdb/gdb_bfd.c +++ b/gdb/gdb_bfd.c @@ -32,6 +32,7 @@ #include "target.h" #include "gdb/fileio.h" #include "inferior.h" +#include "cli/cli-style.h" =20 /* An object of this type is stored in the section's user data when mapping a section. */ @@ -1101,7 +1102,8 @@ print_one_bfd (void **slot, void *data) ui_out_emit_tuple tuple_emitter (uiout, NULL); uiout->field_signed ("refcount", gdata->refc); uiout->field_string ("addr", host_address_to_string (abfd)); - uiout->field_string ("filename", bfd_get_filename (abfd)); + uiout->field_string ("filename", bfd_get_filename (abfd), + file_name_style.style ()); uiout->text ("\n"); =20 return 1; diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 682bebe1229..ea06ceb992c 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -438,7 +438,8 @@ run_command_1 (const char *args, int from_tty, enum run= _how run_how) uiout->field_string (NULL, "Starting program"); uiout->text (": "); if (exec_file) - uiout->field_string ("execfile", exec_file); + uiout->field_string ("execfile", exec_file, + file_name_style.style ()); uiout->spaces (1); uiout->field_string ("infargs", current_inferior ()->args ()); uiout->text ("\n"); diff --git a/gdb/inferior.c b/gdb/inferior.c index bebddb44173..1abdde3b3b4 100644 --- a/gdb/inferior.c +++ b/gdb/inferior.c @@ -36,6 +36,7 @@ #include "readline/tilde.h" #include "progspace-and-thread.h" #include "gdbsupport/buildargv.h" +#include "cli/cli-style.h" =20 /* Keep a registry of per-inferior data-pointers required by other GDB modules. */ @@ -521,7 +522,8 @@ print_inferior (struct ui_out *uiout, const char *reque= sted_inferiors) uiout->field_string ("connection-id", conn); =20 if (inf->pspace->exec_filename !=3D nullptr) - uiout->field_string ("exec", inf->pspace->exec_filename.get ()); + uiout->field_string ("exec", inf->pspace->exec_filename.get (), + file_name_style.style ()); else uiout->field_skip ("exec"); =20 diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c index 18d313bf9be..530ece08db1 100644 --- a/gdb/linux-thread-db.c +++ b/gdb/linux-thread-db.c @@ -1944,7 +1944,8 @@ info_auto_load_libthread_db (const char *args, int fr= om_tty) ui_out_emit_tuple tuple_emitter (uiout, NULL); =20 info =3D array[i]; - uiout->field_string ("filename", info->filename); + uiout->field_string ("filename", info->filename, + file_name_style.style ()); =20 std::string pids; while (i < array.size () && strcmp (info->filename, diff --git a/gdb/progspace.c b/gdb/progspace.c index 4a2ac84ca06..8dc21fd42c2 100644 --- a/gdb/progspace.c +++ b/gdb/progspace.c @@ -27,6 +27,7 @@ #include "gdbthread.h" #include "inferior.h" #include +#include "cli/cli-style.h" =20 /* The last program space number assigned. */ static int last_program_space_num =3D 0; @@ -321,7 +322,8 @@ print_program_space (struct ui_out *uiout, int requeste= d) uiout->field_signed ("id", pspace->num); =20 if (pspace->exec_filename !=3D nullptr) - uiout->field_string ("exec", pspace->exec_filename.get ()); + uiout->field_string ("exec", pspace->exec_filename.get (), + file_name_style.style ()); else uiout->field_skip ("exec"); =20 diff --git a/gdb/symtab.c b/gdb/symtab.c index 1a39372aad0..a867e1db9fd 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -4508,7 +4508,8 @@ info_sources_worker (struct ui_out *uiout, if (group_by_objfile) { output_tuple.emplace (uiout, nullptr); - uiout->field_string ("filename", objfile_name (objfile)); + uiout->field_string ("filename", objfile_name (objfile), + file_name_style.style ()); uiout->text (":\n"); bool debug_fully_readin =3D !objfile->has_unexpanded_symtabs (); if (uiout->is_mi_like_p ())