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:
122 case TDESC_TYPE_IEEE_HALF:
127 case TDESC_TYPE_IEEE_SINGLE:
132 case TDESC_TYPE_IEEE_DOUBLE:
136 case TDESC_TYPE_ARM_FPA_EXT:
141 case TDESC_TYPE_I387_EXT:
146 case TDESC_TYPE_BFLOAT16:
152 internal_error (
"Type \"%s\" has an unknown kind %d",
153 e->name.c_str (), e->kind);
156 void visit (
const tdesc_type_vector *e)
override
164 m_type->set_name (xstrdup (e->name.c_str ()));
168 void visit (
const tdesc_type_with_fields *e)
override
176 case TDESC_TYPE_STRUCT:
177 make_gdb_type_struct (e);
179 case TDESC_TYPE_UNION:
180 make_gdb_type_union (e);
182 case TDESC_TYPE_FLAGS:
183 make_gdb_type_flags (e);
185 case TDESC_TYPE_ENUM:
186 make_gdb_type_enum (e);
190 internal_error (
"Type \"%s\" has an unknown kind %d",
191 e->name.c_str (), e->kind);
196 void make_gdb_type_struct (
const tdesc_type_with_fields *e)
199 m_type->set_name (xstrdup (e->name.c_str ()));
201 for (
const tdesc_type_field &
f : e->fields)
203 if (
f.start != -1 &&
f.end != -1)
207 struct type *field_gdb_type;
208 int bitsize, total_size;
211 gdb_assert (e->size != 0);
214 else if (e->size > 4)
220 (m_type, xstrdup (
f.name.c_str ()), field_gdb_type);
229 bitsize =
f.end -
f.start + 1;
230 total_size = e->size * TARGET_CHAR_BIT;
239 gdb_assert (
f.start == -1 &&
f.end == -1);
242 xstrdup (
f.name.c_str ()),
248 m_type->set_length (e->size);
251 void make_gdb_type_union (
const tdesc_type_with_fields *e)
254 m_type->set_name (xstrdup (e->name.c_str ()));
256 for (
const tdesc_type_field &
f : e->fields)
266 m_type->set_is_vector (
true);
270 void make_gdb_type_flags (
const tdesc_type_with_fields *e)
273 e->size * TARGET_CHAR_BIT);
275 for (
const tdesc_type_field &
f : e->fields)
277 int bitsize =
f.end -
f.start + 1;
279 gdb_assert (
f.type != NULL);
282 field_gdb_type,
f.
name.c_str ());
286 void make_gdb_type_enum (
const tdesc_type_with_fields *e)
289 .
new_type (TYPE_CODE_ENUM, e->size * TARGET_CHAR_BIT,
292 m_type->set_is_unsigned (
true);
294 for (
const tdesc_type_field &
f : e->fields)
298 xstrdup (
f.name.c_str ()),
312 gdb_type_creator gdb_type (
gdbarch);
313 ttype->accept (gdb_type);
314 return gdb_type.get_type ();
331 const bfd_arch_info_type *
arch ()
const
353 const struct bfd_arch_info *
arch = NULL;
371 void accept (tdesc_element_visitor &v)
const override
375 for (
const tdesc_feature_up &feature :
features)
392 for (
int ix = 0; ix <
features.size (); ix++)
394 const tdesc_feature_up &feature1 =
features[ix];
395 const tdesc_feature_up &feature2 = other.
features[ix];
397 if (feature1 != feature2 && *feature1 != *feature2)
406 return !(*
this == other);
451 if (result ==
nullptr)
482 tdesc_info->
tdesc =
nullptr;
488 if (tdesc_info->
tdesc ==
nullptr)
493 if (tdesc_info->
tdesc ==
nullptr)
499 if (tdesc_info->
tdesc !=
nullptr)
503 info.target_desc = tdesc_info->
tdesc;
506 warning (_(
"Architecture rejected target-supplied description"));
507 tdesc_info->
tdesc =
nullptr;
515 && data->arch_regs.empty ())
516 warning (_(
"Target-supplied registers are not supported "
517 "by the current architecture"));
538 tdesc_info->
tdesc =
nullptr;
542 internal_error (_(
"Could not remove target-supplied description"));
555 return tdesc_info->
tdesc;
565 const struct bfd_arch_info *
arch)
569 if (compat->arch () ==
arch
570 ||
arch->compatible (
arch, compat->arch ())
571 || compat->arch ()->compatible (compat->arch (),
arch))
589 return prop.value.c_str ();
597const struct bfd_arch_info *
615const std::vector<tdesc_compatible_info_up> &
626 return compatible->arch ()->printable_name;
658 if (!feature->registers.empty ())
667const struct tdesc_feature *
672 if (feature->name ==
name)
673 return feature.get ();
683 return feature->name.c_str ();
696 && reg.reg->tdesc_type
698 && reg.reg->tdesc_type->name ==
id)
725static struct tdesc_reg *
729 for (
const tdesc_reg_up ® : feature->registers)
730 if (strcasecmp (reg->name.c_str (),
name) == 0)
741 int regno,
const char *
name)
749 while (regno >= data->arch_regs.size ())
750 data->arch_regs.emplace_back (
nullptr,
nullptr);
778 int regno,
const char *
const names[])
782 for (i = 0; names[i] != NULL; i++)
794 gdb_assert (regno >= 0);
796 return (regno < data->arch_regs.size ()
797 && data->arch_regs[regno].reg !=
nullptr);
808 gdb_assert (reg != NULL);
820 return &data->arch_regs[regno];
825static struct tdesc_reg *
830 return reg?
reg->reg : NULL;
843 return reg->name.c_str ();
849 gdb_assert (data->pseudo_register_name != NULL);
850 return data->pseudo_register_name (
gdbarch, regno);
860 struct tdesc_reg *reg = arch_reg? arch_reg->
reg : NULL;
864 if (reg == NULL && regno >= num_regs && regno < num_regs + num_pseudo_regs)
868 gdb_assert (data->pseudo_register_type != NULL);
869 return data->pseudo_register_type (
gdbarch, regno);
876 if (arch_reg->
type == NULL)
883 else if (reg->type ==
"float")
893 warning (_(
"Register \"%s\" has an unsupported size (%d bits)"),
894 reg->name.c_str (), reg->bitsize);
898 else if (reg->type ==
"int")
902 else if (reg->bitsize == TARGET_CHAR_BIT)
915 warning (_(
"Register \"%s\" has an unsupported size (%d bits)"),
916 reg->name.c_str (), reg->bitsize);
921 if (arch_reg->
type == NULL)
922 internal_error (
"Register \"%s\" has an unknown type \"%s\"",
923 reg->name.c_str (), reg->type.c_str ());
926 return arch_reg->
type;
935 return reg->target_regnum;
957 if (reg != NULL && !reg->group.empty ()
963 return reg->save_restore;
980 if (regno >= num_regs && regno < num_regs + num_pseudo_regs)
984 if (data->pseudo_register_reggroup_p != NULL)
1005 data->pseudo_register_name = pseudo_name;
1014 data->pseudo_register_type = pseudo_type;
1024 data->pseudo_register_reggroup_p = pseudo_reggroup_p;
1045 data->arch_regs = std::move (early_data->arch_regs);
1050 htab_up reg_hash (htab_create (37, htab_hash_pointer, htab_eq_pointer,
1053 for (
const tdesc_reg_up ® : feature->registers)
1055 void **slot = htab_find_slot (reg_hash.get (), reg.get (), INSERT);
1059 if (!reg->group.empty ())
1062 reg->group.c_str (),
1069 if (arch_reg.reg != NULL)
1070 htab_remove_elt (reg_hash.get (), arch_reg.reg);
1077 gdb_assert (data->arch_regs.size () <= num_regs);
1078 while (data->arch_regs.size () < num_regs)
1079 data->arch_regs.emplace_back (
nullptr,
nullptr);
1084 if (unk_reg_cb != NULL)
1087 for (
const tdesc_reg_up ® : feature->registers)
1088 if (htab_find (reg_hash.get (), reg.get ()) != NULL)
1090 int regno = unk_reg_cb (
gdbarch, feature.get (),
1091 reg->name.c_str (), num_regs);
1092 gdb_assert (regno == -1 || regno >= num_regs);
1095 while (regno >= data->arch_regs.size ())
1096 data->arch_regs.emplace_back (
nullptr,
nullptr);
1098 num_regs = regno + 1;
1099 htab_remove_elt (reg_hash.get (), reg.get ());
1105 gdb_assert (data->arch_regs.size () == num_regs);
1110 for (
const tdesc_reg_up ® : feature->registers)
1111 if (htab_find (reg_hash.get (), reg.get ()) != NULL)
1113 data->arch_regs.emplace_back (reg.get (),
nullptr);
1128struct tdesc_feature *
1131 struct tdesc_feature *new_feature =
new tdesc_feature (
name);
1133 tdesc->
features.emplace_back (new_feature);
1156 const struct bfd_arch_info *compatible)
1161 if (compatible == NULL)
1165 if (compat->arch () == compatible)
1166 internal_error (_(
"Attempted to add duplicate "
1167 "compatible architecture \"%s\""),
1168 compatible->printable_name);
1171 (std::unique_ptr<tdesc_compatible_info>
1177 const char *key,
const char *
value)
1179 gdb_assert (key != NULL &&
value != NULL);
1182 internal_error (_(
"Attempted to add duplicate property \"%s\""), key);
1198 const struct bfd_arch_info *arch)
1244 _(
"The target description will be read from \"%s\".\n"),
1248 _(
"The target description will be "
1249 "read from the target.\n"));
1275 for (inp = filename, outp =
m_function; *inp !=
'\0'; inp++)
1278 else if (*inp ==
'-')
1280 else if (*inp ==
' ')
1288 "-*- buffer-read-only: t -*- vi"
1304 gdb_printf (
"#include \"target-descriptions.h\"\n");
1312 (
" target_desc_up result = allocate_target_description ();\n");
1317 (
" set_tdesc_architecture (result.get (), bfd_scan_arch (\"%s\"));\n",
1325 (
" set_tdesc_osabi (result.get (), osabi_from_tdesc_string (\"%s\"));\n",
1330 for (
const tdesc_compatible_info_up &compatible : e->
compatible)
1332 (
" tdesc_add_compatible (result.get (), bfd_scan_arch (\"%s\"));\n",
1333 compatible->arch ()->printable_name);
1339 gdb_printf (
" set_tdesc_property (result.get (), \"%s\", \"%s\");\n",
1340 prop.key.c_str (), prop.value.c_str ());
1342 gdb_printf (
" struct tdesc_feature *feature;\n");
1347 gdb_printf (
"\n feature = tdesc_create_feature (result.get (), \"%s\");\n",
1362 error (_(
"C output is not supported type \"%s\"."),
type->
name.c_str ());
1374 (
" element_type = tdesc_named_type (feature, \"%s\");\n",
1375 type->element_type->
name.c_str ());
1377 (
" tdesc_create_vector (feature, \"%s\", element_type, %d);\n",
1387 gdb_printf (
" tdesc_type_with_fields *type_with_fields;\n");
1393 case TDESC_TYPE_STRUCT:
1394 case TDESC_TYPE_FLAGS:
1395 if (
type->kind == TDESC_TYPE_STRUCT)
1398 (
" type_with_fields = tdesc_create_struct (feature, \"%s\");\n",
1400 if (
type->size != 0)
1402 (
" tdesc_set_struct_size (type_with_fields, %d);\n",
type->size);
1407 (
" type_with_fields = tdesc_create_flags (feature, \"%s\", %d);\n",
1412 const char *type_name;
1414 gdb_assert (
f.type != NULL);
1415 type_name =
f.type->name.c_str ();
1421 gdb_assert (
f.end != -1);
1422 if (
f.type->kind == TDESC_TYPE_BOOL)
1424 gdb_assert (
f.start ==
f.end);
1426 (
" tdesc_add_flag (type_with_fields, %d, \"%s\");\n",
1427 f.start,
f.name.c_str ());
1429 else if ((
type->size == 4 &&
f.type->kind == TDESC_TYPE_UINT32)
1431 &&
f.type->kind == TDESC_TYPE_UINT64))
1434 (
" tdesc_add_bitfield (type_with_fields, \"%s\", %d, %d);\n",
1435 f.name.c_str (),
f.start,
f.end);
1440 (
"tdesc_named_type (feature, \"%s\");\n",
1443 (
" tdesc_add_typed_bitfield (type_with_fields, \"%s\","
1444 " %d, %d, field_type);\n",
1445 f.name.c_str (),
f.start,
f.end);
1450 gdb_assert (
f.end == -1);
1451 gdb_assert (
type->kind == TDESC_TYPE_STRUCT);
1453 (
"tdesc_named_type (feature, \"%s\");\n", type_name);
1455 (
" tdesc_add_field (type_with_fields, \"%s\", field_type);\n",
1460 case TDESC_TYPE_UNION:
1462 (
" type_with_fields = tdesc_create_union (feature, \"%s\");\n",
1467 (
"tdesc_named_type (feature, \"%s\");\n",
f.type->name.c_str ());
1469 (
" tdesc_add_field (type_with_fields, \"%s\", field_type);\n",
1473 case TDESC_TYPE_ENUM:
1475 (
" type_with_fields = tdesc_create_enum (feature, \"%s\", %d);\n",
1479 (
" tdesc_add_enum_value (type_with_fields, %d, \"%s\");\n",
1480 f.start,
f.name.c_str ());
1483 error (_(
"C output is not supported type \"%s\"."),
type->
name.c_str ());
1489 void visit (
const tdesc_reg *reg)
override
1491 gdb_printf (
" tdesc_create_reg (feature, \"%s\", %ld, %d, ",
1492 reg->name.c_str (), reg->target_regnum,
1494 if (!reg->group.empty ())
1495 gdb_printf (
"\"%s\", ", reg->group.c_str ());
1498 gdb_printf (
"%d, \"%s\");\n", reg->bitsize, reg->type.c_str ());
1520 va_start (args, fmt);
1556 gdb_printf (
"#include \"gdbsupport/tdesc.h\"\n");
1567 auto pos =
name.find_first_of (
'.');
1570 std::replace (
name.begin (),
name.end (),
'/',
'_');
1571 std::replace (
name.begin (),
name.end (),
'-',
'_');
1575 gdb_printf (
"(struct target_desc *result, long regnum)\n");
1578 gdb_printf (
" struct tdesc_feature *feature;\n");
1581 (
"\n feature = tdesc_create_feature (result, \"%s\");\n",
1591 void visit (
const tdesc_reg *reg)
override
1621 gdb_printf (
"ERROR: \"regnum\" attribute %ld ",
1622 reg->target_regnum);
1623 gdb_printf (
"is not the largest number (%d).\n",
1625 error (_(
"\"regnum\" attribute %ld is not the largest number (%d)."),
1631 gdb_printf (
" regnum = %ld;\n", reg->target_regnum);
1635 gdb_printf (
" tdesc_create_reg (feature, \"%s\", regnum++, %d, ",
1636 reg->name.c_str (), reg->save_restore);
1637 if (!reg->group.empty ())
1638 gdb_printf (
"\"%s\", ", reg->group.c_str ());
1641 gdb_printf (
"%d, \"%s\");\n", reg->bitsize, reg->type.c_str ());
1658 std::string buffer (
"@");
1659 print_xml_feature v (&buffer);
1661 tdesc->
xmltarget = xstrdup (buffer.c_str ());
1682 N_(
"Print C description of just a single feature.")
1698 const char *filename;
1712 tdesc = tdesc_info->
tdesc;
1713 filename = tdesc_info->
filename.data ();
1723 error (_(
"There is no target description to print."));
1725 if (filename == NULL)
1726 filename =
"fetched from target";
1728 std::string filename_after_features (filename);
1729 auto loc = filename_after_features.rfind (
"/features/");
1731 if (
loc != std::string::npos)
1732 filename_after_features = filename_after_features.substr (
loc + 10);
1737 if (opts.single_feature)
1740 error (_(
"only target descriptions with 1 feature can be used "
1741 "with -single-feature option"));
1760 const char *text,
const char *word)
1793 error (_(
"There is no target description to print."));
1796 print_xml_feature v (&buf);
1812 std::unique_ptr<const target_desc>
tdesc;
1815static std::vector<xml_test_tdesc>
xml_tdesc;
1822record_xml_tdesc (
const char *xml_file,
const struct target_desc *tdesc)
1824 xml_tdesc.emplace_back (xml_file, std::unique_ptr<const target_desc> (tdesc));
1838 if (xml ==
nullptr || *xml !=
'@')
1840 gdb_printf (_(
"Could not convert description for %s to xml.\n"),
1847 if (tdesc_trans ==
nullptr)
1849 gdb_printf (_(
"Could not convert description for %s from xml.\n"),
1853 else if (*tdesc != *tdesc_trans)
1855 gdb_printf (_(
"Converted description for %s does not match.\n"),
1871 error (_(
"Missing dir name"));
1873 gdb::unique_xmalloc_ptr<char> dir1 (tilde_expand (dir));
1874 std::string feature_dir (dir1.get ());
1875 unsigned int failed = 0;
1879 std::string tdesc_xml = (feature_dir + SLASH_STRING + e.name);
1883 if (tdesc == NULL || *tdesc != *e.tdesc)
1885 gdb_printf ( _(
"Descriptions for %s do not match.\n"), e.name);
1892 gdb_printf (_(
"Tested %lu XML files, %d failed\n"),
1903 _(
"Set target description specific variables."),
1904 _(
"Show target description specific variables."),
1909Unset target description specific variables."),
1916Set the file to read for an XML target description."), _(
"\
1917Show the file to read for an XML target description."), _(
"\
1918When set, GDB will read the target description from a local\n\
1919file instead of querying the remote target."),
1925Unset the file to read for an XML target description.\n\
1926When unset, GDB will read the description from the target."),
1930 static std::string help_text
1932Print the current target description as a C source file.\n\
1933Usage: maintenance print c-tdesc [OPTION] [FILENAME]\n\
1938When FILENAME is not provided then print the current target\n\
1939description, otherwise an XML target description is read from\n\
1940FILENAME and printed as a C function.\n\
1942When '-single-feature' is used then the target description should\n\
1943contain a single feature and the generated C code will only create\n\
1944that feature within an already existing target_desc object."), grp);
1950Print the current target description as an XML file."),
1956Check equality of GDB target descriptions and XML created descriptions.\n\
1957Check the target descriptions created in GDB equal the descriptions\n\
1958created from XML files in the directory.\n\
1959The 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)
target_desc_info tdesc_info
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)
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_register_reggroup_p_ftype(struct gdbarch *gdbarch, int regnum, const struct reggroup *reggroup)
int gdbarch_short_bit(struct gdbarch *gdbarch)
int gdbarch_num_regs(struct gdbarch *gdbarch)
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)
struct type * gdbarch_register_type_ftype(struct gdbarch *gdbarch, int reg_nr)
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)
void set_gdbarch_num_regs(struct gdbarch *gdbarch, int num_regs)
int gdbarch_long_bit(struct gdbarch *gdbarch)
const char * gdbarch_register_name_ftype(struct gdbarch *gdbarch, int regnr)
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)
const struct floatformat * floatformats_bfloat16[BFD_ENDIAN_UNKNOWN]
const struct floatformat * floatformats_ieee_single[BFD_ENDIAN_UNKNOWN]
struct type * init_float_type(type_allocator &alloc, int bit, const char *name, const struct floatformat **floatformats, enum bfd_endian byte_order)
const struct builtin_type * builtin_type(struct gdbarch *gdbarch)
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]
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_bitsize(unsigned int bitsize)
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
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)
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)
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)