]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Remove gdb_stdtargerr
authorTom Tromey <tromey@adacore.com>
Tue, 16 Aug 2022 17:40:15 +0000 (11:40 -0600)
committerTom Tromey <tromey@adacore.com>
Fri, 17 May 2024 16:01:13 +0000 (10:01 -0600)
This patch removes gdb_stdtargerr.  There doesn't seem to be a need
for this -- it is always the same as stdtarg, and (I believe) has been
for many years.

Approved-By: Andrew Burgess <aburgess@redhat.com>
12 files changed:
gdb/cli/cli-interp.c
gdb/cli/cli-interp.h
gdb/interps.c
gdb/main.c
gdb/mi/mi-interp.c
gdb/remote-fileio.c
gdb/remote-sim.c
gdb/top.c
gdb/tui/tui-io.c
gdb/ui-out.c
gdb/ui-out.h
gdb/utils.h

index 7cefc3902d8c28183e04a45a1a886fa923abedd3..a488c304fea33014d4c03418923492fc752b39f0 100644 (file)
@@ -273,7 +273,6 @@ cli_interp_base::set_logging (ui_file_up logfile, bool logging_redirect,
       m_saved_output->err = gdb_stderr;
       m_saved_output->log = gdb_stdlog;
       m_saved_output->targ = gdb_stdtarg;
-      m_saved_output->targerr = gdb_stdtargerr;
 
       ui_file *logfile_p = logfile.get ();
       m_saved_output->logfile_holder = std::move (logfile);
@@ -299,7 +298,6 @@ cli_interp_base::set_logging (ui_file_up logfile, bool logging_redirect,
       gdb_stdlog = m_saved_output->stdlog_holder.get ();
       gdb_stderr = new_stderr;
       gdb_stdtarg = new_stderr;
-      gdb_stdtargerr = new_stderr;
     }
   else
     {
@@ -307,7 +305,6 @@ cli_interp_base::set_logging (ui_file_up logfile, bool logging_redirect,
       gdb_stderr = m_saved_output->err;
       gdb_stdlog = m_saved_output->log;
       gdb_stdtarg = m_saved_output->targ;
-      gdb_stdtargerr = m_saved_output->targerr;
 
       m_saved_output.reset (nullptr);
     }
index 137eb466f6b3db6f1ab8f33a66822fc8e4ac4207..03b592fdf9c7f782900c707efaf28a973ca1df0a 100644 (file)
@@ -50,7 +50,6 @@ private:
     ui_file *err;
     ui_file *log;
     ui_file *targ;
-    ui_file *targerr;
     /* When redirecting, some or all of these may be non-null
        depending on the logging mode.  */
     ui_file_up stdout_holder;
index 59c4ec532a7e5a8d0314d9d26641940183824421..bd65d1a5cc6e11726094718e4c4aab3a4cdd9afa 100644 (file)
@@ -296,7 +296,6 @@ interpreter_exec_cmd (const char *args, int from_tty)
   scoped_restore save_stderr = make_scoped_restore (&gdb_stderr);
   scoped_restore save_stdlog = make_scoped_restore (&gdb_stdlog);
   scoped_restore save_stdtarg = make_scoped_restore (&gdb_stdtarg);
-  scoped_restore save_stdtargerr = make_scoped_restore (&gdb_stdtargerr);
 
   if (args == NULL)
     error_no_arg (_("interpreter-exec command"));
index efc04a66bbbb0b9bb94fa616ced1da57664de452..571ade45fb147bdc297aee2a433151026f80b9e4 100644 (file)
@@ -79,7 +79,6 @@ std::string python_libdir;
 /* Target IO streams.  */
 struct ui_file *gdb_stdtargin;
 struct ui_file *gdb_stdtarg;
-struct ui_file *gdb_stdtargerr;
 
 /* True if --batch or --batch-silent was seen.  */
 int batch_flag = 0;
@@ -679,7 +678,6 @@ captured_main_1 (struct captured_main_args *context)
   current_ui = main_ui;
 
   gdb_stdtarg = gdb_stderr;
-  gdb_stdtargerr = gdb_stderr;
   gdb_stdtargin = gdb_stdin;
 
   /* Put a CLI based uiout in place early.  If the early initialization
index 07e036f5ff90a25089e0134bf917dc385abb7e62..168e6ed10b4e64b211b3550dd2bf9357c14f6095 100644 (file)
@@ -132,8 +132,6 @@ mi_interp::resume ()
   gdb_stdlog = mi->log;
   /* Route target output through the MI.  */
   gdb_stdtarg = mi->targ;
-  /* Route target error through the MI as well.  */
-  gdb_stdtargerr = mi->targ;
 
   deprecated_show_load_progress = mi_load_progress;
 }
index b15824637a947ccd1a1e281ebbcf5b9d2138b420..11cf2bb16faf000fb209fb7226a0386ca4da0794 100644 (file)
@@ -641,7 +641,7 @@ remote_fileio_func_write (remote_target *remote, char *buf)
        return;
       case FIO_FD_CONSOLE_OUT:
        {
-         ui_file *file = target_fd == 1 ? gdb_stdtarg : gdb_stdtargerr;
+         ui_file *file = gdb_stdtarg;
          file->write ((char *) buffer, length);
          file->flush ();
          ret = length;
index 38d7f5b7c0f5ba498897953109a9390e8e4c7cea..f92de6198891dc0abd7cbce136ebe99be584a727 100644 (file)
@@ -380,7 +380,7 @@ gdb_os_write_stderr (host_callback *p, const char *buf, int len)
     {
       b[0] = buf[i];
       b[1] = 0;
-      gdb_stdtargerr->puts (b);
+      gdb_stdtarg->puts (b);
     }
   return len;
 }
@@ -390,7 +390,7 @@ gdb_os_write_stderr (host_callback *p, const char *buf, int len)
 static void
 gdb_os_flush_stderr (host_callback *p)
 {
-  gdb_stdtargerr->flush ();
+  gdb_stdtarg->flush ();
 }
 
 /* GDB version of gdb_printf callback.  */
index b93ef0a69b593279ecdce4fd8e4eb223d5dfb521..b5e77ef6b05146672bcac431d7db64af83bf9d54 100644 (file)
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -620,8 +620,6 @@ execute_fn_to_ui_file (struct ui_file *file, std::function<void(void)> fn)
       = make_scoped_restore (&gdb_stdlog, file);
     scoped_restore save_stdtarg
       = make_scoped_restore (&gdb_stdtarg, file);
-    scoped_restore save_stdtargerr
-      = make_scoped_restore (&gdb_stdtargerr, file);
 
     fn ();
   }
index 2673397cc46bb1e85aba7353987c31cb554c9e93..285c781c25d004afe39aabe26cf93fad6164dd69 100644 (file)
@@ -839,7 +839,6 @@ tui_setup_io (int mode)
       gdb_stderr = tui_stderr;
       gdb_stdlog = tui_stdlog;
       gdb_stdtarg = gdb_stderr;
-      gdb_stdtargerr = gdb_stderr;
       current_uiout = tui_out;
 
       /* Save tty for SIGCONT.  */
@@ -852,7 +851,6 @@ tui_setup_io (int mode)
       gdb_stderr = tui_old_stderr;
       gdb_stdlog = tui_old_stdlog;
       gdb_stdtarg = gdb_stderr;
-      gdb_stdtargerr = gdb_stderr;
       current_uiout = tui_old_uiout;
 
       /* Restore readline.  */
index d5bc4947f63a5c1b6d26e612325ae1726d33c199..7e9f238fcf6e400862541b2605ab5a2651700888 100644 (file)
@@ -900,14 +900,12 @@ buffered_streams::buffered_streams (buffer_group *group, ui_out *uiout)
     m_buffered_stderr (group, gdb_stderr),
     m_buffered_stdlog (group, gdb_stdlog),
     m_buffered_stdtarg (group, gdb_stdtarg),
-    m_buffered_stdtargerr (group, gdb_stdtargerr),
     m_uiout (uiout)
 {
   gdb_stdout = &m_buffered_stdout;
   gdb_stderr = &m_buffered_stderr;
   gdb_stdlog = &m_buffered_stdlog;
   gdb_stdtarg = &m_buffered_stdtarg;
-  gdb_stdtargerr = &m_buffered_stdtargerr;
 
   ui_file *stream = current_uiout->current_stream ();
   if (stream != nullptr)
@@ -940,7 +938,6 @@ buffered_streams::remove_buffers ()
   gdb_stderr = m_buffered_stderr.stream ();
   gdb_stdlog = m_buffered_stdlog.stream ();
   gdb_stdtarg = m_buffered_stdtarg.stream ();
-  gdb_stdtargerr = m_buffered_stdtargerr.stream ();
 
   if (m_buffered_current_uiout.has_value ())
     current_uiout->redirect (nullptr);
index 74b570b1794fce99f6ab650a06f142e11308589b..ef9ce4fad33581c367363902201cc7f73a80870b 100644 (file)
@@ -645,7 +645,6 @@ private:
   buffering_file m_buffered_stderr;
   buffering_file m_buffered_stdlog;
   buffering_file m_buffered_stdtarg;
-  buffering_file m_buffered_stdtargerr;
 
   /* Buffer for current_uiout's output stream.  */
   std::optional<buffering_file> m_buffered_current_uiout;
index f0189c7d723d631b3ba1179879f3f3bc9e91444a..66eec9621fd8018989e8bd3e01fc8abeb9028d7e 100644 (file)
@@ -194,7 +194,6 @@ extern void gdb_flush (struct ui_file *stream);
 
 /* Target output that should bypass the pager, if one is in use.  */
 extern struct ui_file *gdb_stdtarg;
-extern struct ui_file *gdb_stdtargerr;
 extern struct ui_file *gdb_stdtargin;
 
 /* Set the screen dimensions to WIDTH and HEIGHT.  */