+2017-12-21 Simon Marchi <simon.marchi@ericsson.com>
+ Sergio Durigan Junior <sergiodj@redhat.com>
+
+ * target-descriptions.c (print_c_tdesc) <visit>: Don't output
+ field_type declaration, use printf_field_type_assignment
+ instead.
+ <printf_field_type_assignment>: New method.
+ * features/aarch64-core.c, features/aarch64-fpu.c
+ features/arc-arcompact.c, features/arc-v2.c,
+ features/arm/arm-with-iwmmxt.c, features/i386/32bit-core.c,
+ features/i386/32bit-mpx.c, features/i386/32bit-sse.c,
+ features/i386/64bit-avx512.c, features/i386/64bit-core.c,
+ features/i386/64bit-mpx.c, features/i386/64bit-sse.c,
+ features/i386/x32-core.c, features/or1k.c,
+ features/rs6000/powerpc-7400.c,
+ features/rs6000/powerpc-altivec32.c,
+ features/rs6000/powerpc-altivec32l.c,
+ features/rs6000/powerpc-altivec64.c,
+ features/rs6000/powerpc-altivec64l.c,
+ features/rs6000/powerpc-cell32l.c,
+ features/rs6000/powerpc-cell64l.c,
+ features/rs6000/powerpc-isa205-altivec32l.c,
+ features/rs6000/powerpc-isa205-altivec64l.c,
+ features/rs6000/powerpc-isa205-vsx32l.c,
+ features/rs6000/powerpc-isa205-vsx64l.c,
+ features/rs6000/powerpc-vsx32.c,
+ features/rs6000/powerpc-vsx32l.c,
+ features/rs6000/powerpc-vsx64.c,
+ features/rs6000/powerpc-vsx64l.c, features/s390-gs-linux64.c,
+ features/s390-tevx-linux64.c, features/s390-vx-linux64.c,
+ features/s390x-gs-linux64.c, features/s390x-tevx-linux64.c,
+ features/s390x-vx-linux64.c: Re-generate.
+
2017-12-20 Uros Bizjak <ubizjak@gmail.com>
* rs6000-tdep.c (ppc_deal_with_atomic_sequence): Remove
feature = tdesc_create_feature (result, "org.gnu.gdb.aarch64.core", "aarch64-core.xml");
tdesc_type_with_fields *type_with_fields;
- tdesc_type *field_type;
type_with_fields = tdesc_create_flags (feature, "cpsr_flags", 4);
tdesc_add_flag (type_with_fields, 0, "SP");
tdesc_add_flag (type_with_fields, 1, "");
tdesc_create_vector (feature, "v1i", element_type, 1);
tdesc_type_with_fields *type_with_fields;
- tdesc_type *field_type;
type_with_fields = tdesc_create_union (feature, "vnd");
+ tdesc_type *field_type;
field_type = tdesc_named_type (feature, "v2d");
tdesc_add_field (type_with_fields, "f", field_type);
field_type = tdesc_named_type (feature, "v2u");
feature = tdesc_create_feature (result, "org.gnu.gdb.arc.aux-minimal");
tdesc_type_with_fields *type_with_fields;
- tdesc_type *field_type;
type_with_fields = tdesc_create_flags (feature, "status32_type", 4);
tdesc_add_flag (type_with_fields, 0, "H");
tdesc_add_bitfield (type_with_fields, "E", 1, 2);
feature = tdesc_create_feature (result, "org.gnu.gdb.arc.aux-minimal");
tdesc_type_with_fields *type_with_fields;
- tdesc_type *field_type;
type_with_fields = tdesc_create_flags (feature, "status32_type", 4);
tdesc_add_flag (type_with_fields, 0, "H");
tdesc_add_bitfield (type_with_fields, "E", 1, 4);
tdesc_create_vector (feature, "iwmmxt_v2u32", element_type, 2);
tdesc_type_with_fields *type_with_fields;
- tdesc_type *field_type;
type_with_fields = tdesc_create_union (feature, "iwmmxt_vec64i");
+ tdesc_type *field_type;
field_type = tdesc_named_type (feature, "iwmmxt_v8u8");
tdesc_add_field (type_with_fields, "u8", field_type);
field_type = tdesc_named_type (feature, "iwmmxt_v4u16");
feature = tdesc_create_feature (result, "org.gnu.gdb.i386.core", "32bit-core.xml");
tdesc_type_with_fields *type_with_fields;
- tdesc_type *field_type;
type_with_fields = tdesc_create_flags (feature, "i386_eflags", 4);
tdesc_add_flag (type_with_fields, 0, "CF");
tdesc_add_flag (type_with_fields, 1, "");
feature = tdesc_create_feature (result, "org.gnu.gdb.i386.mpx", "32bit-mpx.xml");
tdesc_type_with_fields *type_with_fields;
- tdesc_type *field_type;
type_with_fields = tdesc_create_struct (feature, "br128");
+ tdesc_type *field_type;
field_type = tdesc_named_type (feature, "uint64");
tdesc_add_field (type_with_fields, "lbound", field_type);
field_type = tdesc_named_type (feature, "uint64");
tdesc_create_vector (feature, "v2i64", element_type, 2);
tdesc_type_with_fields *type_with_fields;
- tdesc_type *field_type;
type_with_fields = tdesc_create_union (feature, "vec128");
+ tdesc_type *field_type;
field_type = tdesc_named_type (feature, "v4f");
tdesc_add_field (type_with_fields, "v4_float", field_type);
field_type = tdesc_named_type (feature, "v2d");
tdesc_create_vector (feature, "v2i64", element_type, 2);
tdesc_type_with_fields *type_with_fields;
- tdesc_type *field_type;
type_with_fields = tdesc_create_union (feature, "vec128");
+ tdesc_type *field_type;
field_type = tdesc_named_type (feature, "v4f");
tdesc_add_field (type_with_fields, "v4_float", field_type);
field_type = tdesc_named_type (feature, "v2d");
feature = tdesc_create_feature (result, "org.gnu.gdb.i386.core", "64bit-core.xml");
tdesc_type_with_fields *type_with_fields;
- tdesc_type *field_type;
type_with_fields = tdesc_create_flags (feature, "i386_eflags", 4);
tdesc_add_flag (type_with_fields, 0, "CF");
tdesc_add_flag (type_with_fields, 1, "");
feature = tdesc_create_feature (result, "org.gnu.gdb.i386.mpx", "64bit-mpx.xml");
tdesc_type_with_fields *type_with_fields;
- tdesc_type *field_type;
type_with_fields = tdesc_create_struct (feature, "br128");
+ tdesc_type *field_type;
field_type = tdesc_named_type (feature, "uint64");
tdesc_add_field (type_with_fields, "lbound", field_type);
field_type = tdesc_named_type (feature, "uint64");
tdesc_create_vector (feature, "v2i64", element_type, 2);
tdesc_type_with_fields *type_with_fields;
- tdesc_type *field_type;
type_with_fields = tdesc_create_union (feature, "vec128");
+ tdesc_type *field_type;
field_type = tdesc_named_type (feature, "v4f");
tdesc_add_field (type_with_fields, "v4_float", field_type);
field_type = tdesc_named_type (feature, "v2d");
feature = tdesc_create_feature (result, "org.gnu.gdb.i386.core", "x32-core.xml");
tdesc_type_with_fields *type_with_fields;
- tdesc_type *field_type;
type_with_fields = tdesc_create_flags (feature, "i386_eflags", 4);
tdesc_add_flag (type_with_fields, 0, "CF");
tdesc_add_flag (type_with_fields, 1, "");
feature = tdesc_create_feature (result, "org.gnu.gdb.or1k.group0");
tdesc_type_with_fields *type_with_fields;
- tdesc_type *field_type;
type_with_fields = tdesc_create_flags (feature, "sr_flags", 4);
tdesc_add_flag (type_with_fields, 0, "SM");
tdesc_add_flag (type_with_fields, 1, "TEE");
tdesc_create_vector (feature, "v16i8", element_type, 16);
tdesc_type_with_fields *type_with_fields;
- tdesc_type *field_type;
type_with_fields = tdesc_create_union (feature, "vec128");
+ tdesc_type *field_type;
field_type = tdesc_named_type (feature, "uint128");
tdesc_add_field (type_with_fields, "uint128", field_type);
field_type = tdesc_named_type (feature, "v4f");
tdesc_create_vector (feature, "v16i8", element_type, 16);
tdesc_type_with_fields *type_with_fields;
- tdesc_type *field_type;
type_with_fields = tdesc_create_union (feature, "vec128");
+ tdesc_type *field_type;
field_type = tdesc_named_type (feature, "uint128");
tdesc_add_field (type_with_fields, "uint128", field_type);
field_type = tdesc_named_type (feature, "v4f");
tdesc_create_vector (feature, "v16i8", element_type, 16);
tdesc_type_with_fields *type_with_fields;
- tdesc_type *field_type;
type_with_fields = tdesc_create_union (feature, "vec128");
+ tdesc_type *field_type;
field_type = tdesc_named_type (feature, "uint128");
tdesc_add_field (type_with_fields, "uint128", field_type);
field_type = tdesc_named_type (feature, "v4f");
tdesc_create_vector (feature, "v16i8", element_type, 16);
tdesc_type_with_fields *type_with_fields;
- tdesc_type *field_type;
type_with_fields = tdesc_create_union (feature, "vec128");
+ tdesc_type *field_type;
field_type = tdesc_named_type (feature, "uint128");
tdesc_add_field (type_with_fields, "uint128", field_type);
field_type = tdesc_named_type (feature, "v4f");
tdesc_create_vector (feature, "v16i8", element_type, 16);
tdesc_type_with_fields *type_with_fields;
- tdesc_type *field_type;
type_with_fields = tdesc_create_union (feature, "vec128");
+ tdesc_type *field_type;
field_type = tdesc_named_type (feature, "uint128");
tdesc_add_field (type_with_fields, "uint128", field_type);
field_type = tdesc_named_type (feature, "v4f");
tdesc_create_vector (feature, "v16i8", element_type, 16);
tdesc_type_with_fields *type_with_fields;
- tdesc_type *field_type;
type_with_fields = tdesc_create_union (feature, "vec128");
+ tdesc_type *field_type;
field_type = tdesc_named_type (feature, "uint128");
tdesc_add_field (type_with_fields, "uint128", field_type);
field_type = tdesc_named_type (feature, "v4f");
tdesc_create_vector (feature, "v16i8", element_type, 16);
tdesc_type_with_fields *type_with_fields;
- tdesc_type *field_type;
type_with_fields = tdesc_create_union (feature, "vec128");
+ tdesc_type *field_type;
field_type = tdesc_named_type (feature, "uint128");
tdesc_add_field (type_with_fields, "uint128", field_type);
field_type = tdesc_named_type (feature, "v4f");
tdesc_create_vector (feature, "v16i8", element_type, 16);
tdesc_type_with_fields *type_with_fields;
- tdesc_type *field_type;
type_with_fields = tdesc_create_union (feature, "vec128");
+ tdesc_type *field_type;
field_type = tdesc_named_type (feature, "uint128");
tdesc_add_field (type_with_fields, "uint128", field_type);
field_type = tdesc_named_type (feature, "v4f");
tdesc_create_vector (feature, "v16i8", element_type, 16);
tdesc_type_with_fields *type_with_fields;
- tdesc_type *field_type;
type_with_fields = tdesc_create_union (feature, "vec128");
+ tdesc_type *field_type;
field_type = tdesc_named_type (feature, "uint128");
tdesc_add_field (type_with_fields, "uint128", field_type);
field_type = tdesc_named_type (feature, "v4f");
tdesc_create_vector (feature, "v16i8", element_type, 16);
tdesc_type_with_fields *type_with_fields;
- tdesc_type *field_type;
type_with_fields = tdesc_create_union (feature, "vec128");
+ tdesc_type *field_type;
field_type = tdesc_named_type (feature, "uint128");
tdesc_add_field (type_with_fields, "uint128", field_type);
field_type = tdesc_named_type (feature, "v4f");
tdesc_create_vector (feature, "v16i8", element_type, 16);
tdesc_type_with_fields *type_with_fields;
- tdesc_type *field_type;
type_with_fields = tdesc_create_union (feature, "vec128");
+ tdesc_type *field_type;
field_type = tdesc_named_type (feature, "uint128");
tdesc_add_field (type_with_fields, "uint128", field_type);
field_type = tdesc_named_type (feature, "v4f");
tdesc_create_vector (feature, "v16i8", element_type, 16);
tdesc_type_with_fields *type_with_fields;
- tdesc_type *field_type;
type_with_fields = tdesc_create_union (feature, "vec128");
+ tdesc_type *field_type;
field_type = tdesc_named_type (feature, "uint128");
tdesc_add_field (type_with_fields, "uint128", field_type);
field_type = tdesc_named_type (feature, "v4f");
tdesc_create_vector (feature, "v16i8", element_type, 16);
tdesc_type_with_fields *type_with_fields;
- tdesc_type *field_type;
type_with_fields = tdesc_create_union (feature, "vec128");
+ tdesc_type *field_type;
field_type = tdesc_named_type (feature, "uint128");
tdesc_add_field (type_with_fields, "uint128", field_type);
field_type = tdesc_named_type (feature, "v4f");
tdesc_create_vector (feature, "v16i8", element_type, 16);
tdesc_type_with_fields *type_with_fields;
- tdesc_type *field_type;
type_with_fields = tdesc_create_union (feature, "vec128");
+ tdesc_type *field_type;
field_type = tdesc_named_type (feature, "uint128");
tdesc_add_field (type_with_fields, "uint128", field_type);
field_type = tdesc_named_type (feature, "v4f");
tdesc_create_vector (feature, "v16i8", element_type, 16);
tdesc_type_with_fields *type_with_fields;
- tdesc_type *field_type;
type_with_fields = tdesc_create_union (feature, "vec128");
+ tdesc_type *field_type;
field_type = tdesc_named_type (feature, "uint128");
tdesc_add_field (type_with_fields, "uint128", field_type);
field_type = tdesc_named_type (feature, "v4f");
tdesc_create_vector (feature, "v2i64", element_type, 2);
tdesc_type_with_fields *type_with_fields;
- tdesc_type *field_type;
type_with_fields = tdesc_create_union (feature, "vec128");
+ tdesc_type *field_type;
field_type = tdesc_named_type (feature, "v4f");
tdesc_add_field (type_with_fields, "v4_float", field_type);
field_type = tdesc_named_type (feature, "v2d");
tdesc_create_vector (feature, "v2i64", element_type, 2);
tdesc_type_with_fields *type_with_fields;
- tdesc_type *field_type;
type_with_fields = tdesc_create_union (feature, "vec128");
+ tdesc_type *field_type;
field_type = tdesc_named_type (feature, "v4f");
tdesc_add_field (type_with_fields, "v4_float", field_type);
field_type = tdesc_named_type (feature, "v2d");
tdesc_create_vector (feature, "v2i64", element_type, 2);
tdesc_type_with_fields *type_with_fields;
- tdesc_type *field_type;
type_with_fields = tdesc_create_union (feature, "vec128");
+ tdesc_type *field_type;
field_type = tdesc_named_type (feature, "v4f");
tdesc_add_field (type_with_fields, "v4_float", field_type);
field_type = tdesc_named_type (feature, "v2d");
tdesc_create_vector (feature, "v2i64", element_type, 2);
tdesc_type_with_fields *type_with_fields;
- tdesc_type *field_type;
type_with_fields = tdesc_create_union (feature, "vec128");
+ tdesc_type *field_type;
field_type = tdesc_named_type (feature, "v4f");
tdesc_add_field (type_with_fields, "v4_float", field_type);
field_type = tdesc_named_type (feature, "v2d");
tdesc_create_vector (feature, "v2i64", element_type, 2);
tdesc_type_with_fields *type_with_fields;
- tdesc_type *field_type;
type_with_fields = tdesc_create_union (feature, "vec128");
+ tdesc_type *field_type;
field_type = tdesc_named_type (feature, "v4f");
tdesc_add_field (type_with_fields, "v4_float", field_type);
field_type = tdesc_named_type (feature, "v2d");
tdesc_create_vector (feature, "v2i64", element_type, 2);
tdesc_type_with_fields *type_with_fields;
- tdesc_type *field_type;
type_with_fields = tdesc_create_union (feature, "vec128");
+ tdesc_type *field_type;
field_type = tdesc_named_type (feature, "v4f");
tdesc_add_field (type_with_fields, "v4_float", field_type);
field_type = tdesc_named_type (feature, "v2d");
m_printed_type_with_fields = true;
}
- if (!type->fields.empty ()
- && !m_printed_field_type)
- {
- printf_unfiltered (" tdesc_type *field_type;\n");
- m_printed_field_type = true;
- }
-
switch (type->kind)
{
case TDESC_TYPE_STRUCT:
}
else
{
- printf_unfiltered
- (" field_type = tdesc_named_type (feature, \"%s\");\n",
+ printf_field_type_assignment
+ ("tdesc_named_type (feature, \"%s\");\n",
type_name);
printf_unfiltered
(" tdesc_add_typed_bitfield (type_with_fields, \"%s\","
{
gdb_assert (f.end == -1);
gdb_assert (type->kind == TDESC_TYPE_STRUCT);
- printf_unfiltered
- (" field_type = tdesc_named_type (feature,"
- " \"%s\");\n",
- type_name);
+ printf_field_type_assignment
+ ("tdesc_named_type (feature, \"%s\");\n", type_name);
printf_unfiltered
(" tdesc_add_field (type_with_fields, \"%s\", field_type);\n",
f.name.c_str ());
type->name.c_str ());
for (const tdesc_type_field &f : type->fields)
{
- printf_unfiltered
- (" field_type = tdesc_named_type (feature, \"%s\");\n",
- f.type->name.c_str ());
+ printf_field_type_assignment
+ ("tdesc_named_type (feature, \"%s\");\n", f.type->name.c_str ());
printf_unfiltered
(" tdesc_add_field (type_with_fields, \"%s\", field_type);\n",
f.name.c_str ());
std::string m_filename_after_features;
private:
+
+ /* Print an assignment to the field_type variable. Print the declaration
+ of field_type if that has not been done yet. */
+ void printf_field_type_assignment (const char *fmt, ...)
+ {
+ if (!m_printed_field_type)
+ {
+ printf_unfiltered (" tdesc_type *field_type;\n");
+ m_printed_field_type = true;
+ }
+
+ printf_unfiltered (" field_type = ");
+
+ va_list args;
+ va_start (args, fmt);
+ vprintf_unfiltered (fmt, args);
+ va_end (args);
+ }
+
char *m_function;
/* Did we print "struct tdesc_type *element_type;" yet? */