diff options
author | Tom Tromey <tom@tromey.com> | 2019-06-20 19:59:06 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2019-06-25 07:48:44 -0600 |
commit | 489e9d8b7bb3337a7f4f902a03c176c22faeabc7 (patch) | |
tree | 0ef7391a8ad8df0e8c463889a64c17164f693fcd /gdb/tui/tui-data.h | |
parent | c3fabb7d69b3735bc6042a2992729944c8ced62c (diff) | |
download | gdb-489e9d8b7bb3337a7f4f902a03c176c22faeabc7.zip gdb-489e9d8b7bb3337a7f4f902a03c176c22faeabc7.tar.gz gdb-489e9d8b7bb3337a7f4f902a03c176c22faeabc7.tar.bz2 |
Separate out execution-info window
This pulls the EXEC_INFO_WIN case out into its own subclass of
tui_gen_win_info. This lets us remove an element from
union tui_which_element.
gdb/ChangeLog
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.c
(tui_exec_info_window::maybe_allocate_content): New method.
(tui_set_exec_info_content, tui_show_exec_info_content): Update.
* tui/tui-layout.c (init_and_make_win): Add EXEC_INFO_WIN case.
(make_source_or_disasm_window): Add cast.
* tui/tui-data.h (union tui_which_element) <simple_string>:
Remove.
(struct tui_source_info): New.
(struct tui_source_window_base) <execution_info>: Change type.
* tui/tui-data.c (init_content_element): Remove EXEC_INFO_WIN
case, and add assert.
(tui_alloc_content): Add assert.
Diffstat (limited to 'gdb/tui/tui-data.h')
-rw-r--r-- | gdb/tui/tui-data.h | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h index a82cbb5..c5b518b 100644 --- a/gdb/tui/tui-data.h +++ b/gdb/tui/tui-data.h @@ -249,7 +249,6 @@ union tui_which_element struct tui_data_element data; /* Elements of data_window. */ struct tui_command_element command; /* Command elements. */ struct tui_locator_element locator; /* Locator elements. */ - tui_exec_info_content simple_string; /* Simple char based elements. */ }; struct tui_win_element @@ -257,6 +256,34 @@ struct tui_win_element union tui_which_element which_element; }; +/* Execution info window class. */ + +struct tui_exec_info_window : public tui_gen_win_info +{ + tui_exec_info_window () + : tui_gen_win_info (EXEC_INFO_WIN) + { + } + + ~tui_exec_info_window () override + { + xfree (m_content); + } + + /* Get or allocate contents. */ + tui_exec_info_content *maybe_allocate_content (int n_elements); + + /* Return the contents. */ + const tui_exec_info_content *get_content () const + { + return m_content; + } + +private: + + tui_exec_info_content *m_content = nullptr; +}; + /* This defines information about each logical window. */ struct tui_win_info : public tui_gen_win_info { @@ -380,7 +407,7 @@ public: /* Does the locator belong to this window? */ bool m_has_locator = false; /* Execution information window. */ - struct tui_gen_win_info *execution_info = nullptr; + struct tui_exec_info_window *execution_info = nullptr; /* Used for horizontal scroll. */ int horizontal_offset = 0; struct tui_line_or_address start_line_or_addr; |