Add FreeBSD/aarch64 architecture.
[deliverable/binutils-gdb.git] / gdb / target-descriptions.c
index bee8e004f4b04354383e7c09e71647a44b4acd7c..2b3c1462f576cd3e11e439ee295ffd36abef588c 100644 (file)
@@ -846,8 +846,7 @@ tdesc_predefined_type (enum tdesc_type_kind kind)
   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)
@@ -1566,6 +1565,8 @@ tdesc_use_registers (struct gdbarch *gdbarch,
 }
 \f
 
+/* See arch/tdesc.h.  */
+
 void
 tdesc_create_reg (struct tdesc_feature *feature, const char *name,
                  int regnum, int save_restore, const char *group,
@@ -1577,6 +1578,8 @@ tdesc_create_reg (struct tdesc_feature *feature, const char *name,
   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)
@@ -1590,6 +1593,8 @@ tdesc_create_vector (struct tdesc_feature *feature, const char *name,
   return type;
 }
 
+/* See arch/tdesc.h.  */
+
 struct tdesc_type *
 tdesc_create_struct (struct tdesc_feature *feature, const char *name)
 {
@@ -1599,9 +1604,7 @@ 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)
@@ -1611,6 +1614,8 @@ 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)
 {
@@ -1620,6 +1625,8 @@ 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)
@@ -1648,7 +1655,7 @@ tdesc_create_enum (struct tdesc_feature *feature, const char *name,
   return type;
 }
 
-/* Add a new field to TYPE.  */
+/* See arch/tdesc.h.  */
 
 void
 tdesc_add_field (struct tdesc_type *type, const char *field_name,
@@ -1669,8 +1676,6 @@ 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)
@@ -1689,9 +1694,7 @@ tdesc_add_typed_bitfield (struct tdesc_type *type, const char *field_name,
   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,
@@ -1709,8 +1712,7 @@ 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,
@@ -1745,8 +1747,11 @@ tdesc_add_enum_value (struct tdesc_type *type, int value,
   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);
 
@@ -1818,6 +1823,15 @@ set_tdesc_property (struct target_desc *target_desc,
   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)
@@ -1825,6 +1839,14 @@ set_tdesc_architecture (struct target_desc *target_desc,
   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)
 {
@@ -2175,7 +2197,7 @@ public:
     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");
   }
 
@@ -2198,8 +2220,10 @@ public:
 
     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
@@ -2305,7 +2329,9 @@ maint_print_c_tdesc_cmd (char *args, int from_tty)
   /* 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);
 
This page took 0.026373 seconds and 4 git commands to generate.