public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Remove vfprintf_styled_no_gdbfmt
@ 2022-03-29 19:42 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2022-03-29 19:42 UTC (permalink / raw)
  To: gdb-cvs

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

commit 0e37c0638c15f7ed9215029d9185498ce2741603
Author: Tom Tromey <tom@tromey.com>
Date:   Sat Jan 1 13:35:13 2022 -0700

    Remove vfprintf_styled_no_gdbfmt
    
    This removes vfprintf_styled_no_gdbfmt, inlining it at the sole point
    of call.

Diff:
---
 gdb/cli-out.c | 13 ++++++++-----
 gdb/utils.c   | 15 ---------------
 gdb/utils.h   |  8 --------
 3 files changed, 8 insertions(+), 28 deletions(-)

diff --git a/gdb/cli-out.c b/gdb/cli-out.c
index b2daad11a51..a7fcc623897 100644
--- a/gdb/cli-out.c
+++ b/gdb/cli-out.c
@@ -230,11 +230,14 @@ cli_ui_out::do_message (const ui_file_style &style,
   if (m_suppress_output)
     return;
 
-  /* Use the "no_gdbfmt" variant here to avoid recursion.
-     vfprintf_styled calls into cli_ui_out::message to handle the
-     gdb-specific printf formats.  */
-  vfprintf_styled_no_gdbfmt (m_streams.back (), style,
-			     !test_flags (unfiltered_output), format, args);
+  std::string str = string_vprintf (format, args);
+  if (!str.empty ())
+    {
+      if (test_flags (unfiltered_output))
+	fputs_styled_unfiltered (str.c_str (), style, m_streams.back ());
+      else
+	fputs_styled (str.c_str (), style, m_streams.back ());
+    }
 }
 
 void
diff --git a/gdb/utils.c b/gdb/utils.c
index 8f479c487d3..57ce9ca5f4f 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -1993,21 +1993,6 @@ vfprintf_styled (struct ui_file *stream, const ui_file_style &style,
   set_output_style (stream, ui_file_style ());
 }
 
-/* See utils.h.  */
-
-void
-vfprintf_styled_no_gdbfmt (struct ui_file *stream, const ui_file_style &style,
-			   bool filter, const char *format, va_list args)
-{
-  std::string str = string_vprintf (format, args);
-  if (!str.empty ())
-    {
-      set_output_style (stream, style);
-      fputs_maybe_filtered (str.c_str (), stream, filter);
-      set_output_style (stream, ui_file_style ());
-    }
-}
-
 void
 printf_filtered (const char *format, ...)
 {
diff --git a/gdb/utils.h b/gdb/utils.h
index cd73af4651a..f2b23a9935e 100644
--- a/gdb/utils.h
+++ b/gdb/utils.h
@@ -289,14 +289,6 @@ extern void vfprintf_styled (struct ui_file *stream,
 			     va_list args)
   ATTRIBUTE_PRINTF (3, 0);
 
-/* Like vfprintf_styled, but do not process gdb-specific format
-   specifiers.  */
-extern void vfprintf_styled_no_gdbfmt (struct ui_file *stream,
-				       const ui_file_style &style,
-				       bool filter,
-				       const char *fmt, va_list args)
-  ATTRIBUTE_PRINTF (4, 0);
-
 /* Like fputs_filtered, but styles the output according to STYLE, when
    appropriate.  */


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

only message in thread, other threads:[~2022-03-29 19:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-29 19:42 [binutils-gdb] Remove vfprintf_styled_no_gdbfmt 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).