[12/21] gdb/tui: use m_ui instead of current_ui in tui_interp::resume

Message ID 20230908190227.96319-13-simon.marchi@efficios.com
State New
Headers
Series ui / interp cleansup |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 pending Test started

Commit Message

Simon Marchi Sept. 8, 2023, 6:23 p.m. UTC
  No behavior changes expected.

Change-Id: I607a50a7ed83d9afd536d41d6318fc4cd24d8192
---
 gdb/tui/tui-interp.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
  

Comments

Andrew Burgess Sept. 12, 2023, 10:41 a.m. UTC | #1
Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:

> No behavior changes expected.
>
> Change-Id: I607a50a7ed83d9afd536d41d6318fc4cd24d8192
> ---
>  gdb/tui/tui-interp.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/gdb/tui/tui-interp.c b/gdb/tui/tui-interp.c
> index af99501ac69f..87c079949f4b 100644
> --- a/gdb/tui/tui-interp.c
> +++ b/gdb/tui/tui-interp.c
> @@ -107,23 +107,20 @@ tui_command_line_handler (gdb::unique_xmalloc_ptr<char> &&rl)
>  void
>  tui_interp::resume ()
>  {
> -  struct ui *ui = current_ui;
> -  struct ui_file *stream;
> -
>    /* gdb_setup_readline will change gdb_stdout.  If the TUI was
>       previously writing to gdb_stdout, then set it to the new
>       gdb_stdout afterwards.  */
>  
> -  stream = tui_old_uiout->set_stream (gdb_stdout);
> +  ui_file *stream = tui_old_uiout->set_stream (gdb_stdout);

Same stdout question as for the previous patch.

Thanks,
Andrew

>    if (stream != gdb_stdout)
>      {
>        tui_old_uiout->set_stream (stream);
>        stream = NULL;
>      }
>  
> -  gdb_setup_readline (ui, 1);
> +  gdb_setup_readline (m_ui, 1);
>  
> -  ui->input_handler = tui_command_line_handler;
> +  m_ui->input_handler = tui_command_line_handler;
>  
>    if (stream != NULL)
>      tui_old_uiout->set_stream (gdb_stdout);
> -- 
> 2.42.0
  

Patch

diff --git a/gdb/tui/tui-interp.c b/gdb/tui/tui-interp.c
index af99501ac69f..87c079949f4b 100644
--- a/gdb/tui/tui-interp.c
+++ b/gdb/tui/tui-interp.c
@@ -107,23 +107,20 @@  tui_command_line_handler (gdb::unique_xmalloc_ptr<char> &&rl)
 void
 tui_interp::resume ()
 {
-  struct ui *ui = current_ui;
-  struct ui_file *stream;
-
   /* gdb_setup_readline will change gdb_stdout.  If the TUI was
      previously writing to gdb_stdout, then set it to the new
      gdb_stdout afterwards.  */
 
-  stream = tui_old_uiout->set_stream (gdb_stdout);
+  ui_file *stream = tui_old_uiout->set_stream (gdb_stdout);
   if (stream != gdb_stdout)
     {
       tui_old_uiout->set_stream (stream);
       stream = NULL;
     }
 
-  gdb_setup_readline (ui, 1);
+  gdb_setup_readline (m_ui, 1);
 
-  ui->input_handler = tui_command_line_handler;
+  m_ui->input_handler = tui_command_line_handler;
 
   if (stream != NULL)
     tui_old_uiout->set_stream (gdb_stdout);