diff options
Diffstat (limited to 'gdb/osdata.c')
-rw-r--r-- | gdb/osdata.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/gdb/osdata.c b/gdb/osdata.c index 9802b03..88190e2 100644 --- a/gdb/osdata.c +++ b/gdb/osdata.c @@ -168,23 +168,21 @@ const struct gdb_xml_element osdata_elements[] = { struct osdata * osdata_parse (const char *xml) { - struct gdb_xml_parser *parser; - struct cleanup *before_deleting_result, *back_to; + struct cleanup *back_to; struct osdata_parsing_data data = { NULL }; - back_to = make_cleanup (null_cleanup, NULL); - parser = gdb_xml_create_parser_and_cleanup (_("osdata"), - osdata_elements, &data); - gdb_xml_use_dtd (parser, "osdata.dtd"); + back_to = make_cleanup (clear_parsing_data, &data); - before_deleting_result = make_cleanup (clear_parsing_data, &data); - - if (gdb_xml_parse (parser, xml) == 0) - /* Parsed successfully, don't need to delete the result. */ - discard_cleanups (before_deleting_result); + if (gdb_xml_parse_quick (_("osdata"), "osdata.dtd", + osdata_elements, xml, &data) == 0) + { + /* Parsed successfully, don't need to delete the result. */ + discard_cleanups (back_to); + return data.osdata; + } do_cleanups (back_to); - return data.osdata; + return NULL; } #endif |