public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH 15/19] Rename fprintf_symbol_filtered
Date: Fri, 21 Jan 2022 18:37:57 -0700	[thread overview]
Message-ID: <20220122013801.666659-16-tom@tromey.com> (raw)
In-Reply-To: <20220122013801.666659-1-tom@tromey.com>

fprintf_symbol_filtered is misnamed, because whether filtering happens
is now up to the stream.  This renames it to fprintf_symbol, which
isn't a great name (the first "f" doesn't mean much and the second one
is truly meaningless here), but "print_symbol" was already taken.
---
 gdb/c-typeprint.c | 8 ++++----
 gdb/cp-valprint.c | 8 ++++----
 gdb/p-valprint.c  | 8 ++++----
 gdb/printcmd.c    | 8 ++++----
 gdb/utils.c       | 6 +++---
 gdb/utils.h       | 4 ++--
 6 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c
index 6d369886e37..357f61d6c3e 100644
--- a/gdb/c-typeprint.c
+++ b/gdb/c-typeprint.c
@@ -283,10 +283,10 @@ cp_type_print_method_args (struct type *mtype, const char *prefix,
   int varargs = mtype->has_varargs ();
   int i;
 
-  fprintf_symbol_filtered (stream, prefix,
-			   language_cplus, DMGL_ANSI);
-  fprintf_symbol_filtered (stream, varstring,
-			   language_cplus, DMGL_ANSI);
+  fprintf_symbol (stream, prefix,
+		  language_cplus, DMGL_ANSI);
+  fprintf_symbol (stream, varstring,
+		  language_cplus, DMGL_ANSI);
   gdb_puts ("(", stream);
 
   /* Skip the class variable.  We keep this here to accommodate older
diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c
index fc5600c100c..43a52698b71 100644
--- a/gdb/cp-valprint.c
+++ b/gdb/cp-valprint.c
@@ -230,10 +230,10 @@ cp_print_value_fields (struct value *val, struct ui_file *stream,
 	  if (field_is_static (&type->field (i)))
 	    {
 	      gdb_puts ("static ", stream);
-	      fprintf_symbol_filtered (stream,
-				       type->field (i).name (),
-				       current_language->la_language,
-				       DMGL_PARAMS | DMGL_ANSI);
+	      fprintf_symbol (stream,
+			      type->field (i).name (),
+			      current_language->la_language,
+			      DMGL_PARAMS | DMGL_ANSI);
 	    }
 	  else
 	    fputs_styled (type->field (i).name (),
diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c
index eeb24454bd7..950aa61d5db 100644
--- a/gdb/p-valprint.c
+++ b/gdb/p-valprint.c
@@ -582,10 +582,10 @@ pascal_object_print_value_fields (struct value *val, struct ui_file *stream,
 	  if (field_is_static (&type->field (i)))
 	    {
 	      gdb_puts ("static ", stream);
-	      fprintf_symbol_filtered (stream,
-				       type->field (i).name (),
-				       current_language->la_language,
-				       DMGL_PARAMS | DMGL_ANSI);
+	      fprintf_symbol (stream,
+			      type->field (i).name (),
+			      current_language->la_language,
+			      DMGL_PARAMS | DMGL_ANSI);
 	    }
 	  else
 	    fputs_styled (type->field (i).name (),
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index f51a99fa9fc..2263a4c90ea 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -1638,8 +1638,8 @@ info_address_command (const char *exp, int from_tty)
       if (is_a_field_of_this.type != NULL)
 	{
 	  gdb_printf ("Symbol \"");
-	  fprintf_symbol_filtered (gdb_stdout, exp,
-				   current_language->la_language, DMGL_ANSI);
+	  fprintf_symbol (gdb_stdout, exp,
+			  current_language->la_language, DMGL_ANSI);
 	  gdb_printf ("\" is a field of the local class variable ");
 	  if (current_language->la_language == language_objc)
 	    gdb_printf ("`self'\n");	/* ObjC equivalent of "this" */
@@ -1658,8 +1658,8 @@ info_address_command (const char *exp, int from_tty)
 	  load_addr = BMSYMBOL_VALUE_ADDRESS (msymbol);
 
 	  gdb_printf ("Symbol \"");
-	  fprintf_symbol_filtered (gdb_stdout, exp,
-				   current_language->la_language, DMGL_ANSI);
+	  fprintf_symbol (gdb_stdout, exp,
+			  current_language->la_language, DMGL_ANSI);
 	  gdb_printf ("\" is at ");
 	  fputs_styled (paddress (gdbarch, load_addr), address_style.style (),
 			gdb_stdout);
diff --git a/gdb/utils.c b/gdb/utils.c
index d00f72ba0a5..4ecf2bbda50 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -1927,14 +1927,14 @@ print_spaces (int n, struct ui_file *stream)
 \f
 /* C++/ObjC demangler stuff.  */
 
-/* fprintf_symbol_filtered attempts to demangle NAME, a symbol in language
+/* fprintf_symbol attempts to demangle NAME, a symbol in language
    LANG, using demangling args ARG_MODE, and print it filtered to STREAM.
    If the name is not mangled, or the language for the name is unknown, or
    demangling is off, the name is printed in its "raw" form.  */
 
 void
-fprintf_symbol_filtered (struct ui_file *stream, const char *name,
-			 enum language lang, int arg_mode)
+fprintf_symbol (struct ui_file *stream, const char *name,
+		enum language lang, int arg_mode)
 {
   if (name != NULL)
     {
diff --git a/gdb/utils.h b/gdb/utils.h
index e899e899238..b7f39929846 100644
--- a/gdb/utils.h
+++ b/gdb/utils.h
@@ -302,8 +302,8 @@ extern const char *print_core_address (struct gdbarch *gdbarch,
 
 extern CORE_ADDR string_to_core_addr (const char *my_string);
 
-extern void fprintf_symbol_filtered (struct ui_file *, const char *,
-				     enum language, int);
+extern void fprintf_symbol (struct ui_file *, const char *,
+			    enum language, int);
 
 extern void throw_perror_with_name (enum errors errcode, const char *string)
   ATTRIBUTE_NORETURN;
-- 
2.31.1


  parent reply	other threads:[~2022-01-22  1:38 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-22  1:37 [PATCH 00/19] Simplify GDB output functions Tom Tromey
2022-01-22  1:37 ` [PATCH 01/19] Use unfiltered output in annotate.c Tom Tromey
2022-01-22  1:37 ` [PATCH 02/19] Remove some uses of printf_unfiltered Tom Tromey
2022-01-22  1:37 ` [PATCH 03/19] Only have one API for unfiltered output Tom Tromey
2022-01-22  1:37 ` [PATCH 04/19] Add puts_unfiltered method to ui_file Tom Tromey
2022-01-22  1:37 ` [PATCH 05/19] Add style-escape methods " Tom Tromey
2022-01-22  1:37 ` [PATCH 06/19] Remove vfprintf_styled_no_gdbfmt Tom Tromey
2022-01-22  1:37 ` [PATCH 07/19] Change the pager to a ui_file Tom Tromey
2022-01-22  1:37 ` [PATCH 08/19] Remove fputs_styled_unfiltered Tom Tromey
2022-01-22  1:37 ` [PATCH 09/19] Unify vprintf functions Tom Tromey
2022-01-22  1:37 ` [PATCH 10/19] Unify gdb puts functions Tom Tromey
2022-01-22  1:37 ` [PATCH 11/19] Unify gdb putc functions Tom Tromey
2022-01-22  1:37 ` [PATCH 13/19] Rename print_spaces_filtered Tom Tromey
2022-01-22  1:37 ` [PATCH 14/19] Rename puts_filtered_tabular Tom Tromey
2022-01-22  1:37 ` Tom Tromey [this message]
2022-01-22  1:37 ` [PATCH 16/19] Remove ui_out_flag::unfiltered_output Tom Tromey
2022-01-22  1:37 ` [PATCH 17/19] Remove vfprintf_styled Tom Tromey
2022-01-22  1:38 ` [PATCH 18/19] Minor comment updates in utils.h Tom Tromey
2022-03-24 18:05   ` Pedro Alves
2022-03-28 20:29     ` Tom Tromey
2022-01-22  1:38 ` [PATCH 19/19] Remove unnecessary calls to wrap_here and gdb_flush Tom Tromey
2022-01-22 17:40 ` [PATCH 00/19] Simplify GDB output functions John Baldwin
2022-03-24 16:25 ` Tom Tromey
2022-03-24 18:08 ` Pedro Alves
2022-03-29 19:38   ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220122013801.666659-16-tom@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).