From patchwork Fri Sep 27 21:25:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 34702 Received: (qmail 106917 invoked by alias); 27 Sep 2019 21:25:36 -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 106569 invoked by uid 89); 27 Sep 2019 21:25:33 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.9 required=5.0 tests=AWL, 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.1 spammy=308 X-HELO: gateway32.websitewelcome.com Received: from gateway32.websitewelcome.com (HELO gateway32.websitewelcome.com) (192.185.145.123) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 27 Sep 2019 21:25:27 +0000 Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway32.websitewelcome.com (Postfix) with ESMTP id 367E69DA4B for ; Fri, 27 Sep 2019 16:25:26 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id DxjyiRTekOdBHDxjyiweRG; Fri, 27 Sep 2019 16:25:26 -0500 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=udvxidZTbCkk38T/m1yTyLWAXKiI4VJnxg/4ojd5LGM=; b=JNtOGd9ufcG0GfQP/xGwzudYz9 LbNGit0QZTPxUD0Iw/BkSa6C9T2x57QYeAj9t5MmmFh6eAwHb6DSP9kRtWk7nGSaz5jkLj0XusgyT s2FBWLrlKUTPNug+3D8PDKfkx; Received: from 71-218-73-27.hlrn.qwest.net ([71.218.73.27]:34758 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1iDxjx-002PvY-Us; Fri, 27 Sep 2019 16:25:26 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 8/8] Use styled_string for "show logging filename" Date: Fri, 27 Sep 2019 15:25:20 -0600 Message-Id: <20190927212520.20073-9-tom@tromey.com> In-Reply-To: <20190927212520.20073-1-tom@tromey.com> References: <20190927212520.20073-1-tom@tromey.com> This changes "show logging filename" to style its output. gdb/ChangeLog 2019-09-27 Tom Tromey * cli/cli-logging.c (show_logging_filename): Use styled_string. gdb/testsuite/ChangeLog 2019-09-27 Tom Tromey * gdb.base/style.exp: Test "show logging filename". --- gdb/ChangeLog | 4 ++++ gdb/cli/cli-logging.c | 5 +++-- gdb/testsuite/ChangeLog | 4 ++++ gdb/testsuite/gdb.base/style.exp | 3 +++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/gdb/cli/cli-logging.c b/gdb/cli/cli-logging.c index 22b540b4812..e20ebd5dc82 100644 --- a/gdb/cli/cli-logging.c +++ b/gdb/cli/cli-logging.c @@ -21,6 +21,7 @@ #include "gdbcmd.h" #include "ui-out.h" #include "interps.h" +#include "cli/cli-style.h" static char *saved_filename; @@ -29,8 +30,8 @@ static void show_logging_filename (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) { - fprintf_filtered (file, _("The current logfile is \"%s\".\n"), - value); + fprintf_filtered (file, _("The current logfile is \"%ps\".\n"), + styled_string (file_name_style.style (), value)); } static bool logging_overwrite; diff --git a/gdb/testsuite/gdb.base/style.exp b/gdb/testsuite/gdb.base/style.exp index 0f812f7f1bc..72b5f4efb21 100644 --- a/gdb/testsuite/gdb.base/style.exp +++ b/gdb/testsuite/gdb.base/style.exp @@ -137,4 +137,7 @@ save_vars { env(TERM) } { gdb_test_no_output "set print repeat 3" gdb_test "print {0,0,0,0,0,0,0,0}" \ " = \\{0 [style {} metadata]\\}" + + gdb_test "show logging file" \ + "The current logfile is \"[style .*? file]\"\\..*" }