From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH 16/19] Remove ui_out_flag::unfiltered_output
Date: Fri, 21 Jan 2022 18:37:58 -0700 [thread overview]
Message-ID: <20220122013801.666659-17-tom@tromey.com> (raw)
In-Reply-To: <20220122013801.666659-1-tom@tromey.com>
There is no longer any need for ui_out_flag::unfiltered_output --
nothing ever sets this flag. This used to be needed to make the
_unfiltered output work, but now only printf_unfiltered can be used,
and it uses the puts_unfiltered method. This patch removes the flag
and the dead code.
---
gdb/cli-out.c | 25 +++++--------------------
gdb/ui-out.h | 5 +----
2 files changed, 6 insertions(+), 24 deletions(-)
diff --git a/gdb/cli-out.c b/gdb/cli-out.c
index 39279d96397..e0802df352b 100644
--- a/gdb/cli-out.c
+++ b/gdb/cli-out.c
@@ -173,10 +173,7 @@ cli_ui_out::do_field_string (int fldno, int width, ui_align align,
{
ui_file *stream = m_streams.back ();
stream->emit_style_escape (style);
- if (test_flags (unfiltered_output))
- stream->puts_unfiltered (string);
- else
- stream->puts (string);
+ stream->puts (string);
stream->emit_style_escape (ui_file_style ());
}
@@ -208,10 +205,7 @@ cli_ui_out::do_spaces (int numspaces)
if (m_suppress_output)
return;
- if (test_flags (unfiltered_output))
- gdb_printf (m_streams.back (), "%*s", numspaces, "");
- else
- print_spaces (numspaces, m_streams.back ());
+ print_spaces (numspaces, m_streams.back ());
}
void
@@ -220,10 +214,7 @@ cli_ui_out::do_text (const char *string)
if (m_suppress_output)
return;
- if (test_flags (unfiltered_output))
- gdb_puts (string, m_streams.back ());
- else
- gdb_puts (string, m_streams.back ());
+ gdb_puts (string, m_streams.back ());
}
void
@@ -238,10 +229,7 @@ cli_ui_out::do_message (const ui_file_style &style,
{
ui_file *stream = m_streams.back ();
stream->emit_style_escape (style);
- if (test_flags (unfiltered_output))
- stream->puts_unfiltered (str.c_str ());
- else
- stream->puts (str.c_str ());
+ stream->puts (str.c_str ());
stream->emit_style_escape (ui_file_style ());
}
}
@@ -380,10 +368,7 @@ cli_ui_out::do_progress_end ()
void
cli_ui_out::field_separator ()
{
- if (test_flags (unfiltered_output))
- gdb_putc (' ', m_streams.back ());
- else
- gdb_putc (' ', m_streams.back ());
+ gdb_putc (' ', m_streams.back ());
}
/* Constructor for cli_ui_out. */
diff --git a/gdb/ui-out.h b/gdb/ui-out.h
index 60dd6fc2d37..b9a59c916ad 100644
--- a/gdb/ui-out.h
+++ b/gdb/ui-out.h
@@ -53,12 +53,9 @@ enum ui_out_flag
{
ui_source_list = (1 << 0),
fix_multi_location_breakpoint_output = (1 << 1),
- /* For CLI output, this flag is set if unfiltered output is desired.
- This should only be used by low-level formatting functions. */
- unfiltered_output = (1 << 2),
/* This indicates that %pF should be disallowed in a printf format
string. */
- disallow_ui_out_field = (1 << 3)
+ disallow_ui_out_field = (1 << 2)
};
DEF_ENUM_FLAGS_TYPE (ui_out_flag, ui_out_flags);
--
2.31.1
next prev 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 ` [PATCH 08/19] Remove fputs_styled_unfiltered Tom Tromey
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 ` Tom Tromey [this message]
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-17-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).