- show_layout (new_layout);
-
- /* Now determine where focus should be. */
- if (win_with_focus != TUI_CMD_WIN)
- {
- switch (new_layout)
- {
- case SRC_COMMAND:
- tui_set_win_focus_to (TUI_SRC_WIN);
- layout_def->display_mode = SRC_WIN;
- layout_def->split = FALSE;
- break;
- case DISASSEM_COMMAND:
- /* The previous layout was not showing code.
- This can happen if there is no source
- available:
-
- 1. if the source file is in another dir OR
- 2. if target was compiled without -g
- We still want to show the assembly though! */
-
- tui_get_begin_asm_address (&gdbarch, &addr);
- tui_set_win_focus_to (TUI_DISASM_WIN);
- layout_def->display_mode = DISASSEM_WIN;
- layout_def->split = FALSE;
- break;
- case SRC_DISASSEM_COMMAND:
- /* The previous layout was not showing code.
- This can happen if there is no source
- available:
-
- 1. if the source file is in another dir OR
- 2. if target was compiled without -g
- We still want to show the assembly though! */
-
- tui_get_begin_asm_address (&gdbarch, &addr);
- if (win_with_focus == TUI_SRC_WIN)
- tui_set_win_focus_to (TUI_SRC_WIN);
- else
- tui_set_win_focus_to (TUI_DISASM_WIN);
- layout_def->split = TRUE;
- break;
- case SRC_DATA_COMMAND:
- if (win_with_focus != TUI_DATA_WIN)
- tui_set_win_focus_to (TUI_SRC_WIN);
- else
- tui_set_win_focus_to (TUI_DATA_WIN);
- layout_def->display_mode = SRC_WIN;
- layout_def->split = FALSE;
- break;
- case DISASSEM_DATA_COMMAND:
- /* The previous layout was not showing code.
- This can happen if there is no source
- available:
-
- 1. if the source file is in another dir OR
- 2. if target was compiled without -g
- We still want to show the assembly though! */
-
- tui_get_begin_asm_address (&gdbarch, &addr);
- if (win_with_focus != TUI_DATA_WIN)
- tui_set_win_focus_to (TUI_DISASM_WIN);
- else
- tui_set_win_focus_to (TUI_DATA_WIN);
- layout_def->display_mode = DISASSEM_WIN;
- layout_def->split = FALSE;
- break;
- default:
- break;
- }
- }
- /*
- * Now update the window content.
- */
- if (!regs_populate
- && (new_layout == SRC_DATA_COMMAND
- || new_layout == DISASSEM_DATA_COMMAND))
- tui_display_all_data ();
-
- tui_update_source_windows_with_addr (gdbarch, addr);
-
- if (regs_populate)
- tui_show_registers (TUI_DATA_WIN->current_group);