This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 3/9] directly recurse using c_type_print


This is a minor fix to change the C type printer to directly recurse
rather than doing so via the generic type_print function.  This allows
us to pass the flags through more easily.

Built and regtested on x86-64 F16.

	* c-typeprint.c (cp_type_print_method_args): Add flags
	argument.  Call c_print_type, not type_print.
	(c_type_print_base): Call c_print_type, not type_print.
	Update.
---
 gdb/c-typeprint.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c
index 36b5421..a1e1882 100644
--- a/gdb/c-typeprint.c
+++ b/gdb/c-typeprint.c
@@ -170,7 +170,8 @@ cp_type_print_derivation_info (struct ui_file *stream,
 static void
 cp_type_print_method_args (struct type *mtype, const char *prefix,
 			   const char *varstring, int staticp,
-			   struct ui_file *stream)
+			   struct ui_file *stream,
+			   const struct type_print_options *flags)
 {
   struct field *args = TYPE_FIELDS (mtype);
   int nargs = TYPE_NFIELDS (mtype);
@@ -189,7 +190,7 @@ cp_type_print_method_args (struct type *mtype, const char *prefix,
     {
       while (i < nargs)
 	{
-	  type_print (args[i++].type, "", stream, 0);
+	  c_print_type (args[i++].type, "", stream, 0, 0, flags);
 
 	  if (i == nargs && varargs)
 	    fprintf_filtered (stream, ", ...");
@@ -1064,8 +1065,8 @@ c_type_print_base (struct type *type, struct ui_file *stream,
 			   && !is_full_physname_constructor  /* " " */
 			   && !is_type_conversion_operator (type, i, j))
 		    {
-		      type_print (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)),
-				  "", stream, -1);
+		      c_print_type (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)),
+				    "", stream, -1, 0, flags);
 		      fputs_filtered (" ", stream);
 		    }
 		  if (TYPE_FN_FIELD_STUB (f, j))
@@ -1099,7 +1100,7 @@ c_type_print_base (struct type *type, struct ui_file *stream,
 						     "",
 						     method_name,
 						     staticp,
-						     stream);
+						     stream, flags);
 			}
 		      else
 			fprintf_filtered (stream,
-- 
1.7.7.6


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]