From patchwork Tue Dec 3 00:20:17 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: 36450 Received: (qmail 90147 invoked by alias); 3 Dec 2019 00:20:25 -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 90135 invoked by uid 89); 3 Dec 2019 00:20:25 -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; Tue, 03 Dec 2019 00:20:23 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id 27AA52039A; Mon, 2 Dec 2019 19:20:22 -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 06EC020334 for ; Mon, 2 Dec 2019 19:20:17 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id D95DE2816F for ; Mon, 2 Dec 2019 19:20:17 -0500 (EST) X-Gerrit-PatchSet: 1 Date: Mon, 2 Dec 2019 19:20:17 -0500 From: "Tom Tromey (Code Review)" To: gdb-patches@sourceware.org Message-ID: Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange Subject: [review] Use metadata style in a few more places X-Gerrit-Change-Id: Id82ca2aa306c6694b111d5c92dfa6f0cce919ebf X-Gerrit-Change-Number: 739 X-Gerrit-ChangeURL: X-Gerrit-Commit: 4e9e6b9a06c1b11503e362afb84677d3c520a972 References: Reply-To: tromey@sourceware.org, gdb-patches@sourceware.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3-79-g83ff7f88f1 Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/739 ...................................................................... Use metadata style in a few more places I happened to find a few more spots that should use metadata style, but do not. I missed these in my earlier search somehow. This patch also adds gettext markup in a couple of spots where it was missing. gdb/ChangeLog 2019-12-02 Tom Tromey * valprint.c (val_print_string): Use metadata_style. * go-valprint.c (print_go_string): Use metadata style. * p-valprint.c (pascal_object_print_static_field): Use metadata style. * cp-valprint.c (cp_print_static_field): Use metadata style. Change-Id: Id82ca2aa306c6694b111d5c92dfa6f0cce919ebf --- M gdb/ChangeLog M gdb/cp-valprint.c M gdb/go-valprint.c M gdb/p-valprint.c M gdb/valprint.c 5 files changed, 24 insertions(+), 15 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 59825d3..73c3c83 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,13 @@ 2019-12-02 Tom Tromey + * valprint.c (val_print_string): Use metadata_style. + * go-valprint.c (print_go_string): Use metadata style. + * p-valprint.c (pascal_object_print_static_field): Use metadata + style. + * cp-valprint.c (cp_print_static_field): Use metadata style. + +2019-12-02 Tom Tromey + * unittests/tui-selftests.c (run_tests): Make conditional. (_initialize_tui_selftest): Make conditional. diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c index e445d42..0ec84f6 100644 --- a/gdb/cp-valprint.c +++ b/gdb/cp-valprint.c @@ -638,9 +638,9 @@ { if (value_address (val) == first_dont_print[i]) { - fputs_filtered ("", - stream); + fputs_styled (_(""), + metadata_style.style (), stream); return; } } @@ -670,9 +670,9 @@ { if (target_type == first_dont_print[i]) { - fputs_filtered ("", - stream); + fputs_styled (_(""), + metadata_style.style (), stream); return; } } diff --git a/gdb/go-valprint.c b/gdb/go-valprint.c index eda40f8..64761b9 100644 --- a/gdb/go-valprint.c +++ b/gdb/go-valprint.c @@ -29,6 +29,7 @@ #include "go-lang.h" #include "c-lang.h" #include "valprint.h" +#include "cli/cli-style.h" /* Print a Go string. @@ -71,9 +72,9 @@ if (length < 0) { - fputs_filtered (_("", stream); + printf_filtered (_(""), + styled_string (metadata_style.style (), + plongest (addr))); return; } diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c index e1e1a00..198d6b6 100644 --- a/gdb/p-valprint.c +++ b/gdb/p-valprint.c @@ -865,9 +865,9 @@ { if (value_address (val) == first_dont_print[i]) { - fputs_filtered ("\ -", - stream); + fputs_styled (_("\ +"), + metadata_style.style (), stream); return; } } diff --git a/gdb/valprint.c b/gdb/valprint.c index ced0dbc..1e3071b 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c @@ -2897,9 +2897,9 @@ { std::string str = memory_error_message (TARGET_XFER_E_IO, gdbarch, addr); - fprintf_filtered (stream, ""); + fprintf_filtered (stream, _(""), + styled_string (metadata_style.style (), + str.c_str ())); } return (bytes_read / width);