/* Target description support for GDB.
- Copyright (C) 2006-2019 Free Software Foundation, Inc.
+ Copyright (C) 2006-2020 Free Software Foundation, Inc.
Contributed by CodeSourcery.
#include "reggroups.h"
#include "target.h"
#include "target-descriptions.h"
-#include "vec.h"
#include "xml-support.h"
#include "xml-tdesc.h"
#include "osabi.h"
switch (e->kind)
{
+ case TDESC_TYPE_IEEE_HALF:
+ m_type = arch_float_type (m_gdbarch, -1, "builtin_type_ieee_half",
+ floatformats_ieee_half);
+ return;
+
case TDESC_TYPE_IEEE_SINGLE:
m_type = arch_float_type (m_gdbarch, -1, "builtin_type_ieee_single",
floatformats_ieee_single);
the total size of the structure. */
bitsize = f.end - f.start + 1;
total_size = e->size * TARGET_CHAR_BIT;
- if (gdbarch_bits_big_endian (m_gdbarch))
+ if (gdbarch_byte_order (m_gdbarch) == BFD_ENDIAN_BIG)
SET_FIELD_BITPOS (fld[0], total_size - f.start - bitsize);
else
SET_FIELD_BITPOS (fld[0], f.start);
return target_desc->arch;
}
-/* See common/tdesc.h. */
+/* See gdbsupport/tdesc.h. */
const char *
tdesc_architecture_name (const struct target_desc *target_desc)
return target_desc->osabi;
}
-/* See common/tdesc.h. */
+/* See gdbsupport/tdesc.h. */
const char *
tdesc_osabi_name (const struct target_desc *target_desc)
set_gdbarch_register_reggroup_p (gdbarch, tdesc_register_reggroup_p);
}
-/* See common/tdesc.h. */
+/* See gdbsupport/tdesc.h. */
struct tdesc_feature *
tdesc_create_feature (struct target_desc *tdesc, const char *name)
target_desc->properties.emplace_back (key, value);
}
-/* See common/tdesc.h. */
+/* See gdbsupport/tdesc.h. */
void
set_tdesc_architecture (struct target_desc *target_desc,
target_desc->arch = arch;
}
-/* See common/tdesc.h. */
+/* See gdbsupport/tdesc.h. */
void
set_tdesc_osabi (struct target_desc *target_desc, const char *name)
printf_unfiltered (" Original: %s */\n\n",
lbasename (m_filename_after_features.c_str ()));
- printf_unfiltered ("#include \"common/tdesc.h\"\n");
+ printf_unfiltered ("#include \"gdbsupport/tdesc.h\"\n");
printf_unfiltered ("\n");
}
int m_next_regnum = 0;
};
-/* See common/tdesc.h. */
+/* See gdbsupport/tdesc.h. */
const char *
tdesc_get_features_xml (const target_desc *tdesc)
|| startswith (filename_after_features.c_str (), "i386/x32-core.xml")
|| startswith (filename_after_features.c_str (), "riscv/")
|| startswith (filename_after_features.c_str (), "tic6x-")
- || startswith (filename_after_features.c_str (), "aarch64"))
+ || startswith (filename_after_features.c_str (), "aarch64")
+ || startswith (filename_after_features.c_str (), "arm/"))
{
print_c_feature v (filename_after_features);
#if GDB_SELF_TEST
-/* See target-descritpions.h. */
+/* See target-descriptions.h. */
void
record_xml_tdesc (const char *xml_file, const struct target_desc *tdesc)
}
-/* Test the convesion process of a target description to/from xml: Take a target
+/* Test the conversion process of a target description to/from xml: Take a target
description TDESC, convert to xml, back to a description, and confirm the new
tdesc is identical to the original. */
static bool
add_setshow_filename_cmd ("filename", class_obscure,
&tdesc_filename_cmd_string,
_("\
-Set the file to read for an XML target description"), _("\
-Show the file to read for an XML target description"), _("\
+Set the file to read for an XML target description."), _("\
+Show the file to read for an XML target description."), _("\
When set, GDB will read the target description from a local\n\
file instead of querying the remote target."),
set_tdesc_filename_cmd,
&tdesc_set_cmdlist, &tdesc_show_cmdlist);
add_cmd ("filename", class_obscure, unset_tdesc_filename_cmd, _("\
-Unset the file to read for an XML target description. When unset,\n\
-GDB will read the description from the target."),
+Unset the file to read for an XML target description.\n\
+When unset, GDB will read the description from the target."),
&tdesc_unset_cmdlist);
add_cmd ("c-tdesc", class_maintenance, maint_print_c_tdesc_cmd, _("\
cmd = add_cmd ("xml-descriptions", class_maintenance,
maintenance_check_xml_descriptions, _("\
+Check equality of GDB target descriptions and XML created descriptions.\n\
Check the target descriptions created in GDB equal the descriptions\n\
created from XML files in the directory.\n\
The parameter is the directory name."),