+2015-06-10 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * solib-target.c (library_list_start_list): Do not dereference
+ variable version in its initialization. Make the VERSION check handle
+ NULL.
+ (library_list_attributes): Make "version" GDB_XML_AF_OPTIONAL.
+
2015-06-10 Gary Benson <gbenson@redhat.com>
* NEWS: Announce support for direct access of executable and
+2015-06-10 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * server.c (handle_qxfer_libraries): Set `version' attribute for
+ <library-list>.
+
2015-06-10 Gary Benson <gbenson@redhat.com>
* target.h (struct target_ops) <multifs_open>: New field.
if (document == NULL)
return -1;
- strcpy (document, "<library-list>\n");
+ strcpy (document, "<library-list version=\"1.0\">\n");
p = document + strlen (document);
for_each_inferior_with_data (&all_dlls, emit_dll_description, &p);
const struct gdb_xml_element *element,
void *user_data, VEC(gdb_xml_value_s) *attributes)
{
- char *version = xml_find_attribute (attributes, "version")->value;
+ struct gdb_xml_value *version = xml_find_attribute (attributes, "version");
- if (strcmp (version, "1.0") != 0)
- gdb_xml_error (parser,
- _("Library list has unsupported version \"%s\""),
- version);
+ /* #FIXED attribute may be omitted, Expat returns NULL in such case. */
+ if (version)
+ {
+ const char *string = version->value;
+
+ if (strcmp (string, "1.0") != 0)
+ gdb_xml_error (parser,
+ _("Library list has unsupported version \"%s\""),
+ version);
+ }
}
/* Discard the constructed library list. */
};
static const struct gdb_xml_attribute library_list_attributes[] = {
- { "version", GDB_XML_AF_NONE, NULL, NULL },
+ { "version", GDB_XML_AF_OPTIONAL, NULL, NULL },
{ NULL, GDB_XML_AF_NONE, NULL, NULL }
};