Exemplo n.º 1
0
static int
print_selected_record_field_types (struct type *type, struct type *outer_type,
                                   int fld0, int fld1,
                                   struct ui_file *stream, int show, int level,
                                   const struct type_print_options *flags)
{
    int i, flds;

    flds = 0;

    if (fld0 > fld1 && TYPE_STUB (type))
        return -1;

    for (i = fld0; i <= fld1; i += 1)
    {
        QUIT;

        if (ada_is_parent_field (type, i) || ada_is_ignored_field (type, i))
            ;
        else if (ada_is_wrapper_field (type, i))
            flds += print_record_field_types (TYPE_FIELD_TYPE (type, i), type,
                                              stream, show, level, flags);
        else if (ada_is_variant_part (type, i))
        {
            print_variant_part (type, i, outer_type, stream, show, level, flags);
            flds = 1;
        }
        else
        {
            flds += 1;
            fprintf_filtered (stream, "\n%*s", level + 4, "");
            ada_print_type (TYPE_FIELD_TYPE (type, i),
                            TYPE_FIELD_NAME (type, i),
                            stream, show - 1, level + 4, flags);
            fprintf_filtered (stream, ";");
        }
    }

    return flds;
}
Exemplo n.º 2
0
static int
print_record_field_types (struct type *type, struct type *outer_type,
			  struct ui_file *stream, int show, int level)
{
  int len, i, flds;

  flds = 0;
  len = TYPE_NFIELDS (type);

  if (len == 0 && (TYPE_FLAGS (type) & TYPE_FLAG_STUB) != 0)
    return -1;

  for (i = 0; i < len; i += 1)
    {
      QUIT;

      if (ada_is_parent_field (type, i) || ada_is_ignored_field (type, i))
	;
      else if (ada_is_wrapper_field (type, i))
	flds += print_record_field_types (TYPE_FIELD_TYPE (type, i), type,
					  stream, show, level);
      else if (ada_is_variant_part (type, i))
	{
	  print_variant_part (type, i, outer_type, stream, show, level);
	  flds = 1;
	}
      else
	{
	  flds += 1;
	  fprintf_filtered (stream, "\n%*s", level + 4, "");
	  ada_print_type (TYPE_FIELD_TYPE (type, i),
			  TYPE_FIELD_NAME (type, i),
			  stream, show - 1, level + 4);
	  fprintf_filtered (stream, ";");
	}
    }

  return flds;
}