Make sure terminal settings are restored before exiting
[deliverable/binutils-gdb.git] / gdb / solib-target.c
index fe807ad530c2f09a8fce5b91396abf6167de33e3..f14363a4d9812517f8aedb7dbd3e34315eb77817 100644 (file)
@@ -1,6 +1,6 @@
 /* Definitions for targets which report shared library events.
 
-   Copyright (C) 2007-2014 Free Software Foundation, Inc.
+   Copyright (C) 2007-2015 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -146,12 +146,18 @@ library_list_start_list (struct gdb_xml_parser *parser,
                         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 != NULL)
+    {
+      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.  */
@@ -210,7 +216,7 @@ static const struct gdb_xml_element library_list_children[] = {
 };
 
 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 }
 };
 
This page took 0.027939 seconds and 4 git commands to generate.