]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Remove gdb_stdtargin
authorTom Tromey <tom@tromey.com>
Sat, 17 Jan 2026 16:09:22 +0000 (09:09 -0700)
committerTom Tromey <tom@tromey.com>
Mon, 9 Feb 2026 15:09:09 +0000 (08:09 -0700)
gdb_stdtargin is only used in a single place; and, strangely, does not
follow the current UI.  This patch removes the global and changes the
one user to use gdb_stdin instead.

Approved-By: Andrew Burgess <aburgess@redhat.com>
gdb/main.c
gdb/remote-fileio.c
gdb/utils.h

index ac83b953cf2be8df27c99bc9243a34d60671aadc..c9bd79a4f8b0b4106c60422e4a576e7136fed82a 100644 (file)
@@ -79,9 +79,6 @@ static int gdb_datadir_provided = 0;
    the possibly relocated path to python's lib directory.  */
 std::string python_libdir;
 
-/* Target IO streams.  */
-struct ui_file *gdb_stdtargin;
-
 /* True if --batch or --batch-silent was seen.  */
 int batch_flag = 0;
 
@@ -694,8 +691,6 @@ captured_main_1 (struct captured_main_args *context)
   gdb_internal_backtrace_init_str ();
   current_ui = main_ui;
 
-  gdb_stdtargin = gdb_stdin;
-
   /* Put a CLI based uiout in place early.  If the early initialization
      files trigger any I/O then it isn't hard to reach parts of GDB that
      assume current_uiout is not nullptr.  Maybe we should just install the
index 61dfb2552aa1a569c8f4916b891c78fcf05c62b4..459f249d37bca5219aee30e7569716d184b09c47 100644 (file)
@@ -542,7 +542,7 @@ remote_fileio_func_read (remote_target *remote, char *buf)
                 limit this read to something smaller than that - by a
                 safe margin, in case the limit depends on system
                 resources or version.  */
-             ret = gdb_stdtargin->read ((char *) buffer, 16383);
+             ret = gdb_stdin->read ((char *) buffer, 16383);
              if (ret > 0 && (size_t)ret > length)
                {
                  remaining_buf = (char *) xmalloc (ret - length);
index 28824ad2e1a0633665d8e10bc53145835e9d4a20..4d888b802747d72a3bbb4ec61ae70b2a86c01e8c 100644 (file)
@@ -189,10 +189,6 @@ extern void gdb_flush (struct ui_file *stream);
 /* Target output.  */
 #define gdb_stdtarg (*current_ui_gdb_stdtarg_ptr ())
 
-/* Truly global ui_file streams.  These are all defined in main.c.  */
-
-extern struct ui_file *gdb_stdtargin;
-
 /* Set the screen dimensions to WIDTH and HEIGHT.  */
 
 extern void set_screen_width_and_height (int width, int height);