public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH 08/19] Remove fputs_styled_unfiltered
Date: Fri, 21 Jan 2022 18:37:50 -0700	[thread overview]
Message-ID: <20220122013801.666659-9-tom@tromey.com> (raw)
In-Reply-To: <20220122013801.666659-1-tom@tromey.com>

fputs_styled_unfiltered is only called from cli_ui_out, so remove it.
This area will be further simplified in future patches.
---
 gdb/cli-out.c | 14 ++++++++++----
 gdb/utils.c   | 11 -----------
 gdb/utils.h   |  6 ------
 3 files changed, 10 insertions(+), 21 deletions(-)

diff --git a/gdb/cli-out.c b/gdb/cli-out.c
index a7fcc623897..f6a508393ef 100644
--- a/gdb/cli-out.c
+++ b/gdb/cli-out.c
@@ -171,10 +171,13 @@ cli_ui_out::do_field_string (int fldno, int width, ui_align align,
 
   if (string)
     {
+      ui_file *stream = m_streams.back ();
+      stream->emit_style_escape (style);
       if (test_flags (unfiltered_output))
-	fputs_styled_unfiltered (string, style, m_streams.back ());
+	stream->puts_unfiltered (string);
       else
-	fputs_styled (string, style, m_streams.back ());
+	stream->puts (string);
+      stream->emit_style_escape (ui_file_style ());
     }
 
   if (after)
@@ -233,10 +236,13 @@ cli_ui_out::do_message (const ui_file_style &style,
   std::string str = string_vprintf (format, args);
   if (!str.empty ())
     {
+      ui_file *stream = m_streams.back ();
+      stream->emit_style_escape (style);
       if (test_flags (unfiltered_output))
-	fputs_styled_unfiltered (str.c_str (), style, m_streams.back ());
+	stream->puts_unfiltered (str.c_str ());
       else
-	fputs_styled (str.c_str (), style, m_streams.back ());
+	stream->puts (str.c_str ());
+      stream->emit_style_escape (ui_file_style ());
     }
 }
 
diff --git a/gdb/utils.c b/gdb/utils.c
index fff914e92b0..0254286e8ac 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -1776,17 +1776,6 @@ fputs_styled (const char *linebuffer, const ui_file_style &style,
 
 /* See utils.h.  */
 
-void
-fputs_styled_unfiltered (const char *linebuffer, const ui_file_style &style,
-			 struct ui_file *stream)
-{
-  stream->emit_style_escape (style);
-  stream->puts_unfiltered (linebuffer);
-  stream->emit_style_escape (ui_file_style ());
-}
-
-/* See utils.h.  */
-
 void
 fputs_highlighted (const char *str, const compiled_regex &highlight,
 		   struct ui_file *stream)
diff --git a/gdb/utils.h b/gdb/utils.h
index 7ec8198b2ff..cb322c34396 100644
--- a/gdb/utils.h
+++ b/gdb/utils.h
@@ -293,12 +293,6 @@ extern void fputs_styled (const char *linebuffer,
 			  const ui_file_style &style,
 			  struct ui_file *stream);
 
-/* Unfiltered variant of fputs_styled.  */
-
-extern void fputs_styled_unfiltered (const char *linebuffer,
-				     const ui_file_style &style,
-				     struct ui_file *stream);
-
 /* Like fputs_styled, but uses highlight_style to highlight the
    parts of STR that match HIGHLIGHT.  */
 
-- 
2.31.1


  parent reply	other threads:[~2022-01-22  1:38 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-22  1:37 [PATCH 00/19] Simplify GDB output functions Tom Tromey
2022-01-22  1:37 ` [PATCH 01/19] Use unfiltered output in annotate.c Tom Tromey
2022-01-22  1:37 ` [PATCH 02/19] Remove some uses of printf_unfiltered Tom Tromey
2022-01-22  1:37 ` [PATCH 03/19] Only have one API for unfiltered output Tom Tromey
2022-01-22  1:37 ` [PATCH 04/19] Add puts_unfiltered method to ui_file Tom Tromey
2022-01-22  1:37 ` [PATCH 05/19] Add style-escape methods " Tom Tromey
2022-01-22  1:37 ` [PATCH 06/19] Remove vfprintf_styled_no_gdbfmt Tom Tromey
2022-01-22  1:37 ` [PATCH 07/19] Change the pager to a ui_file Tom Tromey
2022-01-22  1:37 ` Tom Tromey [this message]
2022-01-22  1:37 ` [PATCH 09/19] Unify vprintf functions Tom Tromey
2022-01-22  1:37 ` [PATCH 10/19] Unify gdb puts functions Tom Tromey
2022-01-22  1:37 ` [PATCH 11/19] Unify gdb putc functions Tom Tromey
2022-01-22  1:37 ` [PATCH 13/19] Rename print_spaces_filtered Tom Tromey
2022-01-22  1:37 ` [PATCH 14/19] Rename puts_filtered_tabular Tom Tromey
2022-01-22  1:37 ` [PATCH 15/19] Rename fprintf_symbol_filtered Tom Tromey
2022-01-22  1:37 ` [PATCH 16/19] Remove ui_out_flag::unfiltered_output Tom Tromey
2022-01-22  1:37 ` [PATCH 17/19] Remove vfprintf_styled Tom Tromey
2022-01-22  1:38 ` [PATCH 18/19] Minor comment updates in utils.h Tom Tromey
2022-03-24 18:05   ` Pedro Alves
2022-03-28 20:29     ` Tom Tromey
2022-01-22  1:38 ` [PATCH 19/19] Remove unnecessary calls to wrap_here and gdb_flush Tom Tromey
2022-01-22 17:40 ` [PATCH 00/19] Simplify GDB output functions John Baldwin
2022-03-24 16:25 ` Tom Tromey
2022-03-24 18:08 ` Pedro Alves
2022-03-29 19:38   ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220122013801.666659-9-tom@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).