Move current_layout to tui-layout.c
authorTom Tromey <tom@tromey.com>
Fri, 5 Jul 2019 18:13:40 +0000 (12:13 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 13 Aug 2019 20:52:09 +0000 (14:52 -0600)
This moves the current_layout global to tui-layout.c.  This allows for
the removal of an accessor function; but also it just seems clearer to
have it here.

gdb/ChangeLog
2019-08-13  Tom Tromey  <tom@tromey.com>

* tui/tui-layout.c (current_layout, tui_current_layout): Move from
tui-data.c.
(show_source_disasm_command, show_data)
(show_source_or_disasm_and_command): Don't use
tui_set_current_layout_to.
* tui/tui-data.h (tui_set_current_layout_to): Don't declare.
* tui/tui-data.c (current_layout, tui_current_layout): Move to
tui-layout.c.
(tui_set_current_layout_to): Remove.

gdb/ChangeLog
gdb/tui/tui-data.c
gdb/tui/tui-data.h
gdb/tui/tui-layout.c

index c0429ecd55b8d8d09ae37867fe921df06b5de607..4276b33fa2d90f9ae316f787a6dce6473b8750ff 100644 (file)
@@ -1,3 +1,15 @@
+2019-08-13  Tom Tromey  <tom@tromey.com>
+
+       * tui/tui-layout.c (current_layout, tui_current_layout): Move from
+       tui-data.c.
+       (show_source_disasm_command, show_data)
+       (show_source_or_disasm_and_command): Don't use
+       tui_set_current_layout_to.
+       * tui/tui-data.h (tui_set_current_layout_to): Don't declare.
+       * tui/tui-data.c (current_layout, tui_current_layout): Move to
+       tui-layout.c.
+       (tui_set_current_layout_to): Remove.
+
 2019-08-13  Tom Tromey  <tom@tromey.com>
 
        * tui/tui-layout.c (tui_set_layout): Update.
index af5e509ff0b293b809f7dad09b26ba59a3429fe8..fd7649bdeab6effb40caa83e3051a590ef63d435 100644 (file)
@@ -35,7 +35,6 @@ struct tui_win_info *tui_win_list[MAX_MAJOR_WINDOWS];
 /***************************
 ** Private data
 ****************************/
-static enum tui_layout_type current_layout = UNDEFINED_LAYOUT;
 static int term_height, term_width;
 static struct tui_locator_window _locator;
 static std::vector<tui_source_window_base *> source_windows;
@@ -170,22 +169,6 @@ tui_set_term_width_to (int w)
 }
 
 
-/* Accessor for the current layout.  */
-enum tui_layout_type
-tui_current_layout (void)
-{
-  return current_layout;
-}
-
-
-/* Mutator for the current layout.  */
-void
-tui_set_current_layout_to (enum tui_layout_type new_layout)
-{
-  current_layout = new_layout;
-}
-
-
 /*****************************
 ** OTHER PUBLIC FUNCTIONS
 *****************************/
index 745181043aaa37e65afe73f033eb61a0416b6d86..dbae2fb3b0045d9589aa51a33065de188650eeaf 100644 (file)
@@ -382,7 +382,6 @@ struct all_tui_windows
 extern void tui_initialize_static_data (void);
 extern struct tui_win_info *tui_partial_win_by_name (const char *);
 extern enum tui_layout_type tui_current_layout (void);
-extern void tui_set_current_layout_to (enum tui_layout_type);
 extern int tui_term_height (void);
 extern void tui_set_term_height_to (int);
 extern int tui_term_width (void);
index 93687f3bd9938c35fa6ea831b07e85fb0f4280e0..2b25e7a57fddcfb59817afc91b99b4c0441f9828 100644 (file)
@@ -55,6 +55,15 @@ static void tui_layout_command (const char *, int);
 static void extract_display_start_addr (struct gdbarch **, CORE_ADDR *);
 
 
+static enum tui_layout_type current_layout = UNDEFINED_LAYOUT;
+
+/* Accessor for the current layout.  */
+enum tui_layout_type
+tui_current_layout (void)
+{
+  return current_layout;
+}
+
 /***************************************
 ** DEFINITIONS
 ***************************************/
@@ -543,7 +552,7 @@ show_source_disasm_command (void)
       /* FIXME tui_cmd_window won't recreate the handle on
         make_visible, so we need this instead.  */
       tui_make_window (TUI_CMD_WIN, DONT_BOX_WINDOW);
-      tui_set_current_layout_to (SRC_DISASSEM_COMMAND);
+      current_layout = SRC_DISASSEM_COMMAND;
     }
 }
 
@@ -597,7 +606,7 @@ show_data (enum tui_layout_type new_layout)
   locator->make_visible (true);
   tui_show_locator_content ();
   tui_add_to_source_windows (base);
-  tui_set_current_layout_to (new_layout);
+  current_layout = new_layout;
 }
 
 void
@@ -675,6 +684,6 @@ show_source_or_disasm_and_command (enum tui_layout_type layout_type)
       /* FIXME tui_cmd_window won't recreate the handle on
         make_visible, so we need this instead.  */
       tui_make_window (TUI_CMD_WIN, DONT_BOX_WINDOW);
-      tui_set_current_layout_to (layout_type);
+      current_layout = layout_type;
     }
 }
This page took 0.032457 seconds and 4 git commands to generate.