From 2dbc041e4e9e7325de2794d11e9ef5a8c4f6b02d Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 2 Dec 2019 17:17:45 -0700 Subject: [PATCH] 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-04 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 --- gdb/ChangeLog | 8 ++++++++ gdb/cp-valprint.c | 12 ++++++------ gdb/go-valprint.c | 7 ++++--- gdb/p-valprint.c | 6 +++--- gdb/valprint.c | 6 +++--- 5 files changed, 24 insertions(+), 15 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 89b68b3a9b3..a8bafa3199c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2019-12-04 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-04 Andrew Burgess Chris January diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c index e445d42d3fa..0ec84f6799e 100644 --- a/gdb/cp-valprint.c +++ b/gdb/cp-valprint.c @@ -638,9 +638,9 @@ cp_print_static_field (struct type *type, { if (value_address (val) == first_dont_print[i]) { - fputs_filtered ("", - stream); + fputs_styled (_(""), + metadata_style.style (), stream); return; } } @@ -670,9 +670,9 @@ cp_print_static_field (struct type *type, { 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 eda40f8ed8b..64761b98221 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 @@ print_go_string (struct type *type, 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 e1e1a00cae1..198d6b6c3e4 100644 --- a/gdb/p-valprint.c +++ b/gdb/p-valprint.c @@ -865,9 +865,9 @@ pascal_object_print_static_field (struct value *val, { 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 ced0dbcd0a6..1e3071b4322 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c @@ -2897,9 +2897,9 @@ val_print_string (struct type *elttype, const char *encoding, { 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); -- 2.30.2