From 2ad52f6fb3daecd928605384fcaa45ad43178b4e Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 23 Jul 2019 17:16:56 -0600 Subject: Simplify tui_source_window_base::show_source_content tui_source_window_base::show_source_content is not used outside the class any more, so this makes it private. Examining the callers shows that it can't be called without source contents, so it can be simplified as well. gdb/ChangeLog 2019-09-20 Tom Tromey * tui/tui-winsource.h (struct tui_source_window_base) : Now private. * tui/tui-winsource.c (tui_source_window_base::show_source_content): Don't handle empty content case. --- gdb/tui/tui-winsource.c | 11 +++-------- gdb/tui/tui-winsource.h | 5 +++-- 2 files changed, 6 insertions(+), 10 deletions(-) (limited to 'gdb/tui') diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c index 8b507ed..683856d 100644 --- a/gdb/tui/tui-winsource.c +++ b/gdb/tui/tui-winsource.c @@ -238,15 +238,10 @@ tui_show_source_line (struct tui_source_window_base *win_info, int lineno) void tui_source_window_base::show_source_content () { - if (!content.empty ()) - { - int lineno; + gdb_assert (!content.empty ()); - for (lineno = 1; lineno <= content.size (); lineno++) - tui_show_source_line (this, lineno); - } - else - erase_source_content (); + for (int lineno = 1; lineno <= content.size (); lineno++) + tui_show_source_line (this, lineno); check_and_display_highlight_if_needed (); refresh_window (); diff --git a/gdb/tui/tui-winsource.h b/gdb/tui/tui-winsource.h index eca0bde..a66c635 100644 --- a/gdb/tui/tui-winsource.h +++ b/gdb/tui/tui-winsource.h @@ -76,6 +76,9 @@ struct tui_source_element struct tui_source_window_base : public tui_win_info { +private: + void show_source_content (); + protected: explicit tui_source_window_base (enum tui_win_type type); @@ -106,8 +109,6 @@ public: virtual bool location_matches_p (struct bp_location *loc, int line_no) = 0; - void show_source_content (); - void update_exec_info (); /* Update the window to display the given location. Does nothing if -- cgit v1.1