gdb/tui: Fix 'layout asm' before the inferior has started
[deliverable/binutils-gdb.git] / gdb / tui / tui.c
index 6fdfa4579f1fe4706468ed9b7b5b6a9fbfde6613..99d30a55a153338e64399410da7461a11633f3ae 100644 (file)
@@ -1,6 +1,6 @@
 /* General functions for the WDB TUI.
 
-   Copyright (C) 1998-2019 Free Software Foundation, Inc.
+   Copyright (C) 1998-2020 Free Software Foundation, Inc.
 
    Contributed by Hewlett-Packard Company.
 
@@ -489,10 +489,6 @@ tui_enable (void)
      clearok (stdscr, TRUE);
    }
 
-  /* Install the TUI specific hooks.  */
-  tui_install_hooks ();
-  rl_startup_hook = tui_rl_startup_hook;
-
   if (tui_update_variables ())
     tui_rehighlight_all ();
 
@@ -513,6 +509,12 @@ tui_enable (void)
   else
     tui_display_main ();
 
+  /* Install the TUI specific hooks.  This must be done after the call to
+     tui_display_main so that we don't detect the symtab changed event it
+     can cause.  */
+  tui_install_hooks ();
+  rl_startup_hook = tui_rl_startup_hook;
+
   /* Restore TUI keymap.  */
   tui_set_key_mode (tui_current_key_mode);
 
@@ -591,18 +593,16 @@ tui_is_window_visible (enum tui_win_type type)
   return tui_win_list[type]->is_visible ();
 }
 
-int
+bool
 tui_get_command_dimension (unsigned int *width, 
                           unsigned int *height)
 {
   if (!tui_active || (TUI_CMD_WIN == NULL))
-    {
-      return 0;
-    }
+    return false;
   
   *width = TUI_CMD_WIN->width;
   *height = TUI_CMD_WIN->height;
-  return 1;
+  return true;
 }
 
 void
This page took 0.029142 seconds and 4 git commands to generate.