From: Tom Tromey Date: Sun, 7 Dec 2025 15:58:58 +0000 (-0600) Subject: Remove tee_file X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f1722f4032bffeac1f6fd39e73a85b55c1d9c277;p=thirdparty%2Fbinutils-gdb.git Remove tee_file tee_file is no longer used and can be deleted. Approved-By: Andrew Burgess --- 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) -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 @@ public: 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