From 489e9d8b7bb3337a7f4f902a03c176c22faeabc7 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Thu, 20 Jun 2019 19:59:06 -0600 Subject: 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 * 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) : Remove. (struct tui_source_info): New. (struct tui_source_window_base) : Change type. * tui/tui-data.c (init_content_element): Remove EXEC_INFO_WIN case, and add assert. (tui_alloc_content): Add assert. --- gdb/tui/tui-data.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gdb/tui/tui-data.c') diff --git a/gdb/tui/tui-data.c b/gdb/tui/tui-data.c index 5eac1dc..119d249 100644 --- a/gdb/tui/tui-data.c +++ b/gdb/tui/tui-data.c @@ -364,6 +364,8 @@ static void init_content_element (struct tui_win_element *element, enum tui_win_type type) { + gdb_assert (type != EXEC_INFO_WIN); + switch (type) { case SRC_WIN: @@ -397,10 +399,6 @@ init_content_element (struct tui_win_element *element, element->which_element.locator.line_no = 0; element->which_element.locator.addr = 0; break; - case EXEC_INFO_WIN: - memset(element->which_element.simple_string, ' ', - sizeof(element->which_element.simple_string)); - break; default: break; } @@ -427,6 +425,8 @@ tui_alloc_content (int num_elements, enum tui_win_type type) struct tui_win_element *element_block_ptr; int i; + gdb_assert (type != EXEC_INFO_WIN); + content = XNEWVEC (struct tui_win_element *, num_elements); /* -- cgit v1.1