enum bfd_architecture bfd_architecture;
gdbarch_init_ftype *init;
gdbarch_dump_tdep_ftype *dump_tdep;
+ gdbarch_supports_arch_info_ftype *supports_arch_info;
struct gdbarch_list *arches;
struct gdbarch_registration *next;
};
internal_error (_("gdbarch_architecture_names: multi-arch unknown"));
do
{
- arches.push_back (ap->printable_name);
+ if (rego->supports_arch_info == nullptr
+ || rego->supports_arch_info (ap))
+ arches.push_back (ap->printable_name);
ap = ap->next;
}
while (ap != NULL);
void
gdbarch_register (enum bfd_architecture bfd_architecture,
gdbarch_init_ftype *init,
- gdbarch_dump_tdep_ftype *dump_tdep)
+ gdbarch_dump_tdep_ftype *dump_tdep,
+ gdbarch_supports_arch_info_ftype *supports_arch_info)
{
struct gdbarch_registration **curr;
const struct bfd_arch_info *bfd_arch_info;
(*curr)->bfd_architecture = bfd_architecture;
(*curr)->init = init;
(*curr)->dump_tdep = dump_tdep;
+ (*curr)->supports_arch_info = supports_arch_info;
(*curr)->arches = NULL;
(*curr)->next = NULL;
}
typedef struct gdbarch *(gdbarch_init_ftype) (struct gdbarch_info info, struct gdbarch_list *arches);
typedef void (gdbarch_dump_tdep_ftype) (struct gdbarch *gdbarch, struct ui_file *file);
+typedef bool (gdbarch_supports_arch_info_ftype) (const struct bfd_arch_info *);
extern void gdbarch_register (enum bfd_architecture architecture,
gdbarch_init_ftype *init,
- gdbarch_dump_tdep_ftype *dump_tdep = nullptr);
+ gdbarch_dump_tdep_ftype *dump_tdep = nullptr,
+ gdbarch_supports_arch_info_ftype *supports_arch_info = nullptr);
/* Return a vector of the valid architecture names. Since architectures are