Simplify tui_show_disassem
authorTom Tromey <tom@tromey.com>
Fri, 5 Jul 2019 18:38:44 +0000 (12:38 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 13 Aug 2019 20:52:09 +0000 (14:52 -0600)
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.

gdb/ChangeLog
gdb/tui/tui-disasm.c

index 8e70be6ebdd9962a7616a1e81aca39d540782d0b..50128426f0c31a79bb31405f376ff8e96d508007 100644 (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.
index 80f8d47f0acd23a01ed8855fcc78812b742b155c..a442a00019e142583ab405ded51e6b88f6310bbe 100644 (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
This page took 0.045158 seconds and 4 git commands to generate.