mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-27 22:48:57 +08:00
Remove unused parameter from two TUI functions
The "display_prompt" parameter of tui_erase_source_content and tui_clear_source_content was never passed the NO_EMPTY_SOURCE_PROMPT value, so remove the parameter. Once this is done, the EMPTY_SOURCE_PROMPT and NO_EMPTY_SOURCE_PROMPT defines are unused, so remove those as well. gdb/ChangeLog 2019-07-17 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (tui_erase_source_content) (tui_clear_source_content): Remove "display_prompt" parameter. * tui/tui-winsource.c (tui_update_source_window_as_is) (tui_update_source_windows_with_addr): Update. (tui_clear_source_content): Remove "display_prompt" parameter. (tui_erase_source_content): Likewise. Simplify. (tui_show_source_content): Update. * tui/tui-win.c (tui_resize_all, tui_adjust_win_heights): Update. * tui/tui-stack.c (tui_show_frame_info): Update. * tui/tui-data.h (EMPTY_SOURCE_PROMPT, NO_EMPTY_SOURCE_PROMPT): Remove defines.
This commit is contained in:
@ -1,3 +1,17 @@
|
|||||||
|
2019-07-17 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
|
* tui/tui-winsource.h (tui_erase_source_content)
|
||||||
|
(tui_clear_source_content): Remove "display_prompt" parameter.
|
||||||
|
* tui/tui-winsource.c (tui_update_source_window_as_is)
|
||||||
|
(tui_update_source_windows_with_addr): Update.
|
||||||
|
(tui_clear_source_content): Remove "display_prompt" parameter.
|
||||||
|
(tui_erase_source_content): Likewise. Simplify.
|
||||||
|
(tui_show_source_content): Update.
|
||||||
|
* tui/tui-win.c (tui_resize_all, tui_adjust_win_heights): Update.
|
||||||
|
* tui/tui-stack.c (tui_show_frame_info): Update.
|
||||||
|
* tui/tui-data.h (EMPTY_SOURCE_PROMPT, NO_EMPTY_SOURCE_PROMPT):
|
||||||
|
Remove defines.
|
||||||
|
|
||||||
2019-07-17 Tom Tromey <tom@tromey.com>
|
2019-07-17 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
* tui/tui-winsource.c (tui_update_source_window_as_is): Update.
|
* tui/tui-winsource.c (tui_update_source_window_as_is): Update.
|
||||||
|
@ -109,8 +109,6 @@ enum tui_box
|
|||||||
#define NO_HILITE FALSE
|
#define NO_HILITE FALSE
|
||||||
#define WITH_LOCATOR TRUE
|
#define WITH_LOCATOR TRUE
|
||||||
#define NO_LOCATOR FALSE
|
#define NO_LOCATOR FALSE
|
||||||
#define EMPTY_SOURCE_PROMPT TRUE
|
|
||||||
#define NO_EMPTY_SOURCE_PROMPT FALSE
|
|
||||||
#define UNDEFINED_ITEM -1
|
#define UNDEFINED_ITEM -1
|
||||||
#define MIN_WIN_HEIGHT 3
|
#define MIN_WIN_HEIGHT 3
|
||||||
#define MIN_CMD_WIN_HEIGHT 3
|
#define MIN_CMD_WIN_HEIGHT 3
|
||||||
|
@ -444,7 +444,7 @@ tui_show_frame_info (struct frame_info *fi)
|
|||||||
tui_show_locator_content ();
|
tui_show_locator_content ();
|
||||||
for (struct tui_source_window_base *win_info : tui_source_windows ())
|
for (struct tui_source_window_base *win_info : tui_source_windows ())
|
||||||
{
|
{
|
||||||
tui_clear_source_content (win_info, EMPTY_SOURCE_PROMPT);
|
tui_clear_source_content (win_info);
|
||||||
tui_update_exec_info (win_info);
|
tui_update_exec_info (win_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -610,7 +610,7 @@ tui_resize_all (void)
|
|||||||
first_win->make_visible_with_new_height ();
|
first_win->make_visible_with_new_height ();
|
||||||
TUI_CMD_WIN->make_visible_with_new_height ();
|
TUI_CMD_WIN->make_visible_with_new_height ();
|
||||||
if (src_win->content.empty ())
|
if (src_win->content.empty ())
|
||||||
tui_erase_source_content (src_win, EMPTY_SOURCE_PROMPT);
|
tui_erase_source_content (src_win);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (cur_layout == SRC_DISASSEM_COMMAND)
|
if (cur_layout == SRC_DISASSEM_COMMAND)
|
||||||
@ -675,7 +675,7 @@ tui_resize_all (void)
|
|||||||
second_win->make_visible_with_new_height ();
|
second_win->make_visible_with_new_height ();
|
||||||
TUI_CMD_WIN->make_visible_with_new_height ();
|
TUI_CMD_WIN->make_visible_with_new_height ();
|
||||||
if (src_win->content.empty ())
|
if (src_win->content.empty ())
|
||||||
tui_erase_source_content (src_win, EMPTY_SOURCE_PROMPT);
|
tui_erase_source_content (src_win);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* Now remove all invisible windows, and their content so that
|
/* Now remove all invisible windows, and their content so that
|
||||||
@ -1113,8 +1113,7 @@ tui_adjust_win_heights (struct tui_win_info *primary_win_info,
|
|||||||
tui_source_window_base *src_base
|
tui_source_window_base *src_base
|
||||||
= (tui_source_window_base *) src_win_info;
|
= (tui_source_window_base *) src_win_info;
|
||||||
if (src_base->content.empty ())
|
if (src_base->content.empty ())
|
||||||
tui_erase_source_content (src_base,
|
tui_erase_source_content (src_base);
|
||||||
EMPTY_SOURCE_PROMPT);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1221,9 +1220,9 @@ tui_adjust_win_heights (struct tui_win_info *primary_win_info,
|
|||||||
second_win->make_visible_with_new_height ();
|
second_win->make_visible_with_new_height ();
|
||||||
first_win->make_visible_with_new_height ();
|
first_win->make_visible_with_new_height ();
|
||||||
if (src1 != nullptr && src1->content.empty ())
|
if (src1 != nullptr && src1->content.empty ())
|
||||||
tui_erase_source_content (src1, EMPTY_SOURCE_PROMPT);
|
tui_erase_source_content (src1);
|
||||||
if (second_win->content.empty ())
|
if (second_win->content.empty ())
|
||||||
tui_erase_source_content (second_win, EMPTY_SOURCE_PROMPT);
|
tui_erase_source_content (second_win);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,7 @@ tui_update_source_window_as_is (struct tui_source_window_base *win_info,
|
|||||||
|
|
||||||
if (ret == TUI_FAILURE)
|
if (ret == TUI_FAILURE)
|
||||||
{
|
{
|
||||||
tui_clear_source_content (win_info, EMPTY_SOURCE_PROMPT);
|
tui_clear_source_content (win_info);
|
||||||
tui_clear_exec_info_content (win_info);
|
tui_clear_exec_info_content (win_info);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -162,7 +162,7 @@ tui_update_source_windows_with_addr (struct gdbarch *gdbarch, CORE_ADDR addr)
|
|||||||
{
|
{
|
||||||
for (struct tui_source_window_base *win_info : tui_source_windows ())
|
for (struct tui_source_window_base *win_info : tui_source_windows ())
|
||||||
{
|
{
|
||||||
tui_clear_source_content (win_info, EMPTY_SOURCE_PROMPT);
|
tui_clear_source_content (win_info);
|
||||||
tui_clear_exec_info_content (win_info);
|
tui_clear_exec_info_content (win_info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -205,15 +205,14 @@ tui_update_source_windows_with_line (struct symtab *s, int line)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
tui_clear_source_content (struct tui_source_window_base *win_info,
|
tui_clear_source_content (struct tui_source_window_base *win_info)
|
||||||
int display_prompt)
|
|
||||||
{
|
{
|
||||||
if (win_info != NULL)
|
if (win_info != NULL)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
win_info->content_in_use = false;
|
win_info->content_in_use = false;
|
||||||
tui_erase_source_content (win_info, display_prompt);
|
tui_erase_source_content (win_info);
|
||||||
for (i = 0; i < win_info->content.size (); i++)
|
for (i = 0; i < win_info->content.size (); i++)
|
||||||
{
|
{
|
||||||
struct tui_source_element *element = &win_info->content[i];
|
struct tui_source_element *element = &win_info->content[i];
|
||||||
@ -226,8 +225,7 @@ tui_clear_source_content (struct tui_source_window_base *win_info,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
tui_erase_source_content (struct tui_source_window_base *win_info,
|
tui_erase_source_content (struct tui_source_window_base *win_info)
|
||||||
int display_prompt)
|
|
||||||
{
|
{
|
||||||
int x_pos;
|
int x_pos;
|
||||||
int half_width = (win_info->width - 2) / 2;
|
int half_width = (win_info->width - 2) / 2;
|
||||||
@ -236,30 +234,29 @@ tui_erase_source_content (struct tui_source_window_base *win_info,
|
|||||||
{
|
{
|
||||||
werase (win_info->handle);
|
werase (win_info->handle);
|
||||||
tui_check_and_display_highlight_if_needed (win_info);
|
tui_check_and_display_highlight_if_needed (win_info);
|
||||||
if (display_prompt == EMPTY_SOURCE_PROMPT)
|
|
||||||
{
|
|
||||||
const char *no_src_str;
|
|
||||||
|
|
||||||
if (win_info->type == SRC_WIN)
|
const char *no_src_str;
|
||||||
no_src_str = NO_SRC_STRING;
|
|
||||||
else
|
|
||||||
no_src_str = NO_DISASSEM_STRING;
|
|
||||||
if (strlen (no_src_str) >= half_width)
|
|
||||||
x_pos = 1;
|
|
||||||
else
|
|
||||||
x_pos = half_width - strlen (no_src_str);
|
|
||||||
mvwaddstr (win_info->handle,
|
|
||||||
(win_info->height / 2),
|
|
||||||
x_pos,
|
|
||||||
(char *) no_src_str);
|
|
||||||
|
|
||||||
/* elz: Added this function call to set the real contents of
|
if (win_info->type == SRC_WIN)
|
||||||
the window to what is on the screen, so that later calls
|
no_src_str = NO_SRC_STRING;
|
||||||
to refresh, do display the correct stuff, and not the old
|
else
|
||||||
image. */
|
no_src_str = NO_DISASSEM_STRING;
|
||||||
|
if (strlen (no_src_str) >= half_width)
|
||||||
|
x_pos = 1;
|
||||||
|
else
|
||||||
|
x_pos = half_width - strlen (no_src_str);
|
||||||
|
mvwaddstr (win_info->handle,
|
||||||
|
(win_info->height / 2),
|
||||||
|
x_pos,
|
||||||
|
(char *) no_src_str);
|
||||||
|
|
||||||
|
/* elz: Added this function call to set the real contents of
|
||||||
|
the window to what is on the screen, so that later calls
|
||||||
|
to refresh, do display the correct stuff, and not the old
|
||||||
|
image. */
|
||||||
|
|
||||||
|
tui_set_source_content_nil (win_info, no_src_str);
|
||||||
|
|
||||||
tui_set_source_content_nil (win_info, no_src_str);
|
|
||||||
}
|
|
||||||
win_info->refresh_window ();
|
win_info->refresh_window ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -302,7 +299,7 @@ tui_show_source_content (struct tui_source_window_base *win_info)
|
|||||||
tui_show_source_line (win_info, lineno);
|
tui_show_source_line (win_info, lineno);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
tui_erase_source_content (win_info, TRUE);
|
tui_erase_source_content (win_info);
|
||||||
|
|
||||||
tui_check_and_display_highlight_if_needed (win_info);
|
tui_check_and_display_highlight_if_needed (win_info);
|
||||||
win_info->refresh_window ();
|
win_info->refresh_window ();
|
||||||
|
@ -57,8 +57,8 @@ extern void tui_update_source_window_as_is (struct tui_source_window_base *,
|
|||||||
extern void tui_update_source_windows_with_addr (struct gdbarch *, CORE_ADDR);
|
extern void tui_update_source_windows_with_addr (struct gdbarch *, CORE_ADDR);
|
||||||
extern void tui_update_source_windows_with_line (struct symtab *,
|
extern void tui_update_source_windows_with_line (struct symtab *,
|
||||||
int);
|
int);
|
||||||
extern void tui_clear_source_content (struct tui_source_window_base *, int);
|
extern void tui_clear_source_content (struct tui_source_window_base *);
|
||||||
extern void tui_erase_source_content (struct tui_source_window_base *, int);
|
extern void tui_erase_source_content (struct tui_source_window_base *);
|
||||||
extern void tui_show_source_content (struct tui_source_window_base *);
|
extern void tui_show_source_content (struct tui_source_window_base *);
|
||||||
extern void tui_set_exec_info_content (struct tui_source_window_base *);
|
extern void tui_set_exec_info_content (struct tui_source_window_base *);
|
||||||
extern void tui_show_exec_info_content (struct tui_source_window_base *);
|
extern void tui_show_exec_info_content (struct tui_source_window_base *);
|
||||||
|
Reference in New Issue
Block a user