From: Tom Tromey Date: Sat, 6 Jul 2019 22:17:46 +0000 (-0600) Subject: Remove tui_clear_source_content X-Git-Tag: binutils-2_33~210 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c398c3d0b56823bb12718ae46a8c273b866ca246;p=external%2Fbinutils.git Remove tui_clear_source_content tui_clear_source_content is not needed. Instead, the callers can call erase_source_content, which is also changed to clear the content vector. gdb/ChangeLog 2019-08-15 Tom Tromey * tui/tui-winsource.h (tui_clear_source_content): Don't declare. * tui/tui-winsource.c (tui_update_source_window_as_is): Don't call tui_clear_source_content. (tui_clear_source_content): Remove. (tui_source_window_base::do_erase_source_content): Hoist call to content.clear(). * tui/tui-stack.c (tui_show_frame_info): Don't call tui_clear_source_content. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f109f9a..b3d3028 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,16 @@ 2019-08-15 Tom Tromey + * tui/tui-winsource.h (tui_clear_source_content): Don't declare. + * tui/tui-winsource.c (tui_update_source_window_as_is): Don't call + tui_clear_source_content. + (tui_clear_source_content): Remove. + (tui_source_window_base::do_erase_source_content): Hoist call to + content.clear(). + * tui/tui-stack.c (tui_show_frame_info): Don't call + tui_clear_source_content. + +2019-08-15 Tom Tromey + * tui/tui-winsource.h (struct tui_source_window_base) : New method. : New method. diff --git a/gdb/tui/tui-stack.c b/gdb/tui/tui-stack.c index 09ee87f..f61aa52 100644 --- a/gdb/tui/tui-stack.c +++ b/gdb/tui/tui-stack.c @@ -411,7 +411,7 @@ tui_show_frame_info (struct frame_info *fi) tui_show_locator_content (); for (struct tui_source_window_base *win_info : tui_source_windows ()) { - tui_clear_source_content (win_info); + win_info->erase_source_content (); win_info->update_exec_info (); } diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c index d955efc..95a2ac2 100644 --- a/gdb/tui/tui-winsource.c +++ b/gdb/tui/tui-winsource.c @@ -98,7 +98,7 @@ tui_update_source_window_as_is (struct tui_source_window_base *win_info, ret = tui_set_disassem_content (win_info, gdbarch, line_or_addr.u.addr); if (ret == TUI_FAILURE) - tui_clear_source_content (win_info); + win_info->erase_source_content (); else { tui_update_breakpoint_info (win_info, nullptr, false); @@ -153,7 +153,7 @@ tui_update_source_windows_with_addr (struct gdbarch *gdbarch, CORE_ADDR addr) else { for (struct tui_source_window_base *win_info : tui_source_windows ()) - tui_clear_source_content (win_info); + win_info->erase_source_content (); } } @@ -192,30 +192,12 @@ tui_update_source_windows_with_line (struct symtab *s, int line) } void -tui_clear_source_content (struct tui_source_window_base *win_info) -{ - if (win_info != NULL) - { - int i; - - win_info->erase_source_content (); - for (i = 0; i < win_info->content.size (); i++) - { - struct tui_source_element *element = &win_info->content[i]; - - element->break_mode = 0; - element->is_exec_point = false; - } - } -} - - -void tui_source_window_base::do_erase_source_content (const char *str) { int x_pos; int half_width = (width - 2) / 2; + content.clear (); if (handle != NULL) { werase (handle); @@ -230,7 +212,6 @@ tui_source_window_base::do_erase_source_content (const char *str) x_pos, (char *) str); - content.clear (); refresh_window (); werase (execution_info->handle); diff --git a/gdb/tui/tui-winsource.h b/gdb/tui/tui-winsource.h index 0443c4a..e7ae5b0 100644 --- a/gdb/tui/tui-winsource.h +++ b/gdb/tui/tui-winsource.h @@ -187,7 +187,6 @@ 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_line (struct symtab *, int); -extern void tui_clear_source_content (struct tui_source_window_base *); /* Constant definitions. */ #define SCROLL_THRESHOLD 2 /* Threshold for lazy scroll. */