From patchwork Fri Dec 20 16:20:12 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: 36997 Received: (qmail 64730 invoked by alias); 20 Dec 2019 16:20:49 -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 62870 invoked by uid 89); 20 Dec 2019 16:20:35 -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:33 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id B15C320373; Fri, 20 Dec 2019 11:20:30 -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 C1C4420373; Fri, 20 Dec 2019 11:20:12 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id A9003281DB; Fri, 20 Dec 2019 11:20:12 -0500 (EST) X-Gerrit-PatchSet: 3 Date: Fri, 20 Dec 2019 11:20:12 -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] Display "main" on initial TUI startup X-Gerrit-Change-Id: Ic7bfc930e1179f5b61111e30a2dae46a98b00064 X-Gerrit-Change-Number: 644 X-Gerrit-ChangeURL: X-Gerrit-Commit: 77b97e006217ed089b588e6799a59334bd216c43 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: <20191220162012.A9003281DB@gnutoolchain-gerrit.osci.io> Sourceware to Gerrit sync has submitted this change. Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/644 ...................................................................... Display "main" on initial TUI startup I noticed that even when there's a symbol file, "tui enable" won't show "main" by default. I think it should, and this patch fixes this. gdb/ChangeLog 2019-12-20 Tom Tromey * tui/tui.c (tui_enable): Call tui_display_main. gdb/testsuite/ChangeLog 2019-12-20 Tom Tromey * gdb.tui/list.exp: Check for source on initial listing. Change-Id: Ic7bfc930e1179f5b61111e30a2dae46a98b00064 --- M gdb/ChangeLog M gdb/testsuite/ChangeLog M gdb/testsuite/gdb.tui/list.exp M gdb/tui/tui.c 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e471536..1034aa8 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,9 @@ 2019-12-20 Tom Tromey + * tui/tui.c (tui_enable): Call tui_display_main. + +2019-12-20 Tom Tromey + * tui/tui-disasm.c (tui_get_begin_asm_address): Use get_current_source_symtab_and_line, and main_name. diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 4f8d851..f25787c 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2019-12-20 Tom Tromey + + * gdb.tui/list.exp: Check for source on initial listing. + 2019-12-11 Tom Tromey * gdb.xml/tdesc-arch.exp (set_arch): Add "trans_mode" parameter. diff --git a/gdb/testsuite/gdb.tui/list.exp b/gdb/testsuite/gdb.tui/list.exp index 6efe193..08153c6 100644 --- a/gdb/testsuite/gdb.tui/list.exp +++ b/gdb/testsuite/gdb.tui/list.exp @@ -28,7 +28,7 @@ unsupported "TUI not supported" } -Term::check_contents "initial source listing" "No Source Available" +Term::check_contents "initial source listing" "21 *return 0" Term::command "layout asm" Term::check_contents "asm window shows main" "$hex
" diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c index a0d2e4c..dbc890a 100644 --- a/gdb/tui/tui.c +++ b/gdb/tui/tui.c @@ -513,6 +513,8 @@ if (deprecated_safe_get_selected_frame ()) tui_show_frame_info (deprecated_safe_get_selected_frame ()); + else + tui_display_main (); /* Restore TUI keymap. */ tui_set_key_mode (tui_current_key_mode);