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.
This commit is contained in:
Pedro Alves 2011-01-25 09:49:59 +00:00
parent f30f86fa95
commit efc0eabd60
9 changed files with 111 additions and 71 deletions

View file

@ -197,6 +197,18 @@ void gdb_xml_use_dtd (struct gdb_xml_parser *parser, const char *dtd_name);
int gdb_xml_parse (struct gdb_xml_parser *parser, const char *buffer);
/* Parse a XML document. DOCUMENT is the data to parse, which should
be NUL-terminated. If non-NULL, use the compiled-in DTD named
DTD_NAME to drive the parsing.
The return value is 0 for success or -1 for error. It may throw,
but only if something unexpected goes wrong during parsing; parse
errors will be caught, warned about, and reported as failure. */
int gdb_xml_parse_quick (const char *name, const char *dtd_name,
const struct gdb_xml_element *elements,
const char *document, void *user_data);
/* Issue a debugging message from one of PARSER's handlers. */
void gdb_xml_debug (struct gdb_xml_parser *parser, const char *format, ...)