summaryrefslogtreecommitdiff
path: root/gdb/tui/tui-winsource.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-07-06 15:57:53 -0600
committerTom Tromey <tom@tromey.com>2019-08-15 12:29:28 -0600
commite25d200487dba7dfdf92f638e4ef2aefd7bd7481 (patch)
treedbf59cf936e9e73a5de26143726cd61a403a1852 /gdb/tui/tui-winsource.h
parent002f15c27779e154856fdf281360385f4d3be671 (diff)
downloadbinutils-gdb-e25d200487dba7dfdf92f638e4ef2aefd7bd7481.tar.gz
Turn tui_erase_source_content into a method
This changes tui_erase_source_content into a method on tui_source_window_base. The bulk of the work is moved into a helper method, so that the callers can each pass the string appropriate to the particular window class. gdb/ChangeLog 2019-08-15 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (struct tui_source_window_base) <do_erase_source_content>: New method. <erase_source_content>: New method. (tui_erase_source_content): Don't declare. * tui/tui-winsource.c (tui_clear_source_content): Update. (tui_source_window_base::do_erase_source_content): Rename from tui_erase_source_content. (tui_source_window_base::show_source_content): Update. * tui/tui-win.c (tui_resize_all, tui_adjust_win_heights): Update. * tui/tui-source.h (struct tui_source_window) <erase_source_content>: New method. * tui/tui-disasm.h (struct tui_disasm_window) <erase_source_content>: New method.
Diffstat (limited to 'gdb/tui/tui-winsource.h')
-rw-r--r--gdb/tui/tui-winsource.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/gdb/tui/tui-winsource.h b/gdb/tui/tui-winsource.h
index bff2560aaf3..0443c4a3c4d 100644
--- a/gdb/tui/tui-winsource.h
+++ b/gdb/tui/tui-winsource.h
@@ -100,6 +100,9 @@ protected:
void do_scroll_horizontal (int num_to_scroll) override;
void do_make_visible_with_new_height () override;
+ /* Erase the content and display STRING. */
+ void do_erase_source_content (const char *string);
+
public:
void clear_detail ();
@@ -133,6 +136,9 @@ public:
virtual void maybe_update (struct frame_info *fi, symtab_and_line sal,
int line_no, CORE_ADDR addr) = 0;
+ /* Erase the source content. */
+ virtual void erase_source_content () = 0;
+
/* Does the locator belong to this window? */
bool m_has_locator = false;
/* Execution information window. */
@@ -182,7 +188,6 @@ 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 *);
-extern void tui_erase_source_content (struct tui_source_window_base *);
/* Constant definitions. */
#define SCROLL_THRESHOLD 2 /* Threshold for lazy scroll. */