From patchwork Fri Dec 20 16:20:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Simon Marchi (Code Review)" X-Patchwork-Id: 36981 Received: (qmail 60285 invoked by alias); 20 Dec 2019 16:20:18 -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 60194 invoked by uid 89); 20 Dec 2019 16:20:17 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy= X-HELO: mx1.osci.io Received: from polly.osci.io (HELO mx1.osci.io) (8.43.85.229) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 20 Dec 2019 16:20:15 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id 0C51020C05; Fri, 20 Dec 2019 11:20:12 -0500 (EST) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [IPv6:2620:52:3:1:5054:ff:fe06:16ca]) by mx1.osci.io (Postfix) with ESMTP id 943D220208; Fri, 20 Dec 2019 11:20:08 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id 7040C281DA; Fri, 20 Dec 2019 11:20:08 -0500 (EST) X-Gerrit-PatchSet: 3 Date: Fri, 20 Dec 2019 11:20:08 -0500 From: "Sourceware to Gerrit sync (Code Review)" To: Tom Tromey , gdb-patches@sourceware.org Auto-Submitted: auto-generated X-Gerrit-MessageType: merged Subject: [pushed] Change tui_update_locator_fullname to take a symtab X-Gerrit-Change-Id: Ic61749517b44ac68561d829ff81f16976b830dec X-Gerrit-Change-Number: 630 X-Gerrit-ChangeURL: X-Gerrit-Commit: c1b167d76ec06c02f1aaa176c3dcfb1b4d8cee0c In-Reply-To: References: Reply-To: noreply@gnutoolchain-gerrit.osci.io, tromey@sourceware.org, gdb-patches@sourceware.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3-79-g83ff7f88f1 Message-Id: <20191220162008.7040C281DA@gnutoolchain-gerrit.osci.io> Sourceware to Gerrit sync has submitted this change. Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/630 ...................................................................... Change tui_update_locator_fullname to take a symtab This changes tui_update_locator_fullname to take a symtab. This somewhat consolidates the "??" handling. gdb/ChangeLog 2019-12-20 Tom Tromey * tui/tui.c (tui_show_source): Update. * tui/tui-winsource.c (tui_display_main): Update. * tui/tui-stack.h (tui_update_locator_fullname): Change parameter to symtab. * tui/tui-stack.c (tui_update_locator_fullname): Change parameter to symtab. * tui/tui-disasm.c (tui_show_disassem_and_update_source): Update. Change-Id: Ic61749517b44ac68561d829ff81f16976b830dec --- M gdb/ChangeLog M gdb/tui/tui-disasm.c M gdb/tui/tui-stack.c M gdb/tui/tui-stack.h M gdb/tui/tui-winsource.c M gdb/tui/tui.c 6 files changed, 21 insertions(+), 13 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1b838b9..5a79f6a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,15 @@ 2019-12-20 Tom Tromey + * tui/tui.c (tui_show_source): Update. + * tui/tui-winsource.c (tui_display_main): Update. + * tui/tui-stack.h (tui_update_locator_fullname): Change parameter + to symtab. + * tui/tui-stack.c (tui_update_locator_fullname): Change parameter + to symtab. + * tui/tui-disasm.c (tui_show_disassem_and_update_source): Update. + +2019-12-20 Tom Tromey + PR tui/23619: * tui/tui-io.c (tui_rl_saved_prompt): Remove. (tui_redisplay_readline): Use rl_display_prompt. diff --git a/gdb/tui/tui-disasm.c b/gdb/tui/tui-disasm.c index 9819cb9..18e281e 100644 --- a/gdb/tui/tui-disasm.c +++ b/gdb/tui/tui-disasm.c @@ -297,12 +297,8 @@ val.u.line_no = sal.line; TUI_SRC_WIN->update_source_window (gdbarch, sal.symtab, val); if (sal.symtab) - { - set_current_source_symtab_and_line (sal); - tui_update_locator_fullname (symtab_to_fullname (sal.symtab)); - } - else - tui_update_locator_fullname ("?"); + set_current_source_symtab_and_line (sal); + tui_update_locator_fullname (sal.symtab); } } diff --git a/gdb/tui/tui-stack.c b/gdb/tui/tui-stack.c index 078f819..7803b95 100644 --- a/gdb/tui/tui-stack.c +++ b/gdb/tui/tui-stack.c @@ -288,10 +288,15 @@ /* Update only the full_name portion of the locator. */ void -tui_update_locator_fullname (const char *fullname) +tui_update_locator_fullname (struct symtab *symtab) { struct tui_locator_window *locator = tui_locator_win_info_ptr (); + const char *fullname; + if (symtab != nullptr) + fullname = symtab_to_fullname (symtab); + else + fullname = "??"; locator->set_locator_fullname (fullname); } diff --git a/gdb/tui/tui-stack.h b/gdb/tui/tui-stack.h index 27af5d2..97e6956 100644 --- a/gdb/tui/tui-stack.h +++ b/gdb/tui/tui-stack.h @@ -77,7 +77,7 @@ std::string make_status_line () const; }; -extern void tui_update_locator_fullname (const char *); +extern void tui_update_locator_fullname (struct symtab *symtab); extern void tui_show_locator_content (void); extern int tui_show_frame_info (struct frame_info *); diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c index 6653709..938a0af 100644 --- a/gdb/tui/tui-winsource.c +++ b/gdb/tui/tui-winsource.c @@ -57,10 +57,7 @@ tui_update_source_windows_with_addr (gdbarch, addr); s = find_pc_line_symtab (addr); - if (s != NULL) - tui_update_locator_fullname (symtab_to_fullname (s)); - else - tui_update_locator_fullname ("??"); + tui_update_locator_fullname (s); } } } diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c index dc0d22f..8bffb30 100644 --- a/gdb/tui/tui.c +++ b/gdb/tui/tui.c @@ -635,7 +635,7 @@ tui_add_win_to_layout (SRC_WIN); tui_update_source_windows_with_line (cursal.symtab, line); - tui_update_locator_fullname (fullname); + tui_update_locator_fullname (cursal.symtab); } void