コード例 #1
0
ファイル: tui-layout.c プロジェクト: 5kg/gdb
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);

}
コード例 #2
0
/* Show the registers of the given group in the data window
   and refresh the window.  */
void
tui_show_registers (struct reggroup *group)
{
    enum tui_status ret = TUI_FAILURE;
    struct tui_data_info *display_info;

    /* Make sure the curses mode is enabled.  */
    tui_enable ();

    /* Make sure the register window is visible.  If not, select an
       appropriate layout.  */
    if (TUI_DATA_WIN == NULL || !TUI_DATA_WIN->generic.is_visible)
        tui_set_layout_for_display_command (DATA_NAME);

    display_info = &TUI_DATA_WIN->detail.data_display_info;
    if (group == 0)
        group = general_reggroup;

    /* Say that registers should be displayed, even if there is a
       problem.  */
    display_info->display_regs = TRUE;

    if (target_has_registers && target_has_stack && target_has_memory)
    {
        ret = tui_show_register_group (group, get_selected_frame (NULL),
                                       group == display_info->current_group);
    }
    if (ret == TUI_FAILURE)
    {
        display_info->current_group = 0;
        tui_erase_data_content (NO_REGS_STRING);
    }
    else
    {
        int i;

        /* Clear all notation of changed values.  */
        for (i = 0; i < display_info->regs_content_count; i++)
        {
            struct tui_gen_win_info *data_item_win;
            struct tui_win_element *win;

            data_item_win = &display_info->regs_content[i]
                            ->which_element.data_window;
            win = (struct tui_win_element *) data_item_win->content[0];
            win->which_element.data.highlight = FALSE;
        }
        display_info->current_group = group;
        tui_display_all_data ();
    }
}