public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH 03/11] Move some code out of tui-data.h
Date: Wed, 17 Jun 2020 20:15:15 -0600	[thread overview]
Message-ID: <20200618021523.10681-4-tom@tromey.com> (raw)
In-Reply-To: <20200618021523.10681-1-tom@tromey.com>

This moves some code out of tui-data.h, to more closely related
places.  Some unused forward declarations are also removed.

2020-06-17  Tom Tromey  <tom@tromey.com>

	* tui/tui-stack.c (SINGLE_KEY): Move from tui-data.h
	* tui/tui-winsource.h (enum tui_line_or_address_kind)
	(struct tui_line_or_address): Move from tui-data.h.
	* tui/tui-win.c (DEFAULT_TAB_LEN): Move from tui-data.h.
	* tui/tui-data.h (DEFAULT_TAB_LEN): Move to tui-win.c.
	(tui_cmd_window, tui_source_window_base, tui_source_window)
	(tui_disasm_window): Don't declare.
	(enum tui_line_or_address_kind, struct tui_line_or_address): Move
	to tui-winsource.h.
	(SINGLE_KEY): Move to tui-stack.c.
---
 gdb/ChangeLog           | 13 +++++++++++++
 gdb/tui/tui-data.h      | 26 --------------------------
 gdb/tui/tui-stack.c     |  3 +++
 gdb/tui/tui-win.c       |  2 ++
 gdb/tui/tui-winsource.h | 17 +++++++++++++++++
 5 files changed, 35 insertions(+), 26 deletions(-)

diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h
index 1accf3683d4..d96384f6ce7 100644
--- a/gdb/tui/tui-data.h
+++ b/gdb/tui/tui-data.h
@@ -26,11 +26,6 @@
 #include "gdb_curses.h"	/* For WINDOW.  */
 #include "observable.h"
 
-struct tui_cmd_window;
-struct tui_source_window_base;
-struct tui_source_window;
-struct tui_disasm_window;
-
 /* A deleter that calls delwin.  */
 struct curses_deleter
 {
@@ -125,7 +120,6 @@ struct tui_gen_win_info
 };
 
 /* Constant definitions.  */
-#define DEFAULT_TAB_LEN         8
 #define SRC_NAME                "src"
 #define CMD_NAME                "cmd"
 #define DATA_NAME               "regs"
@@ -133,26 +127,6 @@ struct tui_gen_win_info
 #define STATUS_NAME		"status"
 #define MIN_WIN_HEIGHT          3
 
-/* Strings to display in the TUI status line.  */
-#define SINGLE_KEY              "(SingleKey)"
-
-enum tui_line_or_address_kind
-{
-  LOA_LINE,
-  LOA_ADDRESS
-};
-
-/* Structure describing source line or line address.  */
-struct tui_line_or_address
-{
-  enum tui_line_or_address_kind loa;
-  union
-    {
-      int line_no;
-      CORE_ADDR addr;
-    } u;
-};
-
 /* This defines information about each logical window.  */
 struct tui_win_info : public tui_gen_win_info
 {
diff --git a/gdb/tui/tui-stack.c b/gdb/tui/tui-stack.c
index f1e075a3d20..8bd7880f89a 100644
--- a/gdb/tui/tui-stack.c
+++ b/gdb/tui/tui-stack.c
@@ -43,6 +43,9 @@
 #define LINE_PREFIX             "L"
 #define PC_PREFIX               "PC: "
 
+/* Strings to display in the TUI status line.  */
+#define SINGLE_KEY              "(SingleKey)"
+
 /* Minimum/Maximum length of some fields displayed in the TUI status
    line.  */
 #define MIN_LINE_WIDTH     4	/* Use at least 4 digits for line
diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c
index a78837fe689..5f56eca3b2f 100644
--- a/gdb/tui/tui-win.c
+++ b/gdb/tui/tui-win.c
@@ -753,6 +753,8 @@ tui_refresh_all_command (const char *arg, int from_tty)
   tui_refresh_all_win ();
 }
 
+#define DEFAULT_TAB_LEN         8
+
 /* The tab width that should be used by the TUI.  */
 
 unsigned int tui_tab_width = DEFAULT_TAB_LEN;
diff --git a/gdb/tui/tui-winsource.h b/gdb/tui/tui-winsource.h
index 501dd31ccfd..fab1487f637 100644
--- a/gdb/tui/tui-winsource.h
+++ b/gdb/tui/tui-winsource.h
@@ -25,6 +25,23 @@
 #include "tui/tui-data.h"
 #include "symtab.h"
 
+enum tui_line_or_address_kind
+{
+  LOA_LINE,
+  LOA_ADDRESS
+};
+
+/* Structure describing source line or line address.  */
+struct tui_line_or_address
+{
+  enum tui_line_or_address_kind loa;
+  union
+    {
+      int line_no;
+      CORE_ADDR addr;
+    } u;
+};
+
 /* Flags to tell what kind of breakpoint is at current line.  */
 enum tui_bp_flag
 {
-- 
2.17.2


  parent reply	other threads:[~2020-06-18  2:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-18  2:15 [PATCH 00/11] TUI cleanups Tom Tromey
2020-06-18  2:15 ` [PATCH 01/11] Use complete_on_enum in tui_reggroup_completer Tom Tromey
2020-06-18  2:15 ` [PATCH 02/11] Remove tui_expand_tabs Tom Tromey
2020-06-18  2:15 ` Tom Tromey [this message]
2020-06-18  2:15 ` [PATCH 04/11] Remove tui_data_window::name Tom Tromey
2020-06-18  2:15 ` [PATCH 05/11] Remove useless "if' from tui-regs.c Tom Tromey
2020-06-18  2:15 ` [PATCH 06/11] Rename tui_data_item_window::item_no Tom Tromey
2020-06-18  2:15 ` [PATCH 07/11] Don't derive tui_data_item_window from tui_gen_win_info Tom Tromey
2020-06-18  2:15 ` [PATCH 08/11] Remove body of tui_locator_window constructor Tom Tromey
2020-06-18  2:15 ` [PATCH 09/11] Derive tui_locator_window from tui_win_info Tom Tromey
2020-09-20  0:58   ` Simon Marchi
2020-06-18  2:15 ` [PATCH 10/11] Remove tui_gen_win_info Tom Tromey
2020-06-18  2:15 ` [PATCH 11/11] Make tui_win_info::name pure virtual Tom Tromey
2020-07-02  3:24 ` [PATCH 00/11] TUI cleanups Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200618021523.10681-4-tom@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).