33#include "gdbsupport/gdb_obstack.h"
38#include "readline/tilde.h"
44 property (
const std::string &key_,
const std::string &value_)
57 class gdb_type_creator :
public tdesc_element_visitor
69 void visit (
const tdesc_type_builtin *e)
override
80 case TDESC_TYPE_INT16:
83 case TDESC_TYPE_INT32:
86 case TDESC_TYPE_INT64:
89 case TDESC_TYPE_INT128:
92 case TDESC_TYPE_UINT8:
95 case TDESC_TYPE_UINT16:
98 case TDESC_TYPE_UINT32:
101 case TDESC_TYPE_UINT64:
104 case TDESC_TYPE_UINT128:
107 case TDESC_TYPE_CODE_PTR:
110 case TDESC_TYPE_DATA_PTR:
121 case TDESC_TYPE_IEEE_HALF:
126 case TDESC_TYPE_IEEE_SINGLE:
131 case TDESC_TYPE_IEEE_DOUBLE:
135 case TDESC_TYPE_ARM_FPA_EXT:
140 case TDESC_TYPE_I387_EXT:
145 case TDESC_TYPE_BFLOAT16:
151 internal_error (
"Type \"%s\" has an unknown kind %d",
152 e->name.c_str (), e->kind);
155 void visit (
const tdesc_type_vector *e)
override
163 m_type->set_name (xstrdup (e->name.c_str ()));
167 void visit (
const tdesc_type_with_fields *e)
override
175 case TDESC_TYPE_STRUCT:
176 make_gdb_type_struct (e);
178 case TDESC_TYPE_UNION:
179 make_gdb_type_union (e);
181 case TDESC_TYPE_FLAGS:
182 make_gdb_type_flags (e);
184 case TDESC_TYPE_ENUM:
185 make_gdb_type_enum (e);
189 internal_error (
"Type \"%s\" has an unknown kind %d",
190 e->name.c_str (), e->kind);
195 void make_gdb_type_struct (
const tdesc_type_with_fields *e)
198 m_type->set_name (xstrdup (e->name.c_str ()));
200 for (
const tdesc_type_field &
f : e->fields)
202 if (
f.start != -1 &&
f.end != -1)
206 struct type *field_gdb_type;
207 int bitsize, total_size;
210 gdb_assert (e->size != 0);
213 else if (e->size > 4)
219 (m_type, xstrdup (
f.name.c_str ()), field_gdb_type);
228 bitsize =
f.end -
f.start + 1;
229 total_size = e->size * TARGET_CHAR_BIT;
238 gdb_assert (
f.start == -1 &&
f.end == -1);
241 xstrdup (
f.name.c_str ()),
247 m_type->set_length (e->size);
250 void make_gdb_type_union (
const tdesc_type_with_fields *e)
253 m_type->set_name (xstrdup (e->name.c_str ()));
255 for (
const tdesc_type_field &
f : e->fields)
265 m_type->set_is_vector (
true);
269 void make_gdb_type_flags (
const tdesc_type_with_fields *e)
272 e->size * TARGET_CHAR_BIT);
274 for (
const tdesc_type_field &
f : e->fields)
276 int bitsize =
f.end -
f.start + 1;
278 gdb_assert (
f.type != NULL);
281 field_gdb_type,
f.name.c_str ());
285 void make_gdb_type_enum (
const tdesc_type_with_fields *e)
287 m_type =
arch_type (m_gdbarch, TYPE_CODE_ENUM, e->size * TARGET_CHAR_BIT,
290 m_type->set_is_unsigned (
true);
292 for (
const tdesc_type_field &
f : e->fields)
296 xstrdup (
f.name.c_str ()),
310 gdb_type_creator gdb_type (
gdbarch);
311 ttype->accept (gdb_type);
312 return gdb_type.get_type ();
329 const bfd_arch_info_type *
arch ()
const
351 const struct bfd_arch_info *
arch = NULL;
369 void accept (tdesc_element_visitor &v)
const override
373 for (
const tdesc_feature_up &feature :
features)
390 for (
int ix = 0; ix <
features.size (); ix++)
392 const tdesc_feature_up &feature1 =
features[ix];
393 const tdesc_feature_up &feature2 = other.
features[ix];
395 if (feature1 != feature2 && *feature1 != *feature2)
404 return !(*
this == other);
471 if (
inf->tdesc_info == NULL)
474 return inf->tdesc_info;
487 if (result ==
nullptr)
497 return info !=
nullptr && !info->filename.empty ();
545 tdesc_info->
tdesc =
nullptr;
551 if (tdesc_info->
tdesc ==
nullptr)
556 if (tdesc_info->
tdesc ==
nullptr)
562 if (tdesc_info->
tdesc !=
nullptr)
566 info.target_desc = tdesc_info->
tdesc;
568 warning (_(
"Architecture rejected target-supplied description"));
575 && data->arch_regs.empty ())
576 warning (_(
"Target-supplied registers are not supported "
577 "by the current architecture"));
598 tdesc_info->
tdesc =
nullptr;
602 internal_error (_(
"Could not remove target-supplied description"));
615 return tdesc_info->
tdesc;
625 const struct bfd_arch_info *
arch)
629 if (compat->arch () ==
arch
630 ||
arch->compatible (
arch, compat->arch ())
631 || compat->arch ()->compatible (compat->arch (),
arch))
649 return prop.value.c_str ();
657const struct bfd_arch_info *
675const std::vector<tdesc_compatible_info_up> &
686 return compatible->arch ()->printable_name;
718 if (!feature->registers.empty ())
727const struct tdesc_feature *
732 if (feature->name ==
name)
733 return feature.get ();
743 return feature->name.c_str ();
756 && reg.reg->tdesc_type
758 && reg.reg->tdesc_type->name ==
id)
785static struct tdesc_reg *
789 for (
const tdesc_reg_up ® : feature->registers)
790 if (strcasecmp (reg->name.c_str (),
name) == 0)
801 int regno,
const char *
name)
809 while (regno >= data->arch_regs.size ())
810 data->arch_regs.emplace_back (
nullptr,
nullptr);
838 int regno,
const char *
const names[])
842 for (i = 0; names[i] != NULL; i++)
854 gdb_assert (regno >= 0);
856 return (regno < data->arch_regs.size ()
857 && data->arch_regs[regno].reg !=
nullptr);
868 gdb_assert (reg != NULL);
880 return &data->arch_regs[regno];
885static struct tdesc_reg *
890 return reg?
reg->reg : NULL;
903 return reg->name.c_str ();
909 gdb_assert (data->pseudo_register_name != NULL);
910 return data->pseudo_register_name (
gdbarch, regno);
920 struct tdesc_reg *reg = arch_reg? arch_reg->
reg : NULL;
924 if (reg == NULL && regno >= num_regs && regno < num_regs + num_pseudo_regs)
928 gdb_assert (data->pseudo_register_type != NULL);
929 return data->pseudo_register_type (
gdbarch, regno);
936 if (arch_reg->
type == NULL)
943 else if (reg->type ==
"float")
953 warning (_(
"Register \"%s\" has an unsupported size (%d bits)"),
954 reg->name.c_str (), reg->bitsize);
958 else if (reg->type ==
"int")
962 else if (reg->bitsize == TARGET_CHAR_BIT)
975 warning (_(
"Register \"%s\" has an unsupported size (%d bits)"),
976 reg->name.c_str (), reg->bitsize);
981 if (arch_reg->
type == NULL)
982 internal_error (
"Register \"%s\" has an unknown type \"%s\"",
983 reg->name.c_str (), reg->type.c_str ());
986 return arch_reg->
type;
995 return reg->target_regnum;
1017 if (reg != NULL && !reg->group.empty ()
1023 return reg->save_restore;
1040 if (regno >= num_regs && regno < num_regs + num_pseudo_regs)
1044 if (data->pseudo_register_reggroup_p != NULL)
1065 data->pseudo_register_name = pseudo_name;
1074 data->pseudo_register_type = pseudo_type;
1084 data->pseudo_register_reggroup_p = pseudo_reggroup_p;
1105 data->arch_regs = std::move (early_data->arch_regs);
1110 htab_up reg_hash (htab_create (37, htab_hash_pointer, htab_eq_pointer,
1113 for (
const tdesc_reg_up ® : feature->registers)
1115 void **slot = htab_find_slot (reg_hash.get (), reg.get (), INSERT);
1119 if (!reg->group.empty ())
1122 reg->group.c_str (),
1129 if (arch_reg.reg != NULL)
1130 htab_remove_elt (reg_hash.get (), arch_reg.reg);
1137 gdb_assert (data->arch_regs.size () <= num_regs);
1138 while (data->arch_regs.size () < num_regs)
1139 data->arch_regs.emplace_back (
nullptr,
nullptr);
1144 if (unk_reg_cb != NULL)
1147 for (
const tdesc_reg_up ® : feature->registers)
1148 if (htab_find (reg_hash.get (), reg.get ()) != NULL)
1150 int regno = unk_reg_cb (
gdbarch, feature.get (),
1151 reg->name.c_str (), num_regs);
1152 gdb_assert (regno == -1 || regno >= num_regs);
1155 while (regno >= data->arch_regs.size ())
1156 data->arch_regs.emplace_back (
nullptr,
nullptr);
1158 num_regs = regno + 1;
1159 htab_remove_elt (reg_hash.get (), reg.get ());
1165 gdb_assert (data->arch_regs.size () == num_regs);
1170 for (
const tdesc_reg_up ® : feature->registers)
1171 if (htab_find (reg_hash.get (), reg.get ()) != NULL)
1173 data->arch_regs.emplace_back (reg.get (),
nullptr);
1188struct tdesc_feature *
1191 struct tdesc_feature *new_feature =
new tdesc_feature (
name);
1193 tdesc->
features.emplace_back (new_feature);
1216 const struct bfd_arch_info *compatible)
1221 if (compatible == NULL)
1225 if (compat->arch () == compatible)
1226 internal_error (_(
"Attempted to add duplicate "
1227 "compatible architecture \"%s\""),
1228 compatible->printable_name);
1231 (std::unique_ptr<tdesc_compatible_info>
1237 const char *key,
const char *
value)
1239 gdb_assert (key != NULL &&
value != NULL);
1242 internal_error (_(
"Attempted to add duplicate property \"%s\""), key);
1258 const struct bfd_arch_info *arch)
1304 _(
"The target description will be read from \"%s\".\n"),
1308 _(
"The target description will be "
1309 "read from the target.\n"));
1335 for (inp = filename, outp =
m_function; *inp !=
'\0'; inp++)
1338 else if (*inp ==
'-')
1340 else if (*inp ==
' ')
1348 "-*- buffer-read-only: t -*- vi"
1364 gdb_printf (
"#include \"target-descriptions.h\"\n");
1372 (
" target_desc_up result = allocate_target_description ();\n");
1377 (
" set_tdesc_architecture (result.get (), bfd_scan_arch (\"%s\"));\n",
1385 (
" set_tdesc_osabi (result.get (), osabi_from_tdesc_string (\"%s\"));\n",
1390 for (
const tdesc_compatible_info_up &compatible : e->
compatible)
1392 (
" tdesc_add_compatible (result.get (), bfd_scan_arch (\"%s\"));\n",
1393 compatible->arch ()->printable_name);
1399 gdb_printf (
" set_tdesc_property (result.get (), \"%s\", \"%s\");\n",
1400 prop.key.c_str (), prop.value.c_str ());
1402 gdb_printf (
" struct tdesc_feature *feature;\n");
1407 gdb_printf (
"\n feature = tdesc_create_feature (result.get (), \"%s\");\n",
1422 error (_(
"C output is not supported type \"%s\"."),
type->
name.c_str ());
1434 (
" element_type = tdesc_named_type (feature, \"%s\");\n",
1435 type->element_type->
name.c_str ());
1437 (
" tdesc_create_vector (feature, \"%s\", element_type, %d);\n",
1447 gdb_printf (
" tdesc_type_with_fields *type_with_fields;\n");
1453 case TDESC_TYPE_STRUCT:
1454 case TDESC_TYPE_FLAGS:
1455 if (
type->kind == TDESC_TYPE_STRUCT)
1458 (
" type_with_fields = tdesc_create_struct (feature, \"%s\");\n",
1460 if (
type->size != 0)
1462 (
" tdesc_set_struct_size (type_with_fields, %d);\n",
type->size);
1467 (
" type_with_fields = tdesc_create_flags (feature, \"%s\", %d);\n",
1472 const char *type_name;
1474 gdb_assert (
f.type != NULL);
1475 type_name =
f.type->name.c_str ();
1481 gdb_assert (
f.end != -1);
1482 if (
f.type->kind == TDESC_TYPE_BOOL)
1484 gdb_assert (
f.start ==
f.end);
1486 (
" tdesc_add_flag (type_with_fields, %d, \"%s\");\n",
1487 f.start,
f.name.c_str ());
1489 else if ((
type->size == 4 &&
f.type->kind == TDESC_TYPE_UINT32)
1491 &&
f.type->kind == TDESC_TYPE_UINT64))
1494 (
" tdesc_add_bitfield (type_with_fields, \"%s\", %d, %d);\n",
1495 f.name.c_str (),
f.start,
f.end);
1500 (
"tdesc_named_type (feature, \"%s\");\n",
1503 (
" tdesc_add_typed_bitfield (type_with_fields, \"%s\","
1504 " %d, %d, field_type);\n",
1505 f.name.c_str (),
f.start,
f.end);
1510 gdb_assert (
f.end == -1);
1511 gdb_assert (
type->kind == TDESC_TYPE_STRUCT);
1513 (
"tdesc_named_type (feature, \"%s\");\n", type_name);
1515 (
" tdesc_add_field (type_with_fields, \"%s\", field_type);\n",
1520 case TDESC_TYPE_UNION:
1522 (
" type_with_fields = tdesc_create_union (feature, \"%s\");\n",
1527 (
"tdesc_named_type (feature, \"%s\");\n",
f.type->name.c_str ());
1529 (
" tdesc_add_field (type_with_fields, \"%s\", field_type);\n",
1533 case TDESC_TYPE_ENUM:
1535 (
" type_with_fields = tdesc_create_enum (feature, \"%s\", %d);\n",
1539 (
" tdesc_add_enum_value (type_with_fields, %d, \"%s\");\n",
1540 f.start,
f.name.c_str ());
1543 error (_(
"C output is not supported type \"%s\"."),
type->
name.c_str ());
1549 void visit (
const tdesc_reg *reg)
override
1551 gdb_printf (
" tdesc_create_reg (feature, \"%s\", %ld, %d, ",
1552 reg->name.c_str (), reg->target_regnum,
1554 if (!reg->group.empty ())
1555 gdb_printf (
"\"%s\", ", reg->group.c_str ());
1558 gdb_printf (
"%d, \"%s\");\n", reg->bitsize, reg->type.c_str ());
1580 va_start (args, fmt);
1616 gdb_printf (
"#include \"gdbsupport/tdesc.h\"\n");
1627 auto pos =
name.find_first_of (
'.');
1630 std::replace (
name.begin (),
name.end (),
'/',
'_');
1631 std::replace (
name.begin (),
name.end (),
'-',
'_');
1635 gdb_printf (
"(struct target_desc *result, long regnum)\n");
1638 gdb_printf (
" struct tdesc_feature *feature;\n");
1641 (
"\n feature = tdesc_create_feature (result, \"%s\");\n",
1651 void visit (
const tdesc_reg *reg)
override
1681 gdb_printf (
"ERROR: \"regnum\" attribute %ld ",
1682 reg->target_regnum);
1683 gdb_printf (
"is not the largest number (%d).\n",
1685 error (_(
"\"regnum\" attribute %ld is not the largest number (%d)."),
1691 gdb_printf (
" regnum = %ld;\n", reg->target_regnum);
1695 gdb_printf (
" tdesc_create_reg (feature, \"%s\", regnum++, %d, ",
1696 reg->name.c_str (), reg->save_restore);
1697 if (!reg->group.empty ())
1698 gdb_printf (
"\"%s\", ", reg->group.c_str ());
1701 gdb_printf (
"%d, \"%s\");\n", reg->bitsize, reg->type.c_str ());
1718 std::string buffer (
"@");
1719 print_xml_feature v (&buffer);
1721 tdesc->
xmltarget = xstrdup (buffer.c_str ());
1742 N_(
"Print C description of just a single feature.")
1758 const char *filename;
1772 tdesc = tdesc_info->
tdesc;
1773 filename = tdesc_info->
filename.data ();
1783 error (_(
"There is no target description to print."));
1785 if (filename == NULL)
1786 filename =
"fetched from target";
1788 std::string filename_after_features (filename);
1789 auto loc = filename_after_features.rfind (
"/features/");
1791 if (
loc != std::string::npos)
1792 filename_after_features = filename_after_features.substr (
loc + 10);
1797 if (opts.single_feature)
1800 error (_(
"only target descriptions with 1 feature can be used "
1801 "with -single-feature option"));
1820 const char *text,
const char *word)
1853 error (_(
"There is no target description to print."));
1856 print_xml_feature v (&buf);
1872 std::unique_ptr<const target_desc>
tdesc;
1882record_xml_tdesc (
const char *xml_file,
const struct target_desc *tdesc)
1884 xml_tdesc.emplace_back (xml_file, std::unique_ptr<const target_desc> (tdesc));
1898 if (xml ==
nullptr || *xml !=
'@')
1900 gdb_printf (_(
"Could not convert description for %s to xml.\n"),
1907 if (tdesc_trans ==
nullptr)
1909 gdb_printf (_(
"Could not convert description for %s from xml.\n"),
1913 else if (*tdesc != *tdesc_trans)
1915 gdb_printf (_(
"Converted description for %s does not match.\n"),
1931 error (_(
"Missing dir name"));
1933 gdb::unique_xmalloc_ptr<char> dir1 (tilde_expand (dir));
1934 std::string feature_dir (dir1.get ());
1935 unsigned int failed = 0;
1939 std::string tdesc_xml = (feature_dir + SLASH_STRING + e.name);
1943 if (tdesc == NULL || *tdesc != *e.tdesc)
1945 gdb_printf ( _(
"Descriptions for %s do not match.\n"), e.name);
1952 gdb_printf (_(
"Tested %lu XML files, %d failed\n"),
1963 _(
"Set target description specific variables."),
1964 _(
"Show target description specific variables."),
1969Unset target description specific variables."),
1976Set the file to read for an XML target description."), _(
"\
1977Show the file to read for an XML target description."), _(
"\
1978When set, GDB will read the target description from a local\n\
1979file instead of querying the remote target."),
1985Unset the file to read for an XML target description.\n\
1986When unset, GDB will read the description from the target."),
1990 static std::string help_text
1992Print the current target description as a C source file.\n\
1993Usage: maintenance print c-tdesc [OPTION] [FILENAME]\n\
1998When FILENAME is not provided then print the current target\n\
1999description, otherwise an XML target description is read from\n\
2000FILENAME and printed as a C function.\n\
2002When '-single-feature' is used then the target description should\n\
2003contain a single feature and the generated C code will only create\n\
2004that feature within an already existing target_desc object."), grp);
2010Print the current target description as an XML file."),
2016Check equality of GDB target descriptions and XML created descriptions.\n\
2017Check the target descriptions created in GDB equal the descriptions\n\
2018created from XML files in the directory.\n\
2019The parameter is the directory name."),
int gdbarch_update_p(struct gdbarch_info info)
struct gdbarch * target_gdbarch(void)
static struct type * get_type(const struct varobj *var)
void visit(const tdesc_reg *reg) override
void visit_post(const tdesc_feature *e) override
void visit_pre(const target_desc *e) override
void visit_post(const target_desc *e) override
print_c_feature(std::string &file)
void visit_pre(const tdesc_feature *e) override
void visit_pre(const tdesc_feature *e) override
print_c_tdesc(std::string &filename_after_features)
void visit_post(const tdesc_feature *e) override
void printf_field_type_assignment(const char *fmt,...)
bool m_printed_type_with_fields
void visit_post(const target_desc *e) override
void visit(const tdesc_type_with_fields *type) override
void visit_pre(const target_desc *e) override
void visit(const tdesc_type_builtin *type) override
bool m_printed_element_type
void visit(const tdesc_reg *reg) override
bool m_printed_field_type
void visit(const tdesc_type_vector *type) override
std::string m_filename_after_features
const bfd_arch_info_type * arch() const
tdesc_compatible_info(const bfd_arch_info_type *arch)
const bfd_arch_info_type * m_arch
struct cmd_list_element * showlist
struct cmd_list_element * maintenanceprintlist
struct cmd_list_element * maintenancechecklist
struct cmd_list_element * setlist
struct cmd_list_element * unsetlist
set_show_commands add_setshow_filename_cmd(const char *name, enum command_class theclass, std::string *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_func_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, const char *doc, struct cmd_list_element **list)
void set_cmd_completer_handle_brkchars(struct cmd_list_element *cmd, completer_handle_brkchars_ftype *func)
void set_cmd_completer(struct cmd_list_element *cmd, completer_ftype *completer)
set_show_commands add_setshow_prefix_cmd(const char *name, command_class theclass, const char *set_doc, const char *show_doc, cmd_list_element **set_subcommands_list, cmd_list_element **show_subcommands_list, cmd_list_element **set_list, cmd_list_element **show_list)
struct cmd_list_element * add_basic_prefix_cmd(const char *name, enum command_class theclass, const char *doc, struct cmd_list_element **subcommands, int allow_unknown, struct cmd_list_element **list)
const char * advance_to_filename_complete_word_point(completion_tracker &tracker, const char *text)
void filename_completer(struct cmd_list_element *ignore, completion_tracker &tracker, const char *text, const char *word)
static void ATTRIBUTE_PRINTF(1, 0)
struct type *() gdbarch_register_type_ftype(struct gdbarch *gdbarch, int reg_nr)
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
void set_gdbarch_register_name(struct gdbarch *gdbarch, gdbarch_register_name_ftype *register_name)
int gdbarch_long_long_bit(struct gdbarch *gdbarch)
int gdbarch_short_bit(struct gdbarch *gdbarch)
int gdbarch_num_regs(struct gdbarch *gdbarch)
const char *() gdbarch_register_name_ftype(struct gdbarch *gdbarch, int regnr)
int gdbarch_int_bit(struct gdbarch *gdbarch)
int gdbarch_float_bit(struct gdbarch *gdbarch)
void set_gdbarch_register_reggroup_p(struct gdbarch *gdbarch, gdbarch_register_reggroup_p_ftype *register_reggroup_p)
int gdbarch_num_pseudo_regs(struct gdbarch *gdbarch)
void set_gdbarch_register_type(struct gdbarch *gdbarch, gdbarch_register_type_ftype *register_type)
const struct target_desc * gdbarch_target_desc(struct gdbarch *gdbarch)
void set_gdbarch_remote_register_number(struct gdbarch *gdbarch, gdbarch_remote_register_number_ftype *remote_register_number)
int gdbarch_long_double_bit(struct gdbarch *gdbarch)
int() gdbarch_register_reggroup_p_ftype(struct gdbarch *gdbarch, int regnum, const struct reggroup *reggroup)
void set_gdbarch_num_regs(struct gdbarch *gdbarch, int num_regs)
int gdbarch_long_bit(struct gdbarch *gdbarch)
int gdbarch_ptr_bit(struct gdbarch *gdbarch)
int gdbarch_double_bit(struct gdbarch *gdbarch)
static int gdbarch_num_cooked_regs(gdbarch *arch)
struct type * arch_composite_type(struct gdbarch *gdbarch, const char *name, enum type_code code)
struct type * arch_flags_type(struct gdbarch *gdbarch, const char *name, int bit)
struct type * init_vector_type(struct type *elt_type, int n)
void append_flags_type_field(struct type *type, int start_bitpos, int nr_bits, struct type *field_type, const char *name)
struct type * arch_type(struct gdbarch *gdbarch, enum type_code code, int bit, const char *name)
const struct floatformat * floatformats_bfloat16[BFD_ENDIAN_UNKNOWN]
const struct floatformat * floatformats_ieee_single[BFD_ENDIAN_UNKNOWN]
struct type * arch_float_type(struct gdbarch *gdbarch, int bit, const char *name, const struct floatformat **floatformats)
const struct floatformat * floatformats_arm_ext[BFD_ENDIAN_UNKNOWN]
struct field * append_composite_type_field_raw(struct type *t, const char *name, struct type *field)
const struct floatformat * floatformats_ieee_half[BFD_ENDIAN_UNKNOWN]
const struct floatformat * floatformats_ieee_double[BFD_ENDIAN_UNKNOWN]
void append_composite_type_field(struct type *t, const char *name, struct type *field)
const struct floatformat * floatformats_i387_ext[BFD_ENDIAN_UNKNOWN]
#define FIELD_BITSIZE(thisfld)
struct inferior * current_inferior(void)
bool process_options(const char **args, process_options_mode mode, gdb::array_view< const option_def_group > options_group)
@ PROCESS_OPTIONS_UNKNOWN_IS_ERROR
std::string build_help(const char *help_tmpl, gdb::array_view< const option_def_group > options_group)
bool complete_options(completion_tracker &tracker, const char **args, process_options_mode mode, gdb::array_view< const option_def_group > options_group)
static std::vector< xml_test_tdesc > xml_tdesc
const char * gdbarch_osabi_name(enum gdb_osabi osabi)
enum gdb_osabi osabi_from_tdesc_string(const char *name)
int default_register_reggroup_p(struct gdbarch *gdbarch, int regnum, const struct reggroup *group)
const reggroup * reggroup_find(struct gdbarch *gdbarch, const char *name)
const reggroup *const save_reggroup
void reggroup_add(struct gdbarch *gdbarch, const reggroup *group)
const reggroup *const restore_reggroup
const reggroup * reggroup_gdbarch_new(struct gdbarch *gdbarch, const char *name, enum reggroup_type type)
struct type * builtin_long_long
struct type * builtin_int0
struct type * builtin_uint16
struct type * builtin_double
struct type * builtin_int8
struct type * builtin_func_ptr
struct type * builtin_uint128
struct type * builtin_long
struct type * builtin_data_ptr
struct type * builtin_bool
struct type * builtin_long_double
struct type * builtin_uint32
struct type * builtin_uint64
struct type * builtin_short
struct type * builtin_int64
struct type * builtin_char
struct type * builtin_int
struct type * builtin_int32
struct type * builtin_uint8
struct type * builtin_int128
struct type * builtin_int16
struct type * builtin_float
void set_loc_bitpos(LONGEST bitpos)
void set_loc_enumval(LONGEST enumval)
property(const std::string &key_, const std::string &value_)
const char * name() const
xml_test_tdesc(const char *name, std::unique_ptr< const target_desc > &&tdesc)
std::unique_ptr< const target_desc > tdesc
const struct target_desc * tdesc
target_desc(const target_desc &)=delete
bool operator==(const target_desc &other) const
void accept(tdesc_element_visitor &v) const override
std::vector< tdesc_feature_up > features
std::vector< property > properties
std::vector< tdesc_compatible_info_up > compatible
virtual ~target_desc()=default
bool operator!=(const target_desc &other) const
void operator=(const target_desc &)=delete
const struct bfd_arch_info * arch
void operator()(struct tdesc_arch_data *data) const
std::vector< tdesc_arch_reg > arch_regs
gdbarch_register_reggroup_p_ftype * pseudo_register_reggroup_p
gdbarch_register_name_ftype * pseudo_register_name
gdbarch_register_type_ftype * pseudo_register_type
tdesc_arch_reg(tdesc_reg *reg_, struct type *type_)
struct field * fields() const
const char * name() const
tdesc_arch_data_up tdesc_data_alloc(void)
const struct tdesc_feature * tdesc_find_feature(const struct target_desc *target_desc, const char *name)
const char * tdesc_osabi_name(const struct target_desc *target_desc)
void tdesc_add_compatible(struct target_desc *target_desc, const struct bfd_arch_info *compatible)
void set_tdesc_architecture(struct target_desc *target_desc, const char *name)
void target_find_description(void)
static struct cmd_list_element * tdesc_show_cmdlist
void set_tdesc_osabi(struct target_desc *target_desc, const char *name)
static struct tdesc_arch_reg * tdesc_find_arch_register(struct gdbarch *gdbarch, int regno)
int tdesc_numbered_register(const struct tdesc_feature *feature, struct tdesc_arch_data *data, int regno, const char *name)
static const registry< gdbarch >::key< tdesc_arch_data > tdesc_data
static std::string tdesc_filename_cmd_string
void target_clear_description(void)
static struct cmd_list_element * tdesc_set_cmdlist
const std::vector< tdesc_compatible_info_up > & tdesc_compatible_info_list(const target_desc *target_desc)
static void unset_tdesc_filename_cmd(const char *args, int from_tty)
void tdesc_use_registers(struct gdbarch *gdbarch, const struct target_desc *target_desc, tdesc_arch_data_up &&early_data, tdesc_unknown_register_ftype unk_reg_cb)
void set_tdesc_pseudo_register_name(struct gdbarch *gdbarch, gdbarch_register_name_ftype *pseudo_name)
static void maint_print_c_tdesc_cmd(const char *args, int from_tty)
static const gdb::option::option_def maint_print_c_tdesc_opt_defs[]
static struct tdesc_reg * tdesc_find_register_early(const struct tdesc_feature *feature, const char *name)
int tdesc_has_registers(const struct target_desc *target_desc)
static struct cmd_list_element * tdesc_unset_cmdlist
void copy_inferior_target_desc_info(struct inferior *destinf, struct inferior *srcinf)
static bool maintenance_check_tdesc_xml_convert(const target_desc *tdesc, const char *name)
static tdesc_arch_data * get_arch_data(struct gdbarch *gdbarch)
const char * tdesc_compatible_info_arch_name(const tdesc_compatible_info_up &compatible)
const char * tdesc_feature_name(const struct tdesc_feature *feature)
void set_tdesc_pseudo_register_type(struct gdbarch *gdbarch, gdbarch_register_type_ftype *pseudo_type)
static struct tdesc_reg * tdesc_find_register(struct gdbarch *gdbarch, int regno)
struct type * tdesc_register_type(struct gdbarch *gdbarch, int regno)
int tdesc_numbered_register_choices(const struct tdesc_feature *feature, struct tdesc_arch_data *data, int regno, const char *const names[])
static gdb::option::option_def_group make_maint_print_c_tdesc_options_def_group(maint_print_c_tdesc_options *opts)
static void maint_print_c_tdesc_cmd_completer(struct cmd_list_element *ignore, completion_tracker &tracker, const char *text, const char *word)
int tdesc_register_bitsize(const struct tdesc_feature *feature, const char *name)
const struct bfd_arch_info * tdesc_architecture(const struct target_desc *target_desc)
static void show_tdesc_filename_cmd(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
struct tdesc_feature * tdesc_create_feature(struct target_desc *tdesc, const char *name)
target_desc_up allocate_target_description(void)
static struct target_desc_info * get_tdesc_info(struct inferior *inf)
const struct target_desc * target_current_description(void)
const char * tdesc_register_name(struct gdbarch *gdbarch, int regno)
static void set_tdesc_filename_cmd(const char *args, int from_tty, struct cmd_list_element *c)
const char * tdesc_architecture_name(const struct target_desc *target_desc)
int tdesc_unnumbered_register(const struct tdesc_feature *feature, const char *name)
void _initialize_target_descriptions()
static void maint_print_xml_tdesc_cmd(const char *args, int from_tty)
static int tdesc_register_reggroup_p(struct gdbarch *gdbarch, int regno, const struct reggroup *reggroup)
enum gdb_osabi tdesc_osabi(const struct target_desc *target_desc)
static int tdesc_remote_register_number(struct gdbarch *gdbarch, int regno)
static type * make_gdb_type(struct gdbarch *gdbarch, struct tdesc_type *ttype)
bool tdesc_found_register(struct tdesc_arch_data *data, int regno)
int tdesc_compatible_p(const struct target_desc *target_desc, const struct bfd_arch_info *arch)
int tdesc_register_in_reggroup_p(struct gdbarch *gdbarch, int regno, const struct reggroup *reggroup)
void set_tdesc_pseudo_register_reggroup_p(struct gdbarch *gdbarch, gdbarch_register_reggroup_p_ftype *pseudo_reggroup_p)
const char * tdesc_get_features_xml(const target_desc *tdesc)
struct type * tdesc_find_type(struct gdbarch *gdbarch, const char *id)
void target_desc_info_free(struct target_desc_info *tdesc_info)
int target_desc_info_from_user_p(struct target_desc_info *info)
const char * tdesc_property(const struct target_desc *target_desc, const char *key)
static void maintenance_check_xml_descriptions(const char *dir, int from_tty)
void set_tdesc_property(struct target_desc *target_desc, const char *key, const char *value)
std::unique_ptr< tdesc_arch_data, tdesc_arch_data_deleter > tdesc_arch_data_up
int(* tdesc_unknown_register_ftype)(struct gdbarch *gdbarch, tdesc_feature *feature, const char *reg_name, int possible_regnum)
const struct target_desc * target_read_description(struct target_ops *target)
void gdb_vprintf(struct ui_file *stream, const char *format, va_list args)
void gdb_printf(struct ui_file *stream, const char *format,...)
void gdb_puts(const char *linebuffer, struct ui_file *stream)
const struct target_desc * string_read_description_xml(const char *xml)
const struct target_desc * target_read_description_xml(struct target_ops *ops)
const struct target_desc * file_read_description_xml(const char *filename)