* printcmd.c (print_formatted): Use val_print_scalar_formatted
[deliverable/binutils-gdb.git] / gdb / solib-target.c
index b2d8bc488f8500f581a4ce4e5c437938af306a06..a3f598299de6046a4d6446026a7a9615a7d1974c 100644 (file)
@@ -1,6 +1,6 @@
 /* Definitions for targets which report shared library events.
 
-   Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -227,24 +227,20 @@ const struct gdb_xml_element library_list_elements[] = {
 static VEC(lm_info_p) *
 solib_target_parse_libraries (const char *library)
 {
-  struct gdb_xml_parser *parser;
   VEC(lm_info_p) *result = NULL;
-  struct cleanup *before_deleting_result, *back_to;
+  struct cleanup *back_to = make_cleanup (solib_target_free_library_list,
+                                         &result);
 
-  back_to = make_cleanup (null_cleanup, NULL);
-  parser = gdb_xml_create_parser_and_cleanup (_("target library list"),
-                                             library_list_elements, &result);
-  gdb_xml_use_dtd (parser, "library-list.dtd");
-
-  before_deleting_result = make_cleanup (solib_target_free_library_list,
-                                        &result);
-
-  if (gdb_xml_parse (parser, library) == 0)
-    /* Parsed successfully, don't need to delete the result.  */
-    discard_cleanups (before_deleting_result);
+  if (gdb_xml_parse_quick (_("target library list"), "library-list.dtd",
+                          library_list_elements, library, &result) == 0)
+    {
+      /* Parsed successfully, keep the result.  */
+      discard_cleanups (back_to);
+      return result;
+    }
 
   do_cleanups (back_to);
-  return result;
+  return NULL;
 }
 #endif
 
@@ -391,7 +387,8 @@ Could not relocate shared library \"%s\": wrong number of ALLOC sections"),
                      gdb_assert (so->addr_low <= so->addr_high);
                      found_range = 1;
                    }
-                 so->lm_info->offsets->offsets[i] = section_bases[bases_index];
+                 so->lm_info->offsets->offsets[i]
+                   = section_bases[bases_index];
                  bases_index++;
                }
              if (!found_range)
@@ -478,7 +475,8 @@ solib_target_in_dynsym_resolve_code (CORE_ADDR pc)
 
 struct target_so_ops solib_target_so_ops;
 
-extern initialize_file_ftype _initialize_solib_target; /* -Wmissing-prototypes */
+/* -Wmissing-prototypes */
+extern initialize_file_ftype _initialize_solib_target;
 
 void
 _initialize_solib_target (void)
This page took 0.023853 seconds and 4 git commands to generate.