public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Always print the "host libthread-db" message to stdout
@ 2022-01-25 22:26 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2022-01-25 22:26 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a8e9f2575981ed1381967c4fca21808c3d869b9f

commit a8e9f2575981ed1381967c4fca21808c3d869b9f
Author: Tom Tromey <tom@tromey.com>
Date:   Thu Dec 30 12:13:52 2021 -0700

    Always print the "host libthread-db" message to stdout
    
    linux-thread-db.c has a bit of unusual code that unconditionally
    prints a message, but decides whether to print to gdb_stdout or
    gdb_stdlog based on a debug flag.  It seems better to me to simply
    always print this; and this is the only spot in gdb where we
    conditionally pass gdb_stdout to one of the f*_unfiltered functions.

Diff:
---
 gdb/linux-thread-db.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c
index a0cfeb1685b..18d313bf9be 100644
--- a/gdb/linux-thread-db.c
+++ b/gdb/linux-thread-db.c
@@ -940,21 +940,14 @@ try_thread_db_load_1 (struct thread_db_info *info)
 
   if (!libthread_db_search_path.empty () || libthread_db_debug)
     {
-      struct ui_file *file;
       const char *library;
 
       library = dladdr_to_soname ((const void *) *info->td_ta_new_p);
       if (library == NULL)
 	library = LIBTHREAD_DB_SO;
 
-      /* If we'd print this to gdb_stdout when debug output is
-	 disabled, still print it to gdb_stdout if debug output is
-	 enabled.  User visible output should not depend on debug
-	 settings.  */
-      file = !libthread_db_search_path.empty () ? gdb_stdout : gdb_stdlog;
-      fprintf_unfiltered (file,
-			  _("Using host libthread_db library \"%ps\".\n"),
-			  styled_string (file_name_style.style (), library));
+      printf_unfiltered (_("Using host libthread_db library \"%ps\".\n"),
+			 styled_string (file_name_style.style (), library));
     }
 
   /* The thread library was detected.  Activate the thread_db target


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-25 22:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-25 22:26 [binutils-gdb] Always print the "host libthread-db" message to stdout Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).