summaryrefslogtreecommitdiff
path: root/gdb/xml-tdesc.c
diff options
context:
space:
mode:
authorPedro Alves <pedro@codesourcery.com>2011-01-25 09:49:58 +0000
committerPedro Alves <pedro@codesourcery.com>2011-01-25 09:49:58 +0000
commit5f6f9139e39b1e2b926f88b884f998b733053e5f (patch)
treee78b06a8817e966ad2dc59c6f3e8edaf46129825 /gdb/xml-tdesc.c
parentd1a96080833408808c09bdb6c9263b9abe27ac39 (diff)
downloadgdb-5f6f9139e39b1e2b926f88b884f998b733053e5f.tar.gz
Simplify XML parsing a bit.
* xml-support.h (gdb_xml_parse_quick): Declare. * xml-support.c (gdb_xml_create_parser_and_cleanup_1): Renamed from gdb_xml_create_parser_and_cleanup, and added `old_chain' parameter. (gdb_xml_create_parser_and_cleanup): Reimplement on top of gdb_xml_create_parser_and_cleanup_1. (gdb_xml_parse_quick): New. * memory-map.c (parse_memory_map): Use gdb_xml_parse_quick. * osdata.c (osdata_parse): Ditto. * remote.c (remote_threads_info): Ditto. * solib-target.c (solib_target_parse_libraries): Ditto. * xml-syscall.c (syscall_parse_xml): Ditto. * xml-tdesc.c (tdesc_parse_xml): Ditto.
Diffstat (limited to 'gdb/xml-tdesc.c')
-rw-r--r--gdb/xml-tdesc.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/gdb/xml-tdesc.c b/gdb/xml-tdesc.c
index f2e3bf12aa9..7568a73ce58 100644
--- a/gdb/xml-tdesc.c
+++ b/gdb/xml-tdesc.c
@@ -505,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;
@@ -531,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;