From patchwork Sat Dec 21 15:33:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Terekhov, Mikhail via Gdb-patches" X-Patchwork-Id: 37065 Received: (qmail 58584 invoked by alias); 21 Dec 2019 15:34:06 -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 58573 invoked by uid 89); 21 Dec 2019 15:34:05 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.1 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=1618, HContent-Transfer-Encoding:8bit X-HELO: sonic301-21.consmr.mail.ir2.yahoo.com Received: from sonic301-21.consmr.mail.ir2.yahoo.com (HELO sonic301-21.consmr.mail.ir2.yahoo.com) (77.238.176.98) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 21 Dec 2019 15:34:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s2048; t=1576942442; bh=/pPP6qb2RZOlDcpvJdmOecXR1LZZTwnPFLv7UhpTc0Q=; h=From:To:Subject:Date:References:From:Subject; b=Uy/5poKeL2rHoS17/aHlq8C1wtaaUaL/1+Qjv8pghf3Cvvkm7DokWl31TKAxlhZ9y7Ou5tdBqGS1/ybqqVBSA7Wrq52urQHtYwvV9yaWtoigYjpCe0KaUpWFNvInKVixZPtloZ3F1M4oHWxOt61oD3ioQZX4SFcAULRvIrmI81VHSabRcJrFOumxSc0wpRx+VmyNQbrX/SB1W8ORn5bd+QogXJmaN5BiPg3PrXaa+9UM4ogNwnowTLj2aTb+6Kq+h25H91QvNEZMsoZZ9PxpUdZ//5PKhATkcmNtzYNyWh5gqJE4WspKMZBMJkx3oTwj4JwdL1ndRnB9ryS6Qn+rCA== Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.ir2.yahoo.com with HTTP; Sat, 21 Dec 2019 15:34:02 +0000 Received: by smtp425.mail.ir2.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID a7d5c3ce358ba3b89925607548da72ef; Sat, 21 Dec 2019 15:33:57 +0000 (UTC) X-Patchwork-Original-From: "Hannes Domani via gdb-patches" From: "Terekhov, Mikhail via Gdb-patches" Reply-To: Hannes Domani To: gdb-patches@sourceware.org Subject: [RFC][PATCH] Call tui_before_prompt in do_scroll_vertical Date: Sat, 21 Dec 2019 16:33:25 +0100 Message-Id: <20191221153325.6961-1-ssbssa@yahoo.de> MIME-Version: 1.0 References: <20191221153325.6961-1-ssbssa.ref@yahoo.de> Content-Length: 1763 X-IsSubscribed: yes Without this call scrolling in the src window does not work at all. First I tried it with tui_update_source_windows_with_line, but this didn't reset from_source_symtab (which was set deep in print_source_lines), which resulted in some weird behavior when switching from "layout split" to "layout asm" after scrolling down in the src window (the asm window was then overwritten by the src window). gdb/ChangeLog: 2019-12-21 Hannes Domani * tui/tui-hooks.c (tui_before_prompt): Remove static. * tui/tui-source.c (tui_before_prompt): Add prototype. (tui_source_window::do_scroll_vertical): Add tui_before_prompt call. --- gdb/tui/tui-hooks.c | 2 +- gdb/tui/tui-source.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gdb/tui/tui-hooks.c b/gdb/tui/tui-hooks.c index 8576bb8fcc..8b9e70316f 100644 --- a/gdb/tui/tui-hooks.c +++ b/gdb/tui/tui-hooks.c @@ -179,7 +179,7 @@ tui_inferior_exit (struct inferior *inf) /* Observer for the before_prompt notification. */ -static void +void tui_before_prompt (const char *current_gdb_prompt) { tui_refresh_frame_and_register_information (); diff --git a/gdb/tui/tui-source.c b/gdb/tui/tui-source.c index 0728263b8c..dfe5721edf 100644 --- a/gdb/tui/tui-source.c +++ b/gdb/tui/tui-source.c @@ -39,6 +39,9 @@ #include "tui/tui-source.h" #include "gdb_curses.h" +void +tui_before_prompt (const char *current_gdb_prompt); + /* Function to display source in the source window. */ bool tui_source_window::set_contents (struct gdbarch *arch, @@ -158,6 +161,8 @@ tui_source_window::do_scroll_vertical (int num_to_scroll) l.u.line_no = 1; print_source_lines (s, l.u.line_no, l.u.line_no + 1, 0); + + tui_before_prompt (""); } }