[binutils-gdb] Remove LA_PRINT_TYPE

Tom Tromey tromey@sourceware.org
Mon Feb 14 13:31:45 GMT 2022


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=13eb081a83b6f9b07cf4447e52e1d0503bf90211

commit 13eb081a83b6f9b07cf4447e52e1d0503bf90211
Author: Tom Tromey <tom@tromey.com>
Date:   Sat Jan 22 16:31:06 2022 -0700

    Remove LA_PRINT_TYPE
    
    This removes the LA_PRINT_TYPE macro, in favor of using ordinary
    method calls.

Diff:
---
 gdb/guile/scm-type.c |  3 ++-
 gdb/language.h       |  3 ---
 gdb/python/py-type.c |  5 +++--
 gdb/symmisc.c        | 18 +++++++++---------
 gdb/typeprint.c      |  5 +++--
 5 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/gdb/guile/scm-type.c b/gdb/guile/scm-type.c
index 987660ceaf9..27d00f12a95 100644
--- a/gdb/guile/scm-type.c
+++ b/gdb/guile/scm-type.c
@@ -108,7 +108,8 @@ tyscm_type_name (struct type *type)
     {
       string_file stb;
 
-      LA_PRINT_TYPE (type, "", &stb, -1, 0, &type_print_raw_options);
+      current_language->print_type (type, "", &stb, -1, 0,
+				    &type_print_raw_options);
       return stb.release ();
     }
   catch (const gdb_exception &except)
diff --git a/gdb/language.h b/gdb/language.h
index bfdade398e4..3930f5bd223 100644
--- a/gdb/language.h
+++ b/gdb/language.h
@@ -755,9 +755,6 @@ extern enum language set_language (enum language);
    the current setting of working_lang, which the user sets
    with the "set language" command.  */
 
-#define LA_PRINT_TYPE(type,varstring,stream,show,level,flags)		\
-  (current_language->print_type(type,varstring,stream,show,level,flags))
-
 #define LA_PRINT_CHAR(ch, type, stream) \
   (current_language->printchar (ch, type, stream))
 #define LA_PRINT_STRING(stream, elttype, string, length, encoding, force_ellipses, options) \
diff --git a/gdb/python/py-type.c b/gdb/python/py-type.c
index 9df667d2811..8613534d060 100644
--- a/gdb/python/py-type.c
+++ b/gdb/python/py-type.c
@@ -1025,8 +1025,9 @@ typy_str (PyObject *self)
 
   try
     {
-      LA_PRINT_TYPE (type_object_to_type (self), "", &thetype, -1, 0,
-		     &type_print_raw_options);
+      current_language->print_type (type_object_to_type (self), "",
+				    &thetype, -1, 0,
+				    &type_print_raw_options);
     }
   catch (const gdb_exception &except)
     {
diff --git a/gdb/symmisc.c b/gdb/symmisc.c
index 160278b50a9..114d6bc5e53 100644
--- a/gdb/symmisc.c
+++ b/gdb/symmisc.c
@@ -525,8 +525,8 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
     {
       if (symbol->type ()->name ())
 	{
-	  LA_PRINT_TYPE (symbol->type (), "", outfile, 1, depth,
-			 &type_print_raw_options);
+	  current_language->print_type (symbol->type (), "", outfile, 1, depth,
+					&type_print_raw_options);
 	}
       else
 	{
@@ -536,8 +536,8 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
 		     : (symbol->type ()->code () == TYPE_CODE_STRUCT
 			? "struct" : "union")),
 			    symbol->linkage_name ());
-	  LA_PRINT_TYPE (symbol->type (), "", outfile, 1, depth,
-			 &type_print_raw_options);
+	  current_language->print_type (symbol->type (), "", outfile, 1, depth,
+					&type_print_raw_options);
 	}
       fprintf_filtered (outfile, ";\n");
     }
@@ -548,11 +548,11 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
       if (symbol->type ())
 	{
 	  /* Print details of types, except for enums where it's clutter.  */
-	  LA_PRINT_TYPE (symbol->type (), symbol->print_name (),
-			 outfile,
-			 symbol->type ()->code () != TYPE_CODE_ENUM,
-			 depth,
-			 &type_print_raw_options);
+	  current_language->print_type (symbol->type (), symbol->print_name (),
+					outfile,
+					symbol->type ()->code () != TYPE_CODE_ENUM,
+					depth,
+					&type_print_raw_options);
 	  fprintf_filtered (outfile, "; ");
 	}
       else
diff --git a/gdb/typeprint.c b/gdb/typeprint.c
index f7a2ebac398..c15a9c6b59f 100644
--- a/gdb/typeprint.c
+++ b/gdb/typeprint.c
@@ -392,7 +392,8 @@ void
 type_print (struct type *type, const char *varstring, struct ui_file *stream,
 	    int show)
 {
-  LA_PRINT_TYPE (type, varstring, stream, show, 0, &default_ptype_flags);
+  current_language->print_type (type, varstring, stream, show, 0,
+				&default_ptype_flags);
 }
 
 /* Print TYPE to a string, returning it.  The caller is responsible for
@@ -578,7 +579,7 @@ whatis_exp (const char *exp, int show)
       printf_filtered (" */\n");    
     }
 
-  LA_PRINT_TYPE (type, "", gdb_stdout, show, 0, &flags);
+  current_language->print_type (type, "", gdb_stdout, show, 0, &flags);
   printf_filtered ("\n");
 }


More information about the Gdb-cvs mailing list