This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
#include "tui/tui.h"
struct tui_gen_win_info *win_info);
static enum tui_status
-tui_show_register_group (struct gdbarch *gdbarch, struct reggroup *group,
- struct frame_info *frame, int refresh_values_only);
+tui_show_register_group (struct gdbarch *gdbarch,
+ struct reggroup *group,
+ struct frame_info *frame,
+ int refresh_values_only);
static enum tui_status
-tui_get_register (struct gdbarch *gdbarch, struct frame_info *frame,
- struct tui_data_element *data, int regnum, int *changedp);
-static void tui_register_format
- (struct gdbarch *, struct frame_info *, struct tui_data_element*, int);
+tui_get_register (struct gdbarch *gdbarch,
+ struct frame_info *frame,
+ struct tui_data_element *data,
+ int regnum, int *changedp);
+static void tui_register_format (struct gdbarch *,
+ struct frame_info *,
+ struct tui_data_element*,
+ int);
static void tui_scroll_regs_forward_command (char *, int);
static void tui_scroll_regs_backward_command (char *, int);
}
-/* Answer the index of the first element in line_no. If line_no is past
- the register area (-1) is returned. */
+/* Answer the index of the first element in line_no. If line_no is
+ past the register area (-1) is returned. */
int
tui_first_reg_element_no_inline (int line_no)
{
if (group == 0)
group = general_reggroup;
- /* Say that registers should be displayed, even if there is a problem. */
+ /* 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)
{
int i;
- /* Clear all notation of changed values */
+ /* Clear all notation of changed values. */
for (i = 0; i < display_info->regs_content_count; i++)
{
struct tui_gen_win_info *data_item_win;
/* Set the data window to display the registers of the register group
- using the given frame. Values are refreshed only when refresh_values_only
- is TRUE. */
+ using the given frame. Values are refreshed only when
+ refresh_values_only is TRUE. */
static enum tui_status
-tui_show_register_group (struct gdbarch *gdbarch, struct reggroup *group,
- struct frame_info *frame, int refresh_values_only)
+tui_show_register_group (struct gdbarch *gdbarch,
+ struct reggroup *group,
+ struct frame_info *frame,
+ int refresh_values_only)
{
enum tui_status ret = TUI_FAILURE;
int nr_regs;
/* See how many registers must be displayed. */
nr_regs = 0;
- for (regnum = 0; regnum < NUM_REGS + NUM_PSEUDO_REGS; regnum++)
+ for (regnum = 0;
+ regnum < gdbarch_num_regs (current_gdbarch)
+ + gdbarch_num_pseudo_regs (current_gdbarch);
+ regnum++)
{
/* Must be in the group and have a name. */
if (gdbarch_register_reggroup_p (gdbarch, regnum, group)
display_info->regs_content_count = nr_regs;
}
- /* Now set the register names and values */
+ /* Now set the register names and values. */
pos = 0;
- for (regnum = 0; regnum < NUM_REGS + NUM_PSEUDO_REGS; regnum++)
+ for (regnum = 0;
+ regnum < gdbarch_num_regs (current_gdbarch)
+ + gdbarch_num_pseudo_regs (current_gdbarch);
+ regnum++)
{
struct tui_gen_win_info *data_item_win;
struct tui_data_element *data;
{
struct tui_data_info *display_info = &TUI_DATA_WIN->detail.data_display_info;
- if (display_info->regs_content != (tui_win_content) NULL &&
- display_info->regs_content_count > 0)
+ if (display_info->regs_content != (tui_win_content) NULL
+ && display_info->regs_content_count > 0)
{
int i = start_element_no;
int j, value_chars_wide, item_win_width, cur_y;
item_win_width =
(TUI_DATA_WIN->generic.width - 2) / display_info->regs_column_count;
- /*
- ** Now create each data "sub" window, and write the display into it.
- */
+ /* Now create each data "sub" window, and write the display into
+ it. */
cur_y = 1;
- while (i < display_info->regs_content_count &&
- cur_y <= TUI_DATA_WIN->generic.viewport_height)
+ while (i < display_info->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++)
+ j < display_info->regs_column_count
+ && i < display_info->regs_content_count;
+ j++)
{
- struct tui_gen_win_info * data_item_win;
- struct tui_data_element * data_element_ptr;
+ struct tui_gen_win_info *data_item_win;
+ struct tui_data_element *data_element_ptr;
- /* create the window if necessary */
+ /* Create the window if necessary. */
data_item_win = &display_info->regs_content[i]
->which_element.data_window;
data_element_ptr = &((struct tui_win_element *)
/* Get the printable representation of the register
and display it. */
tui_display_register (data_element_ptr, data_item_win);
- i++; /* next register */
+ i++; /* Next register. */
}
- cur_y++; /* next row; */
+ cur_y++; /* Next row. */
}
}
}
content or the end of the display height. This function checks
that we won't display off the end of the register display. */
void
-tui_display_reg_element_at_line (int start_element_no, int start_line_no)
+tui_display_reg_element_at_line (int start_element_no,
+ int start_line_no)
{
- if (TUI_DATA_WIN->detail.data_display_info.regs_content != (tui_win_content) NULL &&
- TUI_DATA_WIN->detail.data_display_info.regs_content_count > 0)
+ if (TUI_DATA_WIN->detail.data_display_info.regs_content != (tui_win_content) NULL
+ && TUI_DATA_WIN->detail.data_display_info.regs_content_count > 0)
{
int element_no = start_element_no;
first_line_on_last_page = last_line_no - (TUI_DATA_WIN->generic.height - 2);
if (first_line_on_last_page < 0)
first_line_on_last_page = 0;
- /*
- ** If there is no other data displayed except registers,
- ** and 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 &&
- start_line_no > first_line_on_last_page)
+
+ /* If there is no other data displayed except registers, and
+ 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
+ && 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 (element_no);
data window. Answers the line number that the display actually
started from. If nothing is displayed (-1) is returned. */
int
-tui_display_registers_from_line (int line_no, int force_display)
+tui_display_registers_from_line (int line_no,
+ int force_display)
{
if (TUI_DATA_WIN->detail.data_display_info.regs_content_count > 0)
{
if (line_no < 0)
line = 0;
else if (force_display)
- { /*
- ** If we must display regs (force_display is true), then make
- ** sure that we don't display off the end of the registers.
- */
+ { /* If we must display regs (force_display is true), then
+ make sure that we don't display off the end of the
+ registers. */
if (line_no >= tui_last_regs_line_no ())
{
if ((line = tui_line_from_reg_element_no (
return line;
}
- return (-1); /* nothing was displayed */
+ return (-1); /* Nothing was displayed. */
}
void
tui_check_register_values (struct frame_info *frame)
{
- if (TUI_DATA_WIN != NULL && TUI_DATA_WIN->generic.is_visible)
+ 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)
+ if (display_info->regs_content_count <= 0
+ && display_info->display_regs)
tui_show_registers (display_info->current_group);
else
{
}
}
-/* Display a register in a window. If hilite is TRUE,
- then the value will be displayed in reverse video */
+/* Display a register in a window. If hilite is TRUE, then the value
+ will be displayed in reverse video. */
static void
tui_display_register (struct tui_data_element *data,
struct tui_gen_win_info *win_info)
/* Get the register from the frame and make a printable representation
of it in the data element. */
static void
-tui_register_format (struct gdbarch *gdbarch, struct frame_info *frame,
- struct tui_data_element *data_element, int regnum)
+tui_register_format (struct gdbarch *gdbarch,
+ struct frame_info *frame,
+ struct tui_data_element *data_element,
+ int regnum)
{
struct ui_file *stream;
struct ui_file *old_stdout;
do_cleanups (cleanups);
}
-/* Get the register value from the given frame and format it for
- the display. When changep is set, check if the new register value
- has changed with respect to the previous call. */
+/* Get the register value from the given frame and format it for the
+ display. When changep is set, check if the new register value has
+ changed with respect to the previous call. */
static enum tui_status
-tui_get_register (struct gdbarch *gdbarch, struct frame_info *frame,
- struct tui_data_element *data, int regnum, int *changedp)
+tui_get_register (struct gdbarch *gdbarch,
+ struct frame_info *frame,
+ struct tui_data_element *data,
+ int regnum, int *changedp)
{
enum tui_status ret = TUI_FAILURE;