From patchwork Tue Jan 7 11:52:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 37235 Received: (qmail 22469 invoked by alias); 7 Jan 2020 11:52:30 -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 22408 invoked by uid 89); 7 Jan 2020 11:52:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.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_PASS autolearn=ham version=3.3.1 spammy=maint X-HELO: mail-wm1-f65.google.com Received: from mail-wm1-f65.google.com (HELO mail-wm1-f65.google.com) (209.85.128.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 07 Jan 2020 11:52:28 +0000 Received: by mail-wm1-f65.google.com with SMTP id d73so18627417wmd.1 for ; Tue, 07 Jan 2020 03:52:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=sjeUX8EppqvSDosAzz5IwIS8njB09bJTptJy+Rgh4jA=; b=Lb01IJqTlzCpxPTwmApDi6uCB97Ay4ExVKQd96dpHKDRzh/FcUZNVctyfKVA7cjZ3w +I1IAt2ZDmA0LYX4XK5pzEjJHLamvMoOkXIFIj1eROogKYRWuX5rWdZPaWwNC/jtkYq5 g5KzQaitvhvJU7n6Ow06dlXJZj2DD7lNb+DhkGOjfkl+DalyCz3fas+9zW1XJnvRLEbe BJST0/SD7k6iuONL7Gak+aVfIroyH8XdhxdoQ1X+iDYdC3b6otbbuOnFQDKYqXTUefVh 4syANumDzslZWO7hyEydtz8QTtsjEX+Q6xQ23QYiFI9Mn7vL+1+hitfbMRLJhGXinM2D j6RA== Return-Path: Received: from localhost (host86-186-80-236.range86-186.btcentralplus.com. [86.186.80.236]) by smtp.gmail.com with ESMTPSA id g199sm27319327wmg.12.2020.01.07.03.52.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Jan 2020 03:52:25 -0800 (PST) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Tom Tromey , Hannes Domani , Andrew Burgess Subject: [PATCH 2/6] gdb/testsuite/tui: Split enter_tui into two procs Date: Tue, 7 Jan 2020 11:52:15 +0000 Message-Id: In-Reply-To: References: In-Reply-To: References: <874kxrc3ha.fsf@tromey.com> X-IsSubscribed: yes Split Term::enter_tui into two procedures, a core which does the setup, but doesn't actually enable tui mode, and the old enter_tui that calls the new core, and then enables tui mode. This is going to be useful in a later commit. gdb/testsuite/ChangeLog: * lib/tuiterm.exp (Term::prepare_for_tui): New proc. (Term::enter_tui): Use Term::prepare_for_tui. Change-Id: I501dfb2ddaa4a4e7246a5ad319ab428e4f42b3af --- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/lib/tuiterm.exp | 16 +++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/lib/tuiterm.exp b/gdb/testsuite/lib/tuiterm.exp index 36e034a3639..9ac599b6f2d 100644 --- a/gdb/testsuite/lib/tuiterm.exp +++ b/gdb/testsuite/lib/tuiterm.exp @@ -462,15 +462,25 @@ namespace eval Term { } } - # Start the TUI. Returns 1 on success, 0 if TUI tests should be - # skipped. - proc enter_tui {} { + # Setup ready for starting the tui, but don't actually start it. + # Returns 1 on success, 0 if TUI tests should be skipped. + proc prepare_for_tui {} { if {[skip_tui_tests]} { return 0 } gdb_test_no_output "set tui border-kind ascii" gdb_test_no_output "maint set tui-resize-message on" + return 1 + } + + # Start the TUI. Returns 1 on success, 0 if TUI tests should be + # skipped. + proc enter_tui {} { + if {![prepare_for_tui]} { + return 0 + } + command "tui enable" return 1 }