Remove tui_display_data_from_line

tui_display_data_from_line is just a wrapper for
tui_display_registers_from_line, so remove it.  Also, nothing passed 0
as the "force_display" parameter to tui_display_registers_from_line,
so remove that parameter as well.

gdb/ChangeLog
2019-07-17  Tom Tromey  <tom@tromey.com>

	* tui/tui-windata.h (tui_display_data_from_line): Don't declare.
	* tui/tui-windata.c (tui_display_data_from_line): Remove.
	(tui_display_data_from, tui_data_window::do_scroll_vertical): Call
	tui_display_registers_from_line.
	* tui/tui-regs.h (tui_display_registers_from_line): Update.
	* tui/tui-regs.c (tui_display_registers_from_line): Remove
	"force_display" parameter.
This commit is contained in:
Tom Tromey 2019-06-26 15:56:56 -06:00
parent baff0c28b8
commit 80cb6c2709
5 changed files with 26 additions and 37 deletions

View File

@ -1,3 +1,13 @@
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-windata.h (tui_display_data_from_line): Don't declare.
* tui/tui-windata.c (tui_display_data_from_line): Remove.
(tui_display_data_from, tui_data_window::do_scroll_vertical): Call
tui_display_registers_from_line.
* tui/tui-regs.h (tui_display_registers_from_line): Update.
* tui/tui-regs.c (tui_display_registers_from_line): Remove
"force_display" parameter.
2019-07-17 Tom Tromey <tom@tromey.com> 2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-regs.h (tui_first_reg_element_no_inline): Don't * tui/tui-regs.h (tui_first_reg_element_no_inline): Don't

View File

@ -372,38 +372,34 @@ tui_display_reg_element_at_line (int start_element_no,
data window. Answers the line number that the display actually data window. Answers the line number that the display actually
started from. If nothing is displayed (-1) is returned. */ started from. If nothing is displayed (-1) is returned. */
int int
tui_display_registers_from_line (int line_no, tui_display_registers_from_line (int line_no)
int force_display)
{ {
tui_check_and_display_highlight_if_needed (TUI_DATA_WIN);
if (!TUI_DATA_WIN->regs_content.empty ()) if (!TUI_DATA_WIN->regs_content.empty ())
{ {
int line, element_no; int element_no;
if (line_no < 0) if (line_no < 0)
line = 0; line_no = 0;
else if (force_display) else
{ /* If we must display regs (force_display is true), then {
make sure that we don't display off the end of the /* Make sure that we don't display off the end of the
registers. */ registers. */
if (line_no >= TUI_DATA_WIN->last_regs_line_no ()) if (line_no >= TUI_DATA_WIN->last_regs_line_no ())
{ {
if ((line = TUI_DATA_WIN->line_from_reg_element_no ( if ((line_no = TUI_DATA_WIN->line_from_reg_element_no (
TUI_DATA_WIN->regs_content.size () - 1)) < 0) TUI_DATA_WIN->regs_content.size () - 1)) < 0)
line = 0; line_no = 0;
} }
else
line = line_no;
} }
else
line = line_no;
element_no = TUI_DATA_WIN->first_reg_element_no_inline (line); element_no = TUI_DATA_WIN->first_reg_element_no_inline (line_no);
if (element_no < TUI_DATA_WIN->regs_content.size ()) if (element_no < TUI_DATA_WIN->regs_content.size ())
tui_display_reg_element_at_line (element_no, line); tui_display_reg_element_at_line (element_no, line_no);
else else
line = (-1); line_no = (-1);
return line; return line_no;
} }
return (-1); /* Nothing was displayed. */ return (-1); /* Nothing was displayed. */

View File

@ -27,7 +27,7 @@
extern void tui_check_register_values (struct frame_info *); extern void tui_check_register_values (struct frame_info *);
extern void tui_show_registers (struct reggroup *group); extern void tui_show_registers (struct reggroup *group);
extern void tui_display_registers_from (int); extern void tui_display_registers_from (int);
extern int tui_display_registers_from_line (int, int); extern int tui_display_registers_from_line (int);
extern int tui_first_reg_element_inline (int); extern int tui_first_reg_element_inline (int);
#endif /* TUI_TUI_REGS_H */ #endif /* TUI_TUI_REGS_H */

View File

@ -111,22 +111,6 @@ tui_display_all_data (void)
} }
/* Function to display the data starting at line, line_no, in the data
window. */
void
tui_display_data_from_line (int line_no)
{
int _line_no = line_no;
if (line_no < 0)
_line_no = 0;
tui_check_and_display_highlight_if_needed (TUI_DATA_WIN);
tui_display_registers_from_line (_line_no, TRUE);
}
/* Display data starting at element element_no. */ /* Display data starting at element element_no. */
void void
tui_display_data_from (int element_no, int reuse_windows) tui_display_data_from (int element_no, int reuse_windows)
@ -144,7 +128,7 @@ tui_display_data_from (int element_no, int reuse_windows)
tui_erase_data_content (NULL); tui_erase_data_content (NULL);
if (!reuse_windows) if (!reuse_windows)
tui_delete_data_content_windows (); tui_delete_data_content_windows ();
tui_display_data_from_line (first_line); tui_display_registers_from_line (first_line);
} }
} }
@ -184,7 +168,7 @@ tui_data_window::do_scroll_vertical (int num_to_scroll)
first_line += num_to_scroll; first_line += num_to_scroll;
tui_erase_data_content (NULL); tui_erase_data_content (NULL);
tui_delete_data_content_windows (); tui_delete_data_content_windows ();
tui_display_data_from_line (first_line); tui_display_registers_from_line (first_line);
} }
} }

View File

@ -26,7 +26,6 @@
extern void tui_erase_data_content (const char *); extern void tui_erase_data_content (const char *);
extern void tui_display_all_data (void); extern void tui_display_all_data (void);
extern void tui_display_data_from_line (int);
extern void tui_delete_data_content_windows (void); extern void tui_delete_data_content_windows (void);
extern void tui_refresh_data_win (void); extern void tui_refresh_data_win (void);
extern void tui_display_data_from (int, int); extern void tui_display_data_from (int, int);