Fix dumping of function arguments.
authorDoug Evans <xdje42@gmail.com>
Mon, 24 Nov 2014 04:30:34 +0000 (20:30 -0800)
committerDoug Evans <xdje42@gmail.com>
Mon, 24 Nov 2014 04:31:18 +0000 (20:31 -0800)
gdb/ChangeLog:

* gdbtypes.c (print_args): Renamed from print_arg_types.  Print arg
number and name if present.  All callers updated.
(dump_fn_fieldlists): Fix indentation of args.

gdb/ChangeLog
gdb/gdbtypes.c

index 07dacc0a3b5ca35c6d3f209a149e2601ea36cb73..a5881bfbfc07f47ad40ef7c0d94b70e53ba5a086 100644 (file)
@@ -1,3 +1,9 @@
+2014-11-23  Doug Evans  <xdje42@gmail.com>
+
+       * gdbtypes.c (print_args): Renamed from print_arg_types.  Print arg
+       number and name if present.  All callers updated.
+       (dump_fn_fieldlists): Fix indentation of args.
+
 2014-11-23  Patrick Palka  <patrick@parcs.ath.cx>
 
        * MAINTAINERS (Write After Approval): Add myself.
index b921c64f310792bdbf4e3dddfb85bddb7fd919a7..976d56f614a9d8ce812864210cee3c42083c9954 100644 (file)
@@ -3509,14 +3509,18 @@ print_bit_vector (B_TYPE *bits, int nbits)
    situation.  */
 
 static void
-print_arg_types (struct field *args, int nargs, int spaces)
+print_args (struct field *args, int nargs, int spaces)
 {
   if (args != NULL)
     {
       int i;
 
       for (i = 0; i < nargs; i++)
-       recursive_dump_type (args[i].type, spaces + 2);
+       {
+         printfi_filtered (spaces, "[%d] name '%s'\n", i,
+                           args[i].name != NULL ? args[i].name : "<NULL>");
+         recursive_dump_type (args[i].type, spaces + 2);
+       }
     }
 }
 
@@ -3574,11 +3578,9 @@ dump_fn_fieldlists (struct type *type, int spaces)
          gdb_print_host_address (TYPE_FN_FIELD_ARGS (f, overload_idx), 
                                  gdb_stdout);
          printf_filtered ("\n");
-
-         print_arg_types (TYPE_FN_FIELD_ARGS (f, overload_idx),
-                          TYPE_NFIELDS (TYPE_FN_FIELD_TYPE (f, 
-                                                            overload_idx)),
-                          spaces);
+         print_args (TYPE_FN_FIELD_ARGS (f, overload_idx),
+                     TYPE_NFIELDS (TYPE_FN_FIELD_TYPE (f, overload_idx)),
+                     spaces + 8 + 2);
          printfi_filtered (spaces + 8, "fcontext ");
          gdb_print_host_address (TYPE_FN_FIELD_FCONTEXT (f, overload_idx),
                                  gdb_stdout);