aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-07-05 17:32:19 -0600
committerTom Tromey <tom@tromey.com>2019-08-13 14:52:09 -0600
commit7b56485db5187e6c63f330e1eb35f63b50327b74 (patch)
treeb0220bd7ad148e7f02626ef539b970fdbc594b5e
parent7ba913dcdf2f94cbd501d763f0fc55a46d10331c (diff)
downloadgdb-7b56485db5187e6c63f330e1eb35f63b50327b74.zip
gdb-7b56485db5187e6c63f330e1eb35f63b50327b74.tar.gz
gdb-7b56485db5187e6c63f330e1eb35f63b50327b74.tar.bz2
Move code to tui-winsource.h
This moves code related to the execution info window from tui-data.h to tui-winsource.h. It fits better here because the execution info is conceptually part of the source and disassembly windows, and tui-winsource.h is where this common class lives. gdb/ChangeLog 2019-08-13 Tom Tromey <tom@tromey.com> * tui/tui-data.h (enum tui_bp_flag, tui_bp_flags, struct tui_source_element) (TUI_BP_HIT_POS, TUI_BP_BREAK_POS, TUI_EXEC_POS) (TUI_EXECINFO_SIZE, tui_exec_info_content): Move ... * tui/tui-winsource.h (enum tui_bp_flag, tui_bp_flags, struct tui_source_element, TUI_BP_HIT_POS, TUI_BP_BREAK_POS) (TUI_EXEC_POS, TUI_EXECINFO_SIZE, tui_exec_info_content): ... here.
-rw-r--r--gdb/ChangeLog10
-rw-r--r--gdb/tui/tui-data.h41
-rw-r--r--gdb/tui/tui-winsource.h41
3 files changed, 51 insertions, 41 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 481cef8..750ce86 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,15 @@
2019-08-13 Tom Tromey <tom@tromey.com>
+ * tui/tui-data.h (enum tui_bp_flag, tui_bp_flags, struct tui_source_element)
+ (TUI_BP_HIT_POS, TUI_BP_BREAK_POS, TUI_EXEC_POS)
+ (TUI_EXECINFO_SIZE, tui_exec_info_content): Move ...
+ * tui/tui-winsource.h (enum tui_bp_flag, tui_bp_flags, struct
+ tui_source_element, TUI_BP_HIT_POS, TUI_BP_BREAK_POS)
+ (TUI_EXEC_POS, TUI_EXECINFO_SIZE, tui_exec_info_content):
+ ... here.
+
+2019-08-13 Tom Tromey <tom@tromey.com>
+
* tui/tui-winsource.h (struct tui_source_window_base)
<update_exec_info>: Declare.
(tui_update_exec_info): Don't declare.
diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h
index 6683848..08178e4 100644
--- a/gdb/tui/tui-data.h
+++ b/gdb/tui/tui-data.h
@@ -151,53 +151,12 @@ struct tui_line_or_address
} u;
};
-/* Flags to tell what kind of breakpoint is at current line. */
-enum tui_bp_flag
-{
- TUI_BP_ENABLED = 0x01,
- TUI_BP_DISABLED = 0x02,
- TUI_BP_HIT = 0x04,
- TUI_BP_CONDITIONAL = 0x08,
- TUI_BP_HARDWARE = 0x10
-};
-
-DEF_ENUM_FLAGS_TYPE (enum tui_bp_flag, tui_bp_flags);
-
-/* Elements in the Source/Disassembly Window. */
-struct tui_source_element
-{
- tui_source_element ()
- {
- line_or_addr.loa = LOA_LINE;
- line_or_addr.u.line_no = 0;
- }
-
- ~tui_source_element ()
- {
- xfree (line);
- }
-
- char *line = nullptr;
- struct tui_line_or_address line_or_addr;
- bool is_exec_point = false;
- tui_bp_flags break_mode = 0;
-};
-
-
#ifdef PATH_MAX
# define MAX_LOCATOR_ELEMENT_LEN PATH_MAX
#else
# define MAX_LOCATOR_ELEMENT_LEN 1024
#endif
-/* Position of breakpoint markers in the exec info string. */
-#define TUI_BP_HIT_POS 0
-#define TUI_BP_BREAK_POS 1
-#define TUI_EXEC_POS 2
-#define TUI_EXECINFO_SIZE 4
-
-typedef char tui_exec_info_content[TUI_EXECINFO_SIZE];
-
/* Locator window class. */
struct tui_locator_window : public tui_gen_win_info
diff --git a/gdb/tui/tui-winsource.h b/gdb/tui/tui-winsource.h
index bce889d..71201e5 100644
--- a/gdb/tui/tui-winsource.h
+++ b/gdb/tui/tui-winsource.h
@@ -24,6 +24,26 @@
#include "tui/tui-data.h"
+/* Flags to tell what kind of breakpoint is at current line. */
+enum tui_bp_flag
+{
+ TUI_BP_ENABLED = 0x01,
+ TUI_BP_DISABLED = 0x02,
+ TUI_BP_HIT = 0x04,
+ TUI_BP_CONDITIONAL = 0x08,
+ TUI_BP_HARDWARE = 0x10
+};
+
+DEF_ENUM_FLAGS_TYPE (enum tui_bp_flag, tui_bp_flags);
+
+/* Position of breakpoint markers in the exec info string. */
+#define TUI_BP_HIT_POS 0
+#define TUI_BP_BREAK_POS 1
+#define TUI_EXEC_POS 2
+#define TUI_EXECINFO_SIZE 4
+
+typedef char tui_exec_info_content[TUI_EXECINFO_SIZE];
+
/* Execution info window class. */
struct tui_exec_info_window : public tui_gen_win_info
@@ -52,6 +72,27 @@ private:
tui_exec_info_content *m_content = nullptr;
};
+/* Elements in the Source/Disassembly Window. */
+struct tui_source_element
+{
+ tui_source_element ()
+ {
+ line_or_addr.loa = LOA_LINE;
+ line_or_addr.u.line_no = 0;
+ }
+
+ ~tui_source_element ()
+ {
+ xfree (line);
+ }
+
+ char *line = nullptr;
+ struct tui_line_or_address line_or_addr;
+ bool is_exec_point = false;
+ tui_bp_flags break_mode = 0;
+};
+
+
/* The base class for all source-like windows, namely the source and
disassembly windows. */