]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Rearrange tui-regs.c some more
authorTom Tromey <tom@tromey.com>
Sat, 13 Jul 2019 22:08:33 +0000 (16:08 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 20 Aug 2019 22:45:50 +0000 (16:45 -0600)
This moves tui_reg_layout later in tui-regs.c, closer to where it is
used.

It also changes tui_show_registers not to enable the TUI or change the
layout -- this is already done by this point by all the callers.

2019-08-20  Tom Tromey  <tom@tromey.com>

* tui/tui-regs.c (tui_reg_layout): Move later.
(tui_show_registers): Don't enable TUI mode or change layout.

gdb/ChangeLog
gdb/tui/tui-regs.c

index fd3c8489a8ae7901e33a35e050466f6082c4e179..27fcb35a557b035fe38e876527b73ae12b43d03e 100644 (file)
@@ -1,3 +1,8 @@
+2019-08-20  Tom Tromey  <tom@tromey.com>
+
+       * tui/tui-regs.c (tui_reg_layout): Move later.
+       (tui_show_registers): Don't enable TUI mode or change layout.
+
 2019-08-20  Tom Tromey  <tom@tromey.com>
 
        * tui/tui-regs.h (struct tui_data_item_window)
index a899b1df694b9a181ff8ce93696d17ad4a708e22..147f57a13a2c2949d69a7976af6f588eef6b2a0f 100644 (file)
@@ -149,34 +149,11 @@ tui_data_window::first_reg_element_no_inline (int line_no) const
     return (-1);
 }
 
-/* A helper function to display the register window in the appropriate
-   way.  */
-
-static void
-tui_reg_layout ()
-{
-  enum tui_layout_type cur_layout = tui_current_layout ();
-  enum tui_layout_type new_layout;
-  if (cur_layout == SRC_COMMAND || cur_layout == SRC_DATA_COMMAND)
-    new_layout = SRC_DATA_COMMAND;
-  else
-    new_layout = DISASSEM_DATA_COMMAND;
-  tui_set_layout (new_layout);
-}
-
 /* Show the registers of the given group in the data window
    and refresh the window.  */
 void
 tui_show_registers (struct reggroup *group)
 {
-  /* Make sure the curses mode is enabled.  */
-  tui_enable ();
-
-  /* Make sure the register window is visible.  If not, select an
-     appropriate layout.  */
-  if (TUI_DATA_WIN == NULL || !TUI_DATA_WIN->is_visible ())
-    tui_reg_layout ();
-
   if (group == 0)
     group = general_reggroup;
 
@@ -676,6 +653,21 @@ tui_reg_prev (struct reggroup *current_group, struct gdbarch *gdbarch)
   return group;
 }
 
+/* A helper function to display the register window in the appropriate
+   way.  */
+
+static void
+tui_reg_layout ()
+{
+  enum tui_layout_type cur_layout = tui_current_layout ();
+  enum tui_layout_type new_layout;
+  if (cur_layout == SRC_COMMAND || cur_layout == SRC_DATA_COMMAND)
+    new_layout = SRC_DATA_COMMAND;
+  else
+    new_layout = DISASSEM_DATA_COMMAND;
+  tui_set_layout (new_layout);
+}
+
 /* Implement the 'tui reg' command.  Changes the register group displayed
    in the tui register window.  Displays the tui register window if it is
    not already on display.  */