From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27623 invoked by alias); 28 Nov 2018 00:14:46 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 27474 invoked by uid 89); 28 Nov 2018 00:14:45 -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,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=bold, Style, m*, interactive X-HELO: gateway31.websitewelcome.com Received: from gateway31.websitewelcome.com (HELO gateway31.websitewelcome.com) (192.185.144.29) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 28 Nov 2018 00:14:41 +0000 Received: from cm17.websitewelcome.com (cm17.websitewelcome.com [100.42.49.20]) by gateway31.websitewelcome.com (Postfix) with ESMTP id 8BCCCE4EA for ; Tue, 27 Nov 2018 18:14:40 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id RnV2gAfwuPvAdRnV2gqWFZ; Tue, 27 Nov 2018 18:14:40 -0600 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=4amUOpCZWUQ4xgfRTxpVFgQpoYDK/t1uZ/1QJ0zX2Y8=; b=S/bcyMH0tMBUYBgnthN6yRQ7D5 m7OW+9//QyoL+Uui66mw3QqrpypCG3otJIx2EwW+lA2IUH3dOgTE6H9REuA0URtJfS5yqf982LC59 pMbXUy7TSTTLJQvPxZCjx0FK5; Received: from 97-122-190-66.hlrn.qwest.net ([97.122.190.66]:33804 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1gRnV2-004MMp-BJ; Tue, 27 Nov 2018 18:14:40 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 10/16] Style the gdb welcome message Date: Wed, 28 Nov 2018 00:14:00 -0000 Message-Id: <20181128001435.12703-11-tom@tromey.com> In-Reply-To: <20181128001435.12703-1-tom@tromey.com> References: <20181128001435.12703-1-tom@tromey.com> X-SW-Source: 2018-11/txt/msg00493.txt.bz2 This changes gdb to style the welcome message that is shown by default. The styling is only done interactively. gdb/ChangeLog 2018-11-27 Tom Tromey * top.c (print_gdb_version): Style gdb version number. gdb/testsuite/ChangeLog 2018-11-27 Tom Tromey * gdb.base/style.exp: Add test for version number styling. --- gdb/ChangeLog | 4 ++++ gdb/testsuite/ChangeLog | 4 ++++ gdb/testsuite/gdb.base/style.exp | 6 ++++++ gdb/top.c | 9 ++++++++- 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.base/style.exp b/gdb/testsuite/gdb.base/style.exp index 8b82ae99fa..a5bdc2795f 100644 --- a/gdb/testsuite/gdb.base/style.exp +++ b/gdb/testsuite/gdb.base/style.exp @@ -44,4 +44,10 @@ save_vars { env(TERM) } { gdb_test "break main" "file $base_file_expr.*" gdb_test "print &main" " = .* <$main_expr>" + + gdb_exit + gdb_spawn + + gdb_test "" "\033\\\[35;1mGNU gdb.*\033\\\[m.*" \ + "version is styled" } diff --git a/gdb/top.c b/gdb/top.c index 4a0fedb6a8..50c6cff3d9 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -1281,7 +1281,14 @@ print_gdb_version (struct ui_file *stream, bool interactive) program to parse, and is just canonical program name and version number, which starts after last space. */ - fprintf_filtered (stream, "GNU gdb %s%s\n", PKGVERSION, version); + ui_file_style style; + if (interactive) + { + ui_file_style nstyle = { ui_file_style::MAGENTA, ui_file_style::NONE, + ui_file_style::BOLD }; + style = nstyle; + } + fprintf_styled (stream, style, "GNU gdb %s%s\n", PKGVERSION, version); /* Second line is a copyright notice. */ -- 2.17.2