]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Change how stdin is handled in the UI
authorTom Tromey <tom@tromey.com>
Mon, 8 Dec 2025 15:53:54 +0000 (08:53 -0700)
committerTom Tromey <tom@tromey.com>
Mon, 9 Feb 2026 15:09:09 +0000 (08:09 -0700)
gdb_stdin is never overridden, so it doesn't need to be an lvalue.
This patch changes how it is implemented.

Future patches will change the other streams here, but I thought since
this one is truly different from the others, it should be handled
separately.

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

index e7d1ded96e417c9f582984d50dbaacd201872625..5819dfa789759e1291aa4b8112bf689302ebcf5c 100644 (file)
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -97,10 +97,10 @@ current_ui_gdb_stdout_ptr ()
   return &current_ui->m_gdb_stdout;
 }
 
-struct ui_file **
-current_ui_gdb_stdin_ptr ()
+struct ui_file *
+current_ui_gdb_stdin ()
 {
-  return &current_ui->m_gdb_stdin;
+  return current_ui->m_gdb_stdin;
 }
 
 struct ui_file **
index 4f11cbf379ffc1dfbfaa4f967bb560e2beb9de44..28824ad2e1a0633665d8e10bc53145835e9d4a20 100644 (file)
@@ -166,7 +166,7 @@ extern bool pagination_enabled;
 extern bool debug_timestamp;
 
 extern struct ui_file **current_ui_gdb_stdout_ptr (void);
-extern struct ui_file **current_ui_gdb_stdin_ptr (void);
+extern struct ui_file *current_ui_gdb_stdin ();
 extern struct ui_file **current_ui_gdb_stderr_ptr (void);
 extern struct ui_file **current_ui_gdb_stdlog_ptr (void);
 extern struct ui_file **current_ui_gdb_stdtarg_ptr ();
@@ -178,8 +178,8 @@ extern void gdb_flush (struct ui_file *stream);
 
 /* Normal results */
 #define gdb_stdout (*current_ui_gdb_stdout_ptr ())
-/* Input stream */
-#define gdb_stdin (*current_ui_gdb_stdin_ptr ())
+/* Input stream */
+#define gdb_stdin (current_ui_gdb_stdin ())
 /* Serious error notifications.  This bypasses the pager, if one is in
    use.  */
 #define gdb_stderr (*current_ui_gdb_stderr_ptr ())