@@ -1,5 +1,13 @@
2015-05-20 Andrew Burgess <andrew.burgess@embecosm.com>
+ * tui/tui-layout.c (tui_layout_command): Move call to tui_enable
+ into ...
+ (tui_set_layout_for_display_command): ...here, before calling
+ tui_set_layout. Only set the layout if gdb has not already
+ entered the TUI_FAILURE state.
+
+2015-05-20 Andrew Burgess <andrew.burgess@embecosm.com>
+
* tui/tui-layout.c (layout_completer): New function.
(_initialize_tui_layout): Set completer on layout command.
@@ -460,7 +460,12 @@ tui_set_layout_for_display_command (const char *layout_name)
else
status = TUI_FAILURE;
- tui_set_layout (new_layout);
+ if (status == TUI_SUCCESS)
+ {
+ /* Make sure the curses mode is enabled. */
+ tui_enable ();
+ tui_set_layout (new_layout);
+ }
}
xfree (buf_ptr);
}
@@ -509,9 +514,6 @@ extract_display_start_addr (struct gdbarch **gdbarch_p, CORE_ADDR *addr_p)
static void
tui_layout_command (char *arg, int from_tty)
{
- /* Make sure the curses mode is enabled. */
- tui_enable ();
-
/* Switch to the selected layout. */
if (tui_set_layout_for_display_command (arg) != TUI_SUCCESS)
warning (_("Invalid layout specified.\n%s"), LAYOUT_USAGE);