From: Tom Tromey Date: Mon, 8 Dec 2025 15:53:54 +0000 (-0700) Subject: Change how stdin is handled in the UI X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c37331877e1c6024da1d1c59f5ea2ae1a918cd0f;p=thirdparty%2Fbinutils-gdb.git Change how stdin is handled in the UI 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 --- diff --git a/gdb/top.c b/gdb/top.c index e7d1ded96e4..5819dfa7897 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -97,10 +97,10 @@ current_ui_gdb_stdout_ptr () return ¤t_ui->m_gdb_stdout; } -struct ui_file ** -current_ui_gdb_stdin_ptr () +struct ui_file * +current_ui_gdb_stdin () { - return ¤t_ui->m_gdb_stdin; + return current_ui->m_gdb_stdin; } struct ui_file ** diff --git a/gdb/utils.h b/gdb/utils.h index 4f11cbf379f..28824ad2e1a 100644 --- a/gdb/utils.h +++ b/gdb/utils.h @@ -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 ())