From patchwork Sat Aug 3 13:29:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 33943 Received: (qmail 96149 invoked by alias); 3 Aug 2019 13:29:40 -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 95630 invoked by uid 89); 3 Aug 2019 13:29:37 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.3 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= X-HELO: gateway24.websitewelcome.com Received: from gateway24.websitewelcome.com (HELO gateway24.websitewelcome.com) (192.185.50.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 03 Aug 2019 13:29:35 +0000 Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway24.websitewelcome.com (Postfix) with ESMTP id F2F00C729 for ; Sat, 3 Aug 2019 08:29:33 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id tu6HhOiA12qH7tu6HhQBkw; Sat, 03 Aug 2019 08:29:33 -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=NA2SzYjP7vnBpOfsOC1WC5vdDFgOt529bzC3JKWbqfk=; b=tpnbtWa/gAA78Tyw/5I77fqL4x ywMIHl8EqcSUh73PsAfhj/6cGVFmM5oJQHoy8x1t1AQvcg5wn/q1GQVNwL3VZvDePr8o5OTYgstW/ g8eTTRlKrn+qbuGn4mS1zudfW; Received: from 97-122-178-82.hlrn.qwest.net ([97.122.178.82]:36980 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1htu6H-003nqS-Oi; Sat, 03 Aug 2019 08:29:33 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 15/19] Turn tui_show_exec_info_content into a method Date: Sat, 3 Aug 2019 07:29:21 -0600 Message-Id: <20190803132925.25074-16-tom@tromey.com> In-Reply-To: <20190803132925.25074-1-tom@tromey.com> References: <20190803132925.25074-1-tom@tromey.com> This changes tui_show_exec_info_content to be a method on tui_source_window_base. As it is only called by other methods on this class, it can be private. gdb/ChangeLog 2019-08-03 Tom Tromey * tui/tui-winsource.h (struct tui_source_window_base) : Declare. (tui_show_exec_info_content): Don't declare. * tui/tui-winsource.c (tui_source_window_base::show_exec_info_content): Rename from tui_show_exec_info_content. (tui_source_window_base::update_exec_info): Update. --- gdb/ChangeLog | 10 ++++++++++ gdb/tui/tui-winsource.c | 12 ++++++------ gdb/tui/tui-winsource.h | 4 +++- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c index 53113bd785c..c99e207b011 100644 --- a/gdb/tui/tui-winsource.c +++ b/gdb/tui/tui-winsource.c @@ -641,17 +641,17 @@ tui_source_window_base::set_exec_info_content () void -tui_show_exec_info_content (struct tui_source_window_base *win_info) +tui_source_window_base::show_exec_info_content () { - struct tui_exec_info_window *exec_info = win_info->execution_info; - const tui_exec_info_content *content = exec_info->get_content (); + struct tui_exec_info_window *exec_info = execution_info; + const tui_exec_info_content *exec_content = exec_info->get_content (); werase (exec_info->handle); - for (int cur_line = 1; cur_line <= win_info->content.size (); cur_line++) + for (int cur_line = 1; cur_line <= content.size (); cur_line++) mvwaddstr (exec_info->handle, cur_line, 0, - content[cur_line - 1]); + exec_content[cur_line - 1]); exec_info->refresh_window (); } @@ -676,7 +676,7 @@ void tui_source_window_base::update_exec_info () { set_exec_info_content (); - tui_show_exec_info_content (this); + show_exec_info_content (); } void diff --git a/gdb/tui/tui-winsource.h b/gdb/tui/tui-winsource.h index 71201e51d89..c902ee0f17e 100644 --- a/gdb/tui/tui-winsource.h +++ b/gdb/tui/tui-winsource.h @@ -150,6 +150,9 @@ public: struct gdbarch *gdbarch = nullptr; std::vector content; + +private: + void show_exec_info_content (); }; /* Update the execution windows to show the active breakpoints. This @@ -185,7 +188,6 @@ 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 *); -extern void tui_show_exec_info_content (struct tui_source_window_base *); extern void tui_erase_exec_info_content (struct tui_source_window_base *); extern void tui_clear_exec_info_content (struct tui_source_window_base *);