From efc0eabd6019406ff92286a36713d41a42515e09 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Tue, 25 Jan 2011 09:49:59 +0000 Subject: 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. --- gdb/xml-syscall.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'gdb/xml-syscall.c') diff --git a/gdb/xml-syscall.c b/gdb/xml-syscall.c index 7676c2c..271b240 100644 --- a/gdb/xml-syscall.c +++ b/gdb/xml-syscall.c @@ -224,17 +224,13 @@ syscall_parse_xml (const char *document, xml_fetch_another fetcher, void *fetcher_baton) { struct cleanup *result_cleanup; - struct gdb_xml_parser *parser; struct syscall_parsing_data data; - parser = gdb_xml_create_parser_and_cleanup (_("syscalls info"), - syselements, &data); - - memset (&data, 0, sizeof (struct syscall_parsing_data)); data.sysinfo = allocate_syscalls_info (); result_cleanup = make_cleanup_free_syscalls_info (data.sysinfo); - if (gdb_xml_parse (parser, document) == 0) + if (gdb_xml_parse_quick (_("syscalls info"), NULL, + syselements, document, &data) == 0) { /* Parsed successfully. */ discard_cleanups (result_cleanup); -- cgit v1.1