gdb_assert_not_reached ("bad predefined tdesc type");
}
-/* Return the type associated with ID in the context of FEATURE, or
- NULL if none. */
+/* See arch/tdesc.h. */
struct tdesc_type *
tdesc_named_type (const struct tdesc_feature *feature, const char *id)
}
\f
+/* See arch/tdesc.h. */
+
void
tdesc_create_reg (struct tdesc_feature *feature, const char *name,
int regnum, int save_restore, const char *group,
VEC_safe_push (tdesc_reg_p, feature->registers, reg);
}
+/* See arch/tdesc.h. */
+
struct tdesc_type *
tdesc_create_vector (struct tdesc_feature *feature, const char *name,
struct tdesc_type *field_type, int count)
return type;
}
+/* See arch/tdesc.h. */
+
struct tdesc_type *
tdesc_create_struct (struct tdesc_feature *feature, const char *name)
{
return type;
}
-/* Set the total length of TYPE. Structs which contain bitfields may
- omit the reserved bits, so the end of the last field may not
- suffice. */
+/* See arch/tdesc.h. */
void
tdesc_set_struct_size (struct tdesc_type *type, int size)
type->u.u.size = size;
}
+/* See arch/tdesc.h. */
+
struct tdesc_type *
tdesc_create_union (struct tdesc_feature *feature, const char *name)
{
return type;
}
+/* See arch/tdesc.h. */
+
struct tdesc_type *
tdesc_create_flags (struct tdesc_feature *feature, const char *name,
int size)
return type;
}
-/* Add a new field to TYPE. */
+/* See arch/tdesc.h. */
void
tdesc_add_field (struct tdesc_type *type, const char *field_name,
VEC_safe_push (tdesc_type_field, type->u.u.fields, &f);
}
-/* Add a new typed bitfield to TYPE. */
-
void
tdesc_add_typed_bitfield (struct tdesc_type *type, const char *field_name,
int start, int end, struct tdesc_type *field_type)
VEC_safe_push (tdesc_type_field, type->u.u.fields, &f);
}
-/* Add a new untyped bitfield to TYPE.
- Untyped bitfields become either uint32 or uint64 depending on the size
- of the underlying type. */
+/* See arch/tdesc.h. */
void
tdesc_add_bitfield (struct tdesc_type *type, const char *field_name,
tdesc_add_typed_bitfield (type, field_name, start, end, field_type);
}
-/* A flag is just a typed(bool) single-bit bitfield.
- This function is kept to minimize changes in generated files. */
+/* See arch/tdesc.h. */
void
tdesc_add_flag (struct tdesc_type *type, int start,
VEC_safe_push (tdesc_type_field, type->u.u.fields, &f);
}
+/* See arch/tdesc.h. */
+
struct tdesc_feature *
-tdesc_create_feature (struct target_desc *tdesc, const char *name)
+tdesc_create_feature (struct target_desc *tdesc, const char *name,
+ const char *xml)
{
struct tdesc_feature *new_feature = new tdesc_feature (name);
VEC_safe_push (property_s, target_desc->properties, &new_prop);
}
+/* See arch/tdesc.h. */
+
+void
+set_tdesc_architecture (struct target_desc *target_desc,
+ const char *name)
+{
+ set_tdesc_architecture (target_desc, bfd_scan_arch (name));
+}
+
void
set_tdesc_architecture (struct target_desc *target_desc,
const struct bfd_arch_info *arch)
target_desc->arch = arch;
}
+/* See arch/tdesc.h. */
+
+void
+set_tdesc_osabi (struct target_desc *target_desc, const char *name)
+{
+ set_tdesc_osabi (target_desc, osabi_from_tdesc_string (name));
+}
+
void
set_tdesc_osabi (struct target_desc *target_desc, enum gdb_osabi osabi)
{
printf_unfiltered (" Original: %s */\n\n",
lbasename (m_filename_after_features.c_str ()));
- printf_unfiltered ("#include \"target-descriptions.h\"\n");
+ printf_unfiltered ("#include \"arch/tdesc.h\"\n");
printf_unfiltered ("\n");
}
printf_unfiltered ("{\n");
printf_unfiltered (" struct tdesc_feature *feature;\n");
- printf_unfiltered ("\n feature = tdesc_create_feature (result, \"%s\");\n",
- e->name);
+
+ printf_unfiltered
+ ("\n feature = tdesc_create_feature (result, \"%s\", \"%s\");\n",
+ e->name, lbasename (m_filename_after_features.c_str ()));
}
void visit_post (const tdesc_feature *e) override
/* Print c files for target features instead of target descriptions,
because c files got from target features are more flexible than the
counterparts. */
- if (startswith (filename_after_features.c_str (), "i386/32bit-"))
+ if (startswith (filename_after_features.c_str (), "i386/32bit-")
+ || startswith (filename_after_features.c_str (), "i386/64bit-")
+ || startswith (filename_after_features.c_str (), "i386/x32-core.xml"))
{
print_c_feature v (filename_after_features);