Simplify tui_show_disassem

tui_show_disassem does not need to call tui_add_win_to_layout, because
the callers that could change the layout have already ensured that it
exists.

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

	* tui/tui-disasm.c (tui_show_disassem): Add assertion.  Don't call
	tui_add_win_to_layout.
This commit is contained in:
Tom Tromey 2019-07-05 12:38:44 -06:00
parent 16cb7910b9
commit 22c3f4909a
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2019-08-13 Tom Tromey <tom@tromey.com>
* tui/tui-disasm.c (tui_show_disassem): Add assertion. Don't call
tui_add_win_to_layout.
2019-08-13 Tom Tromey <tom@tromey.com>
* tui/tui-layout.h (tui_default_win_height): Don't declare.

View File

@ -255,9 +255,10 @@ tui_show_disassem (struct gdbarch *gdbarch, CORE_ADDR start_addr)
struct tui_win_info *win_with_focus = tui_win_with_focus ();
struct tui_line_or_address val;
gdb_assert (TUI_DISASM_WIN != nullptr && TUI_DISASM_WIN->is_visible);
val.loa = LOA_ADDRESS;
val.u.addr = start_addr;
tui_add_win_to_layout (DISASSEM_WIN);
tui_update_source_window (TUI_DISASM_WIN, gdbarch, s, val, FALSE);
/* If the focus was in the src win, put it in the asm win, if the