From: Tom Tromey Date: Fri, 12 Jul 2019 02:00:07 +0000 (-0600) Subject: Change tui_show_symtab_source to be a method X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bb01dbfc041dccab2f2a2818068158f61b4c0fe2;p=binutils-gdb.git Change tui_show_symtab_source to be a method This changes tui_show_symtab_source to be a method on tui_source_window. gdb/ChangeLog 2019-08-16 Tom Tromey * tui/tui-winsource.c (tui_update_source_windows_with_addr) (tui_update_source_windows_with_line): Update. * tui/tui-source.h (struct tui_source_window) : Declare. (tui_show_symtab_source): Don't declare. * tui/tui-source.c (tui_show_symtab_source): Rename from tui_show_symtab_source. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a83668bfa00..1dfe43d1ada 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,13 @@ +2019-08-16 Tom Tromey + + * tui/tui-winsource.c (tui_update_source_windows_with_addr) + (tui_update_source_windows_with_line): Update. + * tui/tui-source.h (struct tui_source_window) + : Declare. + (tui_show_symtab_source): Don't declare. + * tui/tui-source.c (tui_show_symtab_source): Rename from + tui_show_symtab_source. + 2019-08-16 Tom Tromey * tui/tui-winsource.h (struct tui_source_window_base) diff --git a/gdb/tui/tui-source.c b/gdb/tui/tui-source.c index 9eb7c48472e..57d27aee4af 100644 --- a/gdb/tui/tui-source.c +++ b/gdb/tui/tui-source.c @@ -202,12 +202,12 @@ tui_source_window::set_contents (struct gdbarch *arch, /* Function to display source in the source window. This function initializes the horizontal scroll to 0. */ void -tui_show_symtab_source (tui_source_window_base *win_info, - struct gdbarch *gdbarch, struct symtab *s, - struct tui_line_or_address line) +tui_source_window::show_symtab_source (struct gdbarch *gdbarch, + struct symtab *s, + struct tui_line_or_address line) { - win_info->horizontal_offset = 0; - win_info->update_source_window_as_is (gdbarch, s, line); + horizontal_offset = 0; + update_source_window_as_is (gdbarch, s, line); } diff --git a/gdb/tui/tui-source.h b/gdb/tui/tui-source.h index c623f5e2941..9c3013637b7 100644 --- a/gdb/tui/tui-source.h +++ b/gdb/tui/tui-source.h @@ -56,6 +56,9 @@ struct tui_source_window : public tui_source_window_base do_erase_source_content (NO_SRC_STRING); } + void show_symtab_source (struct gdbarch *, struct symtab *, + struct tui_line_or_address); + protected: void do_scroll_vertical (int num_to_scroll) override; @@ -77,8 +80,4 @@ private: gdb::observers::token m_observable; }; -extern void tui_show_symtab_source (tui_source_window_base *, - struct gdbarch *, struct symtab *, - struct tui_line_or_address); - #endif /* TUI_TUI_SOURCE_H */ diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c index 3a678f2b531..43e8a28df5a 100644 --- a/gdb/tui/tui-winsource.c +++ b/gdb/tui/tui-winsource.c @@ -139,7 +139,7 @@ tui_update_source_windows_with_addr (struct gdbarch *gdbarch, CORE_ADDR addr) sal = find_pc_line (addr, 0); l.loa = LOA_LINE; l.u.line_no = sal.line; - tui_show_symtab_source (TUI_SRC_WIN, gdbarch, sal.symtab, l); + TUI_SRC_WIN->show_symtab_source (gdbarch, sal.symtab, l); break; } } @@ -174,7 +174,7 @@ tui_update_source_windows_with_line (struct symtab *s, int line) default: l.loa = LOA_LINE; l.u.line_no = line; - tui_show_symtab_source (TUI_SRC_WIN, gdbarch, s, l); + TUI_SRC_WIN->show_symtab_source (gdbarch, s, l); if (tui_current_layout () == SRC_DISASSEM_COMMAND) { find_line_pc (s, line, &pc);