]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Move locator code to tui-stack.c
authorTom Tromey <tom@tromey.com>
Sat, 6 Jul 2019 17:32:06 +0000 (11:32 -0600)
committerTom Tromey <tom@tromey.com>
Thu, 15 Aug 2019 18:29:28 +0000 (12:29 -0600)
The locator is mostly implemented in tui-stack.c.  This moves the
remaining bits to tui-stack.c and tui-stack.h, as appropriate.

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

* tui/tui-wingeneral.c: Include tui-stack.h.
* tui/tui-stack.h (MAX_LOCATOR_ELEMENT_LEN)
(struct tui_locator_window): Move from tui-data.h.
* tui/tui-stack.c (_locator, tui_locator_win_info_ptr)
(tui_initialize_static_data): Move from tui-data.c.
* tui/tui-data.h (MAX_LOCATOR_ELEMENT_LEN)
(struct tui_locator_window): Move to tui-stack.c.
* tui/tui-data.c (_locator, tui_locator_win_info_ptr)
(tui_initialize_static_data): Move to tui-stack.c.

gdb/ChangeLog
gdb/tui/tui-data.c
gdb/tui/tui-data.h
gdb/tui/tui-stack.c
gdb/tui/tui-stack.h
gdb/tui/tui-wingeneral.c

index 49e01cee373f5ef60bee85dbb4aaf9a8e1dfe284..129d85d9030713972ca2db4ffb9a4218f6639e77 100644 (file)
@@ -1,3 +1,15 @@
+2019-08-15  Tom Tromey  <tom@tromey.com>
+
+       * tui/tui-wingeneral.c: Include tui-stack.h.
+       * tui/tui-stack.h (MAX_LOCATOR_ELEMENT_LEN)
+       (struct tui_locator_window): Move from tui-data.h.
+       * tui/tui-stack.c (_locator, tui_locator_win_info_ptr)
+       (tui_initialize_static_data): Move from tui-data.c.
+       * tui/tui-data.h (MAX_LOCATOR_ELEMENT_LEN)
+       (struct tui_locator_window): Move to tui-stack.c.
+       * tui/tui-data.c (_locator, tui_locator_win_info_ptr)
+       (tui_initialize_static_data): Move to tui-stack.c.
+
 2019-08-15  Tom Tromey  <tom@tromey.com>
 
        * tui/tui-layout.c (show_source_disasm_command)
index add1f33926f20cd27da3aaddffaea025dba70151..c308237d187b9c98bdef0d943148f2b556a7503c 100644 (file)
@@ -36,7 +36,6 @@ struct tui_win_info *tui_win_list[MAX_MAJOR_WINDOWS];
 ** Private data
 ****************************/
 static int term_height, term_width;
-static struct tui_locator_window _locator;
 static std::vector<tui_source_window_base *> source_windows;
 static struct tui_win_info *win_with_focus = NULL;
 
@@ -128,15 +127,6 @@ tui_add_to_source_windows (struct tui_source_window_base *win_info)
     source_windows.push_back (win_info);
 }
 
-/* Accessor for the locator win info.  Answers a pointer to the static
-   locator win info struct.  */
-struct tui_locator_window *
-tui_locator_win_info_ptr (void)
-{
-  return &_locator;
-}
-
-
 /* Accessor for the term_height.  */
 int
 tui_term_height (void)
@@ -253,21 +243,6 @@ tui_partial_win_by_name (const char *name)
   return NULL;
 }
 
-
-void
-tui_initialize_static_data ()
-{
-  tui_gen_win_info *win = tui_locator_win_info_ptr ();
-  win->width =
-    win->height =
-    win->origin.x =
-    win->origin.y =
-    win->viewport_height = 0;
-  win->handle = NULL;
-  win->is_visible = false;
-  win->title = 0;
-}
-
 /* See tui-data.h.  */
 
 void
index 017e7a40f52bce80892bda24889e54c2d6f81018..b5eeecdee9737a248bbb787a95c3efcbe3ef1e9a 100644 (file)
@@ -148,31 +148,6 @@ struct tui_line_or_address
     } u;
 };
 
-#ifdef PATH_MAX
-# define MAX_LOCATOR_ELEMENT_LEN        PATH_MAX
-#else
-# define MAX_LOCATOR_ELEMENT_LEN        1024
-#endif
-
-/* Locator window class.  */
-
-struct tui_locator_window : public tui_gen_win_info
-{
-  tui_locator_window ()
-    : tui_gen_win_info (LOCATOR_WIN)
-  {
-    full_name[0] = 0;
-    proc_name[0] = 0;
-  }
-
-  char full_name[MAX_LOCATOR_ELEMENT_LEN];
-  char proc_name[MAX_LOCATOR_ELEMENT_LEN];
-  int line_no = 0;
-  CORE_ADDR addr = 0;
-  /* Architecture associated with code at this location.  */
-  struct gdbarch *gdbarch = nullptr;
-};
-
 /* This defines information about each logical window.  */
 struct tui_win_info : public tui_gen_win_info
 {
index 0a712231fa5d64cc6b36b862ac2f871cbf2820e2..c67ac1ba549f9ed5b4eea5ef65deae38eba661e3 100644 (file)
@@ -39,6 +39,8 @@
 
 #include "gdb_curses.h"
 
+static struct tui_locator_window _locator;
+
 /* Get a printable name for the function at the address.
    The symbol name is demangled if demangling is turned on.
    Returns a pointer to a static area holding the result.  */
@@ -56,6 +58,29 @@ static int tui_set_locator_info (struct gdbarch *gdbarch,
 static void tui_update_command (const char *, int);
 \f
 
+/* Accessor for the locator win info.  Answers a pointer to the static
+   locator win info struct.  */
+struct tui_locator_window *
+tui_locator_win_info_ptr (void)
+{
+  return &_locator;
+}
+
+void
+tui_initialize_static_data ()
+{
+  tui_gen_win_info *win = tui_locator_win_info_ptr ();
+  win->width =
+    win->height =
+    win->origin.x =
+    win->origin.y =
+    win->viewport_height = 0;
+  win->handle = NULL;
+  win->is_visible = false;
+  win->title = 0;
+}
+
+
 /* Create the status line to display as much information as we can on
    this single line: target name, process number, current function,
    current line, current PC, SingleKey mode.  */
index 0a88f49932e9d97b2258dbb93e4e54bfb4d478bf..51c976b2f56329ebc624d7d7721404adb3589b1e 100644 (file)
 #ifndef TUI_TUI_STACK_H
 #define TUI_TUI_STACK_H
 
+#include "tui/tui-data.h"
+
 struct frame_info;
 
+#ifdef PATH_MAX
+# define MAX_LOCATOR_ELEMENT_LEN        PATH_MAX
+#else
+# define MAX_LOCATOR_ELEMENT_LEN        1024
+#endif
+
+/* Locator window class.  */
+
+struct tui_locator_window : public tui_gen_win_info
+{
+  tui_locator_window ()
+    : tui_gen_win_info (LOCATOR_WIN)
+  {
+    full_name[0] = 0;
+    proc_name[0] = 0;
+  }
+
+  char full_name[MAX_LOCATOR_ELEMENT_LEN];
+  char proc_name[MAX_LOCATOR_ELEMENT_LEN];
+  int line_no = 0;
+  CORE_ADDR addr = 0;
+  /* Architecture associated with code at this location.  */
+  struct gdbarch *gdbarch = nullptr;
+};
+
 extern void tui_update_locator_fullname (const char *);
 extern void tui_show_locator_content (void);
 extern int tui_show_frame_info (struct frame_info *);
index e2d06bcebad77962bf93799efb20035e00360413..52583cfb8ac3b0d382d7e07d80be05ea012b1060 100644 (file)
@@ -24,6 +24,7 @@
 #include "tui/tui-data.h"
 #include "tui/tui-wingeneral.h"
 #include "tui/tui-win.h"
+#include "tui/tui-stack.h"
 
 #include "gdb_curses.h"