* opencl-lang.c (STRINGIFY): Rename to OCL_STRING.
[deliverable/binutils-gdb.git] / gdb / xml-tdesc.c
index 1d78cad33ccdf3ce43475e8e64caef5cafa431dd..7568a73ce58a6508b392d5440d8214084fa5674f 100644 (file)
@@ -1,6 +1,6 @@
 /* XML target description support for GDB.
 
-   Copyright (C) 2006, 2008, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 
    Contributed by CodeSourcery.
 
@@ -152,7 +152,6 @@ tdesc_start_target (struct gdb_xml_parser *parser,
                    const struct gdb_xml_element *element,
                    void *user_data, VEC(gdb_xml_value_s) *attributes)
 {
-  struct tdesc_parsing_data *data = user_data;
   char *version = VEC_index (gdb_xml_value_s, attributes, 0)->value;
 
   if (strcmp (version, "1.0") != 0)
@@ -262,6 +261,7 @@ tdesc_start_struct (struct gdb_xml_parser *parser,
     {
       int size = (int) * (ULONGEST *)
        VEC_index (gdb_xml_value_s, attributes, 1)->value;
+
       tdesc_set_struct_size (type, size);
       data->current_type_size = size;
     }
@@ -326,7 +326,8 @@ tdesc_start_field (struct gdb_xml_parser *parser,
                       field_name);
       if (data->current_type_size != 0)
        gdb_xml_error (parser,
-                      _("Explicitly sized type can not contain non-bitfield \"%s\""), 
+                      _("Explicitly sized type can not "
+                        "contain non-bitfield \"%s\""), 
                       field_name);
 
       field_type = tdesc_named_type (data->current_feature, field_type_id);
@@ -347,12 +348,14 @@ tdesc_start_field (struct gdb_xml_parser *parser,
        {
          if (data->current_type_size == 0)
            gdb_xml_error (parser,
-                          _("Implicitly sized type can not contain bitfield \"%s\""), 
+                          _("Implicitly sized type can "
+                            "not contain bitfield \"%s\""), 
                           field_name);
 
          if (end >= 64)
            gdb_xml_error (parser,
-                          _("Bitfield \"%s\" goes past 64 bits (unsupported)"),
+                          _("Bitfield \"%s\" goes past "
+                            "64 bits (unsupported)"),
                           field_name);
 
          /* Assume that the bit numbering in XML is "lsb-zero".  Most
@@ -364,7 +367,8 @@ tdesc_start_field (struct gdb_xml_parser *parser,
                           field_name);
 
          if (end >= data->current_type_size * TARGET_CHAR_BIT)
-           gdb_xml_error (parser, _("Bitfield \"%s\" does not fit in struct"));
+           gdb_xml_error (parser,
+                          _("Bitfield \"%s\" does not fit in struct"));
 
          tdesc_add_bitfield (t, field_name, start, end);
        }
@@ -501,7 +505,6 @@ tdesc_parse_xml (const char *document, xml_fetch_another fetcher,
                 void *fetcher_baton)
 {
   struct cleanup *back_to, *result_cleanup;
-  struct gdb_xml_parser *parser;
   struct tdesc_parsing_data data;
   struct tdesc_xml_cache *cache;
   char *expanded_text;
@@ -527,16 +530,14 @@ tdesc_parse_xml (const char *document, xml_fetch_another fetcher,
       }
 
   back_to = make_cleanup (null_cleanup, NULL);
-  parser = gdb_xml_create_parser_and_cleanup (_("target description"),
-                                             tdesc_elements, &data);
-  gdb_xml_use_dtd (parser, "gdb-target.dtd");
 
   memset (&data, 0, sizeof (struct tdesc_parsing_data));
   data.tdesc = allocate_target_description ();
   result_cleanup = make_cleanup_free_target_description (data.tdesc);
   make_cleanup (xfree, expanded_text);
 
-  if (gdb_xml_parse (parser, expanded_text) == 0)
+  if (gdb_xml_parse_quick (_("target description"), "gdb-target.dtd",
+                          tdesc_elements, expanded_text, &data) == 0)
     {
       /* Parsed successfully.  */
       struct tdesc_xml_cache new_cache;
This page took 0.027418 seconds and 4 git commands to generate.