void
tui_data_window::clear_detail ()
{
- detail.data_display_info.data_content = NULL;
- detail.data_display_info.data_content_count = 0;
- detail.data_display_info.regs_content = NULL;
- detail.data_display_info.regs_content_count = 0;
- detail.data_display_info.regs_column_count = 1;
- detail.data_display_info.display_regs = FALSE;
+ data_content = NULL;
+ data_content_count = 0;
+ regs_content = NULL;
+ regs_content_count = 0;
+ regs_column_count = 1;
+ display_regs = FALSE;
}
/* Accessor for the source execution info ptr. */
tui_data_window::tui_data_window ()
: tui_win_info (DATA_WIN)
{
- detail.data_display_info.data_content = (tui_win_content) NULL;
- detail.data_display_info.data_content_count = 0;
- detail.data_display_info.regs_content = (tui_win_content) NULL;
- detail.data_display_info.regs_content_count = 0;
- detail.data_display_info.regs_column_count = 1;
- detail.data_display_info.display_regs = FALSE;
- detail.data_display_info.current_group = 0;
+ data_content = NULL;
+ data_content_count = 0;
+ regs_content = NULL;
+ regs_content_count = 0;
+ regs_column_count = 1;
+ display_regs = FALSE;
+ current_group = 0;
}
tui_cmd_window::tui_cmd_window ()
{
if (generic.content != NULL)
{
- tui_free_data_content (detail.data_display_info.regs_content,
- detail.data_display_info.regs_content_count);
- detail.data_display_info.regs_content = NULL;
- detail.data_display_info.regs_content_count = 0;
- tui_free_data_content (detail.data_display_info.data_content,
- detail.data_display_info.data_content_count);
- detail.data_display_info.data_content = NULL;
- detail.data_display_info.data_content_count = 0;
- detail.data_display_info.regs_column_count = 1;
- detail.data_display_info.display_regs = FALSE;
+ tui_free_data_content (regs_content, regs_content_count);
+ regs_content = NULL;
+ regs_content_count = 0;
+ tui_free_data_content (data_content, data_content_count);
+ data_content = NULL;
+ data_content_count = 0;
+ regs_column_count = 1;
+ display_regs = FALSE;
generic.content = NULL;
generic.content_size = 0;
}
{
int num_lines = (-1);
- if (TUI_DATA_WIN->detail.data_display_info.regs_content_count > 0)
+ if (TUI_DATA_WIN->regs_content_count > 0)
{
- num_lines = (TUI_DATA_WIN->detail.data_display_info.regs_content_count /
- TUI_DATA_WIN->detail.data_display_info.regs_column_count);
- if (TUI_DATA_WIN->detail.data_display_info.regs_content_count %
- TUI_DATA_WIN->detail.data_display_info.regs_column_count)
+ num_lines = (TUI_DATA_WIN->regs_content_count
+ / TUI_DATA_WIN->regs_column_count);
+ if (TUI_DATA_WIN->regs_content_count % TUI_DATA_WIN->regs_column_count)
num_lines++;
}
return num_lines;
int
tui_line_from_reg_element_no (int element_no)
{
- if (element_no < TUI_DATA_WIN->detail.data_display_info.regs_content_count)
+ if (element_no < TUI_DATA_WIN->regs_content_count)
{
int i, line = (-1);
i = 1;
while (line == (-1))
{
- if (element_no <
- (TUI_DATA_WIN->detail.data_display_info.regs_column_count * i))
+ if (element_no < TUI_DATA_WIN->regs_column_count * i)
line = i - 1;
else
i++;
int
tui_first_reg_element_no_inline (int line_no)
{
- if ((line_no * TUI_DATA_WIN->detail.data_display_info.regs_column_count)
- <= TUI_DATA_WIN->detail.data_display_info.regs_content_count)
- return ((line_no + 1) *
- TUI_DATA_WIN->detail.data_display_info.regs_column_count) -
- TUI_DATA_WIN->detail.data_display_info.regs_column_count;
+ if ((line_no * TUI_DATA_WIN->regs_column_count)
+ <= TUI_DATA_WIN->regs_content_count)
+ return (((line_no + 1) * TUI_DATA_WIN->regs_column_count)
+ - TUI_DATA_WIN->regs_column_count);
else
return (-1);
}
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 ();
if (TUI_DATA_WIN == NULL || !TUI_DATA_WIN->generic.is_visible)
tui_set_layout_by_name (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;
+ TUI_DATA_WIN->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);
+ group == TUI_DATA_WIN->current_group);
}
if (ret == TUI_FAILURE)
{
- display_info->current_group = 0;
+ TUI_DATA_WIN->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++)
+ for (i = 0; i < TUI_DATA_WIN->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]
+ data_item_win = &TUI_DATA_WIN->regs_content[i]
->which_element.data_window;
win = data_item_win->content[0];
win->which_element.data.highlight = FALSE;
}
- display_info->current_group = group;
+ TUI_DATA_WIN->current_group = group;
tui_display_all_data ();
}
}
int allocated_here = FALSE;
int regnum, pos;
char title[80];
- struct tui_data_info *display_info = &TUI_DATA_WIN->detail.data_display_info;
/* Make a new title showing which group we display. */
snprintf (title, sizeof (title) - 1, "Register group: %s",
nr_regs++;
}
- if (display_info->regs_content_count > 0 && !refresh_values_only)
+ if (TUI_DATA_WIN->regs_content_count > 0 && !refresh_values_only)
{
- tui_free_data_content (display_info->regs_content,
- display_info->regs_content_count);
- display_info->regs_content_count = 0;
+ tui_free_data_content (TUI_DATA_WIN->regs_content,
+ TUI_DATA_WIN->regs_content_count);
+ TUI_DATA_WIN->regs_content_count = 0;
}
- if (display_info->regs_content_count <= 0)
+ if (TUI_DATA_WIN->regs_content_count <= 0)
{
- display_info->regs_content = tui_alloc_content (nr_regs, DATA_WIN);
+ TUI_DATA_WIN->regs_content = tui_alloc_content (nr_regs, DATA_WIN);
allocated_here = TRUE;
refresh_values_only = FALSE;
}
- if (display_info->regs_content != NULL)
+ if (TUI_DATA_WIN->regs_content != NULL)
{
if (!refresh_values_only || allocated_here)
{
TUI_DATA_WIN->generic.content = NULL;
TUI_DATA_WIN->generic.content_size = 0;
tui_add_content_elements (&TUI_DATA_WIN->generic, nr_regs);
- display_info->regs_content = TUI_DATA_WIN->generic.content;
- display_info->regs_content_count = nr_regs;
+ TUI_DATA_WIN->regs_content = TUI_DATA_WIN->generic.content;
+ TUI_DATA_WIN->regs_content_count = nr_regs;
}
/* Now set the register names and values. */
continue;
data_item_win =
- &display_info->regs_content[pos]->which_element.data_window;
+ &TUI_DATA_WIN->regs_content[pos]->which_element.data_window;
data = &data_item_win->content[0]->which_element.data;
if (data)
{
}
TUI_DATA_WIN->generic.content_size =
- display_info->regs_content_count + display_info->data_content_count;
+ TUI_DATA_WIN->regs_content_count + TUI_DATA_WIN->data_content_count;
ret = TUI_SUCCESS;
}
void
tui_display_registers_from (int start_element_no)
{
- struct tui_data_info *display_info = &TUI_DATA_WIN->detail.data_display_info;
-
- if (display_info->regs_content != NULL
- && display_info->regs_content_count > 0)
+ if (TUI_DATA_WIN->regs_content != NULL
+ && TUI_DATA_WIN->regs_content_count > 0)
{
int i = start_element_no;
int j, item_win_width, cur_y;
int max_len = 0;
- for (i = 0; i < display_info->regs_content_count; i++)
+ for (i = 0; i < TUI_DATA_WIN->regs_content_count; i++)
{
struct tui_data_element *data;
struct tui_gen_win_info *data_item_win;
int len;
data_item_win
- = &display_info->regs_content[i]->which_element.data_window;
+ = &TUI_DATA_WIN->regs_content[i]->which_element.data_window;
data = &data_item_win->content[0]->which_element.data;
len = 0;
p = data->content;
item_win_width = max_len + 1;
i = start_element_no;
- display_info->regs_column_count =
+ TUI_DATA_WIN->regs_column_count =
(TUI_DATA_WIN->generic.width - 2) / item_win_width;
- if (display_info->regs_column_count == 0)
- display_info->regs_column_count = 1;
+ if (TUI_DATA_WIN->regs_column_count == 0)
+ TUI_DATA_WIN->regs_column_count = 1;
item_win_width =
- (TUI_DATA_WIN->generic.width - 2) / display_info->regs_column_count;
+ (TUI_DATA_WIN->generic.width - 2) / TUI_DATA_WIN->regs_column_count;
/* Now create each data "sub" window, and write the display into
it. */
cur_y = 1;
- while (i < display_info->regs_content_count
+ while (i < TUI_DATA_WIN->regs_content_count
&& cur_y <= TUI_DATA_WIN->generic.viewport_height)
{
for (j = 0;
- j < display_info->regs_column_count
- && i < display_info->regs_content_count;
+ j < TUI_DATA_WIN->regs_column_count
+ && i < TUI_DATA_WIN->regs_content_count;
j++)
{
struct tui_gen_win_info *data_item_win;
struct tui_data_element *data_element_ptr;
/* Create the window if necessary. */
- data_item_win = &display_info->regs_content[i]
+ data_item_win = &TUI_DATA_WIN->regs_content[i]
->which_element.data_window;
data_element_ptr = &data_item_win->content[0]->which_element.data;
if (data_item_win->handle != NULL
tui_display_reg_element_at_line (int start_element_no,
int start_line_no)
{
- if (TUI_DATA_WIN->detail.data_display_info.regs_content != NULL
- && TUI_DATA_WIN->detail.data_display_info.regs_content_count > 0)
+ if (TUI_DATA_WIN->regs_content != NULL
+ && TUI_DATA_WIN->regs_content_count > 0)
{
int element_no = start_element_no;
the element_no causes us to scroll past the end of the
registers, adjust what element to really start the
display at. */
- if (TUI_DATA_WIN->detail.data_display_info.data_content_count <= 0
+ if (TUI_DATA_WIN->data_content_count <= 0
&& start_line_no > first_line_on_last_page)
element_no
= tui_first_reg_element_no_inline (first_line_on_last_page);
tui_display_registers_from_line (int line_no,
int force_display)
{
- if (TUI_DATA_WIN->detail.data_display_info.regs_content_count > 0)
+ if (TUI_DATA_WIN->regs_content_count > 0)
{
int line, element_no;
if (line_no >= tui_last_regs_line_no ())
{
if ((line = tui_line_from_reg_element_no (
- TUI_DATA_WIN->detail.data_display_info.regs_content_count - 1)) < 0)
+ TUI_DATA_WIN->regs_content_count - 1)) < 0)
line = 0;
}
else
element_no = tui_first_reg_element_no_inline (line);
if (element_no
- < TUI_DATA_WIN->detail.data_display_info.regs_content_count)
+ < TUI_DATA_WIN->regs_content_count)
tui_display_reg_element_at_line (element_no, line);
else
line = (-1);
if (TUI_DATA_WIN != NULL
&& TUI_DATA_WIN->generic.is_visible)
{
- struct tui_data_info *display_info
- = &TUI_DATA_WIN->detail.data_display_info;
-
- if (display_info->regs_content_count <= 0
- && display_info->display_regs)
- tui_show_registers (display_info->current_group);
+ if (TUI_DATA_WIN->regs_content_count <= 0
+ && TUI_DATA_WIN->display_regs)
+ tui_show_registers (TUI_DATA_WIN->current_group);
else
{
int i;
- for (i = 0; (i < display_info->regs_content_count); i++)
+ for (i = 0; (i < TUI_DATA_WIN->regs_content_count); i++)
{
struct tui_data_element *data;
struct tui_gen_win_info *data_item_win_ptr;
int was_hilighted;
- data_item_win_ptr = &display_info->regs_content[i]->
+ data_item_win_ptr = &TUI_DATA_WIN->regs_content[i]->
which_element.data_window;
data = &data_item_win_ptr->content[0]->which_element.data;
was_hilighted = data->highlight;
if (TUI_DATA_WIN != NULL)
{
- group = TUI_DATA_WIN->detail.data_display_info.current_group;
+ group = TUI_DATA_WIN->current_group;
group = reggroup_next (gdbarch, group);
if (group == NULL)
group = reggroup_next (gdbarch, NULL);
if (TUI_DATA_WIN != NULL)
{
- group = TUI_DATA_WIN->detail.data_display_info.current_group;
+ group = TUI_DATA_WIN->current_group;
group = reggroup_prev (gdbarch, group);
if (group == NULL)
group = reggroup_prev (gdbarch, NULL);