-/* Copyright (C) 2012-2018 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2020 Free Software Foundation, Inc.
This file is part of GDB.
return current_process ()->tdesc;
}
-/* See common/tdesc.h. */
+/* See gdbsupport/tdesc.h. */
const char *
tdesc_architecture_name (const struct target_desc *target_desc)
return target_desc->arch;
}
-/* See common/tdesc.h. */
+/* See gdbsupport/tdesc.h. */
void
set_tdesc_architecture (struct target_desc *target_desc,
target_desc->arch = xstrdup (name);
}
-/* See common/tdesc.h. */
+/* See gdbsupport/tdesc.h. */
const char *
tdesc_osabi_name (const struct target_desc *target_desc)
return target_desc->osabi;
}
-/* See common/tdesc.h. */
+/* See gdbsupport/tdesc.h. */
void
set_tdesc_osabi (struct target_desc *target_desc, const char *name)
target_desc->osabi = xstrdup (name);
}
-/* See common/tdesc.h. */
+/* See gdbsupport/tdesc.h. */
const char *
tdesc_get_features_xml (const target_desc *tdesc)
}
#endif
-/* See common/tdesc.h. */
+/* See gdbsupport/tdesc.h. */
struct tdesc_feature *
tdesc_create_feature (struct target_desc *tdesc, const char *name)
tdesc->features.emplace_back (new_feature);
return new_feature;
}
+
+/* See gdbsupport/tdesc.h. */
+
+bool
+tdesc_contains_feature (const target_desc *tdesc, const std::string &feature)
+{
+ gdb_assert (tdesc != nullptr);
+
+ for (const tdesc_feature_up &f : tdesc->features)
+ {
+ if (f->name == feature)
+ return true;
+ }
+
+ return false;
+}