From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>, Andrew Burgess <aburgess@redhat.com>
Subject: [PATCH v3 16/21] Remove tee_file
Date: Fri, 30 Jan 2026 06:17:30 -0700 [thread overview]
Message-ID: <20260130-pr-28948-logging-5-v3-16-3eec47ef3cba@tromey.com> (raw)
In-Reply-To: <20260130-pr-28948-logging-5-v3-0-3eec47ef3cba@tromey.com>
tee_file is no longer used and can be deleted.
Approved-By: Andrew Burgess <aburgess@redhat.com>
---
gdb/ui-file.c | 60 -----------------------------------------------------------
gdb/ui-file.h | 37 ------------------------------------
2 files changed, 97 deletions(-)
diff --git a/gdb/ui-file.c b/gdb/ui-file.c
index d655e7edd9e..2bd692274f7 100644
--- a/gdb/ui-file.c
+++ b/gdb/ui-file.c
@@ -342,66 +342,6 @@ stderr_file::stderr_file (FILE *stream)
\f
-tee_file::tee_file (ui_file *one, ui_file *two)
- : m_one (one),
- m_two (two)
-{}
-
-tee_file::~tee_file ()
-{
-}
-
-void
-tee_file::flush ()
-{
- m_one->flush ();
- m_two->flush ();
-}
-
-void
-tee_file::write (const char *buf, long length_buf)
-{
- m_one->write (buf, length_buf);
- m_two->write (buf, length_buf);
-}
-
-void
-tee_file::write_async_safe (const char *buf, long length_buf)
-{
- m_one->write_async_safe (buf, length_buf);
- m_two->write_async_safe (buf, length_buf);
-}
-
-void
-tee_file::puts (const char *linebuffer)
-{
- m_one->puts (linebuffer);
- m_two->puts (linebuffer);
-}
-
-bool
-tee_file::isatty ()
-{
- return m_one->isatty ();
-}
-
-/* See ui-file.h. */
-
-bool
-tee_file::term_out ()
-{
- return m_one->term_out ();
-}
-
-/* See ui-file.h. */
-
-bool
-tee_file::can_emit_style_escape ()
-{
- return (m_one->term_out ()
- && term_cli_styling ());
-}
-
/* See ui-file.h. */
void
diff --git a/gdb/ui-file.h b/gdb/ui-file.h
index 84529de3618..94897ff0b77 100644
--- a/gdb/ui-file.h
+++ b/gdb/ui-file.h
@@ -333,43 +333,6 @@ class stderr_file : public stdio_file
void puts (const char *linebuffer) override;
};
-/* A ui_file implementation that maps onto two ui-file objects. */
-
-class tee_file : public ui_file
-{
-public:
- /* Create a file which writes to both ONE and TWO. Ownership of
- both files is up to the user. */
- tee_file (ui_file *one, ui_file *two);
- ~tee_file () override;
-
- void write (const char *buf, long length_buf) override;
- void write_async_safe (const char *buf, long length_buf) override;
- void puts (const char *) override;
-
- bool isatty () override;
- bool term_out () override;
- bool can_emit_style_escape () override;
- void flush () override;
-
- void emit_style_escape (const ui_file_style &style) override
- {
- m_one->emit_style_escape (style);
- m_two->emit_style_escape (style);
- }
-
- void puts_unfiltered (const char *str) override
- {
- m_one->puts_unfiltered (str);
- m_two->puts_unfiltered (str);
- }
-
-private:
- /* The two underlying ui_files. */
- ui_file *m_one;
- ui_file *m_two;
-};
-
/* A ui_file implementation that buffers terminal escape sequences.
Note that this does not buffer in general -- it only buffers when
an incomplete but potentially recognizable escape sequence is
--
2.49.0
next prev parent reply other threads:[~2026-01-30 13:22 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-30 13:17 [PATCH v3 00/21] Rework gdb logging and output redirection Tom Tromey
2026-01-30 13:17 ` [PATCH v3 01/21] Remove unnecessary override of write_async_safe Tom Tromey
2026-01-30 13:17 ` [PATCH v3 02/21] Move stdtarg to ui Tom Tromey
2026-01-30 13:17 ` [PATCH v3 03/21] Turn wrapped_file into a template Tom Tromey
2026-01-30 13:17 ` [PATCH v3 04/21] Small rewrite of get_unbuffered Tom Tromey
2026-01-30 13:17 ` [PATCH v3 05/21] Move buffered stream to new files Tom Tromey
2026-01-30 13:17 ` [PATCH v3 06/21] Remove TYPE_FN_FIELD_STUB and associated code Tom Tromey
2026-01-30 13:17 ` [PATCH v3 07/21] Change how stdin is handled in the UI Tom Tromey
2026-01-30 13:17 ` [PATCH v3 08/21] Remove gdb_stdtargin Tom Tromey
2026-01-30 13:17 ` [PATCH v3 09/21] Improve fputs_highlighted by using ui_file::write Tom Tromey
2026-01-30 13:17 ` [PATCH v3 10/21] Add stream to buffer_group::output_unit constructor Tom Tromey
2026-01-30 13:17 ` [PATCH v3 11/21] Restore ui_file::can_page Tom Tromey
2026-01-30 13:17 ` [PATCH v3 12/21] Rewrite cli-style.c:do_show Tom Tromey
2026-01-30 13:17 ` [PATCH v3 13/21] Remove m_applied_style from ui_file Tom Tromey
2026-01-30 13:17 ` [PATCH v3 14/21] Add a new logging_file implementation Tom Tromey
2026-01-30 13:17 ` [PATCH v3 15/21] Rewrite output redirection and logging Tom Tromey
2026-01-30 13:17 ` Tom Tromey [this message]
2026-01-30 13:17 ` [PATCH v3 17/21] Warn if log file changed while logging Tom Tromey
2026-01-30 13:17 ` [PATCH v3 18/21] Fix leaks with timestamped_file Tom Tromey
2026-01-30 13:17 ` [PATCH v3 19/21] Use std::make_unique with ui_files Tom Tromey
2026-01-30 13:17 ` [PATCH v3 20/21] Style filenames in cli-logging.c Tom Tromey
2026-01-30 13:17 ` [PATCH v3 21/21] Update gdb.execute documentation Tom Tromey
2026-01-30 13:35 ` Eli Zaretskii
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=20260130-pr-28948-logging-5-v3-16-3eec47ef3cba@tromey.com \
--to=tom@tromey.com \
--cc=aburgess@redhat.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