aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-07-05 12:38:44 -0600
committerTom Tromey <tom@tromey.com>2019-08-13 14:52:09 -0600
commit22c3f4909af125b457564db66e3cb3c56cb9abd3 (patch)
tree8ff7f692b27ccb30751d9bdc63df5460d61c95fa
parent16cb7910b946bad4b5f4aa69925361004c4e412f (diff)
downloadfsf-binutils-gdb-22c3f4909af125b457564db66e3cb3c56cb9abd3.zip
fsf-binutils-gdb-22c3f4909af125b457564db66e3cb3c56cb9abd3.tar.gz
fsf-binutils-gdb-22c3f4909af125b457564db66e3cb3c56cb9abd3.tar.bz2
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.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/tui/tui-disasm.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 8e70be6..5012842 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
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.
* tui/tui-layout.c (tui_default_win_height): Now static.
diff --git a/gdb/tui/tui-disasm.c b/gdb/tui/tui-disasm.c
index 80f8d47..a442a00 100644
--- a/gdb/tui/tui-disasm.c
+++ b/gdb/tui/tui-disasm.c
@@ -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