public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [review] Use metadata style in a few more places
@ 2019-12-03  0:20 Tom Tromey (Code Review)
  2019-12-04 10:50 ` Andrew Burgess (Code Review)
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Tom Tromey (Code Review) @ 2019-12-03  0:20 UTC (permalink / raw)
  To: gdb-patches

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  <tom@tromey.com>

	* 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  <tom@tromey.com>
 
+	* 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  <tom@tromey.com>
+
 	* 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 ("<same as static member of an already"
-			      " seen type>",
-			      stream);
+	      fputs_styled (_("<same as static member of an already"
+			      " seen type>"),
+			    metadata_style.style (), stream);
 	      return;
 	    }
 	}
@@ -670,9 +670,9 @@
 	{
 	  if (target_type == first_dont_print[i])
 	    {
-	      fputs_filtered ("<same as static member of an already"
-			      " seen type>",
-			      stream);
+	      fputs_styled (_("<same as static member of an already"
+			      " seen type>"),
+			    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 (_("<invalid length: "), stream);
-      fputs_filtered (plongest (addr), stream);
-      fputs_filtered (">", stream);
+      printf_filtered (_("<invalid length: %ps>"),
+		       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 ("\
-<same as static member of an already seen type>",
-			      stream);
+	      fputs_styled (_("\
+<same as static member of an already seen type>"),
+			    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, "<error: ");
-      fputs_filtered (str.c_str (), stream);
-      fprintf_filtered (stream, ">");
+      fprintf_filtered (stream, _("<error: %ps>"),
+			styled_string (metadata_style.style (),
+				       str.c_str ()));
     }
 
   return (bytes_read / width);

-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: Id82ca2aa306c6694b111d5c92dfa6f0cce919ebf
Gerrit-Change-Number: 739
Gerrit-PatchSet: 1
Gerrit-Owner: Tom Tromey <tromey@sourceware.org>
Gerrit-MessageType: newchange

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [review] Use metadata style in a few more places
  2019-12-03  0:20 [review] Use metadata style in a few more places Tom Tromey (Code Review)
@ 2019-12-04 10:50 ` Andrew Burgess (Code Review)
  2019-12-04 21:35 ` [pushed] " Sourceware to Gerrit sync (Code Review)
  2019-12-04 21:35 ` Sourceware to Gerrit sync (Code Review)
  2 siblings, 0 replies; 4+ messages in thread
From: Andrew Burgess (Code Review) @ 2019-12-04 10:50 UTC (permalink / raw)
  To: Tom Tromey, gdb-patches

Andrew Burgess has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/739
......................................................................


Patch Set 1: Code-Review+2

LGTM.


-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: Id82ca2aa306c6694b111d5c92dfa6f0cce919ebf
Gerrit-Change-Number: 739
Gerrit-PatchSet: 1
Gerrit-Owner: Tom Tromey <tromey@sourceware.org>
Gerrit-Reviewer: Andrew Burgess <andrew.burgess@embecosm.com>
Gerrit-Comment-Date: Wed, 04 Dec 2019 10:50:46 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [pushed] Use metadata style in a few more places
  2019-12-03  0:20 [review] Use metadata style in a few more places Tom Tromey (Code Review)
  2019-12-04 10:50 ` Andrew Burgess (Code Review)
@ 2019-12-04 21:35 ` Sourceware to Gerrit sync (Code Review)
  2019-12-04 21:35 ` Sourceware to Gerrit sync (Code Review)
  2 siblings, 0 replies; 4+ messages in thread
From: Sourceware to Gerrit sync (Code Review) @ 2019-12-04 21:35 UTC (permalink / raw)
  To: Tom Tromey, gdb-patches; +Cc: Andrew Burgess

Sourceware to Gerrit sync has submitted this change.

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-04  Tom Tromey  <tom@tromey.com>

	* 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 89b68b3..a8bafa3 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,11 @@
+2019-12-04  Tom Tromey  <tom@tromey.com>
+
+	* 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  <andrew.burgess@embecosm.com>
 	    Chris January  <chris.january@arm.com>
 
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 ("<same as static member of an already"
-			      " seen type>",
-			      stream);
+	      fputs_styled (_("<same as static member of an already"
+			      " seen type>"),
+			    metadata_style.style (), stream);
 	      return;
 	    }
 	}
@@ -670,9 +670,9 @@
 	{
 	  if (target_type == first_dont_print[i])
 	    {
-	      fputs_filtered ("<same as static member of an already"
-			      " seen type>",
-			      stream);
+	      fputs_styled (_("<same as static member of an already"
+			      " seen type>"),
+			    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 (_("<invalid length: "), stream);
-      fputs_filtered (plongest (addr), stream);
-      fputs_filtered (">", stream);
+      printf_filtered (_("<invalid length: %ps>"),
+		       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 ("\
-<same as static member of an already seen type>",
-			      stream);
+	      fputs_styled (_("\
+<same as static member of an already seen type>"),
+			    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, "<error: ");
-      fputs_filtered (str.c_str (), stream);
-      fprintf_filtered (stream, ">");
+      fprintf_filtered (stream, _("<error: %ps>"),
+			styled_string (metadata_style.style (),
+				       str.c_str ()));
     }
 
   return (bytes_read / width);

-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: Id82ca2aa306c6694b111d5c92dfa6f0cce919ebf
Gerrit-Change-Number: 739
Gerrit-PatchSet: 2
Gerrit-Owner: Tom Tromey <tromey@sourceware.org>
Gerrit-Reviewer: Andrew Burgess <andrew.burgess@embecosm.com>
Gerrit-MessageType: merged

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [pushed] Use metadata style in a few more places
  2019-12-03  0:20 [review] Use metadata style in a few more places Tom Tromey (Code Review)
  2019-12-04 10:50 ` Andrew Burgess (Code Review)
  2019-12-04 21:35 ` [pushed] " Sourceware to Gerrit sync (Code Review)
@ 2019-12-04 21:35 ` Sourceware to Gerrit sync (Code Review)
  2 siblings, 0 replies; 4+ messages in thread
From: Sourceware to Gerrit sync (Code Review) @ 2019-12-04 21:35 UTC (permalink / raw)
  To: Tom Tromey, Andrew Burgess, gdb-patches

The original change was created by Tom Tromey.

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-04  Tom Tromey  <tom@tromey.com>

	* 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 89b68b3..a8bafa3 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,11 @@
+2019-12-04  Tom Tromey  <tom@tromey.com>
+
+	* 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  <andrew.burgess@embecosm.com>
 	    Chris January  <chris.january@arm.com>
 
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 ("<same as static member of an already"
-			      " seen type>",
-			      stream);
+	      fputs_styled (_("<same as static member of an already"
+			      " seen type>"),
+			    metadata_style.style (), stream);
 	      return;
 	    }
 	}
@@ -670,9 +670,9 @@
 	{
 	  if (target_type == first_dont_print[i])
 	    {
-	      fputs_filtered ("<same as static member of an already"
-			      " seen type>",
-			      stream);
+	      fputs_styled (_("<same as static member of an already"
+			      " seen type>"),
+			    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 (_("<invalid length: "), stream);
-      fputs_filtered (plongest (addr), stream);
-      fputs_filtered (">", stream);
+      printf_filtered (_("<invalid length: %ps>"),
+		       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 ("\
-<same as static member of an already seen type>",
-			      stream);
+	      fputs_styled (_("\
+<same as static member of an already seen type>"),
+			    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, "<error: ");
-      fputs_filtered (str.c_str (), stream);
-      fprintf_filtered (stream, ">");
+      fprintf_filtered (stream, _("<error: %ps>"),
+			styled_string (metadata_style.style (),
+				       str.c_str ()));
     }
 
   return (bytes_read / width);

-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: Id82ca2aa306c6694b111d5c92dfa6f0cce919ebf
Gerrit-Change-Number: 739
Gerrit-PatchSet: 2
Gerrit-Owner: Tom Tromey <tromey@sourceware.org>
Gerrit-Reviewer: Andrew Burgess <andrew.burgess@embecosm.com>
Gerrit-MessageType: newpatchset

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-12-04 21:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-03  0:20 [review] Use metadata style in a few more places Tom Tromey (Code Review)
2019-12-04 10:50 ` Andrew Burgess (Code Review)
2019-12-04 21:35 ` [pushed] " Sourceware to Gerrit sync (Code Review)
2019-12-04 21:35 ` Sourceware to Gerrit sync (Code Review)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).