+2018-03-30 Simon Marchi <simon.marchi@polymtl.ca>
+
+ * tdesc.h (struct target_desc) <features>: Change type to
+ std::vector<std::string>.
+ * tdesc.c (target_desc::~target_desc): Adjust to std::vector
+ changes.
+ (tdesc_get_features_xml): Likewise.
+ (tdesc_create_feature): Likewise.
+
2018-03-26 Alan Hayward <alan.hayward@arm.com>
* regcache.c (find_register_by_number): Return a ref.
xfree ((char *) arch);
xfree ((char *) osabi);
-
- char *f;
-
- for (i = 0; VEC_iterate (char_ptr, features, i, f); i++)
- xfree (f);
- VEC_free (char_ptr, features);
}
bool target_desc::operator== (const target_desc &other) const
{
/* Either .xmltarget or .features is not NULL. */
gdb_assert (tdesc->xmltarget != NULL
- || (tdesc->features != NULL
+ || (!tdesc->features.empty ()
&& tdesc->arch != NULL));
if (tdesc->xmltarget == NULL)
buffer += "</osabi>";
}
- char *xml;
- for (int i = 0; VEC_iterate (char_ptr, tdesc->features, i, xml); i++)
+ for (const std::string &xml : tdesc->features)
{
buffer += "<xi:include href=\"";
buffer += xml;
const char *xml)
{
#ifndef IN_PROCESS_AGENT
- VEC_safe_push (char_ptr, tdesc->features, xstrdup (xml));
+ tdesc->features.emplace_back (xml);
#endif
return tdesc;
}
const char *xmltarget = NULL;
/* XML features in this target description. */
- VEC (char_ptr) *features = NULL;
+ std::vector<std::string> features;
/* The value of <architecture> element in the XML, replying GDB. */
const char *arch = NULL;