From patchwork Fri Aug 16 16:15:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 34144 Received: (qmail 74159 invoked by alias); 16 Aug 2019 16:15:37 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 73988 invoked by uid 89); 16 Aug 2019 16:15:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:2910, 77, 8 X-HELO: gateway32.websitewelcome.com Received: from gateway32.websitewelcome.com (HELO gateway32.websitewelcome.com) (192.185.145.119) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Aug 2019 16:15:25 +0000 Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway32.websitewelcome.com (Postfix) with ESMTP id 88D52103A07 for ; Fri, 16 Aug 2019 11:15:16 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id yesmh8Y5FdnCeyesmhYWu8; Fri, 16 Aug 2019 11:15:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=p3A/OoeZGIy0HYQp56r2zxdpE4J01A2m7M7209UCcb8=; b=iWuIOKTefsz+AsknuVYGZutqR+ szIUZkmhM1ZlNwqnb8flwnFm/a4btm28RDXaoJtZ+68XsOZQLEx/wHlinbd6Dhigh7QOsow5vyJz8 Pb2dVWONZkTQQPl2zxI01/hl4; Received: from 97-122-178-82.hlrn.qwest.net ([97.122.178.82]:40466 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1hyesm-002SJK-Al; Fri, 16 Aug 2019 11:15:16 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 8/9] Change tui_show_symtab_source to be a method Date: Fri, 16 Aug 2019 10:15:10 -0600 Message-Id: <20190816161511.16162-9-tom@tromey.com> In-Reply-To: <20190816161511.16162-1-tom@tromey.com> References: <20190816161511.16162-1-tom@tromey.com> 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. --- gdb/ChangeLog | 10 ++++++++++ gdb/tui/tui-source.c | 10 +++++----- gdb/tui/tui-source.h | 7 +++---- gdb/tui/tui-winsource.c | 4 ++-- 4 files changed, 20 insertions(+), 11 deletions(-) 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);