This is the mail archive of the gdb-testers@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] C++-ify gdb/xml-support.c a bit to eliminate cleanups


*** TEST RESULTS FOR COMMIT 010151c9146eb2a299686e41c714e57c344be8e8 ***

Author: Pedro Alves <palves@redhat.com>
Branch: master
Commit: 010151c9146eb2a299686e41c714e57c344be8e8

C++-ify gdb/xml-support.c a bit to eliminate cleanups

Basically convert cleanups to destructors in gdb_xml_parser and
xinclude_parsing_data, and then allocate objects of those types on the
stack.

More C++-ification is possible / will follow, but this removes a few
make_cleanup calls already.

gdb/ChangeLog:
2017-04-18  Pedro Alves  <palves@redhat.com>

	* xml-support.c (gdb_xml_parser): Add ctor/dtor.  Make is_xinclude
	a bool.
	(gdb_xml_end_element): Change type of first parameter.
	(gdb_xml_cleanup): Rename to ...
	(gdb_xml_parser::~gdb_xml_parser): ... this.
	(gdb_xml_create_parser_and_cleanup): Delete with ...
	(gdb_xml_parser::gdb_xml_parser): ... creation parts factored out
	to this new ctor.
	(gdb_xml_parse_quick): Create a local gdb_xml_parser instead of
	using gdb_xml_create_parser_and_cleanup.
	(xinclude_parsing_data): Add ctor/dtor.
	(xml_xinclude_cleanup): Delete.
	(xml_process_xincludes): Create a local xinclude_parsing_data
	instead of heap-allocating one.  Create a local gdb_xml_parser
	instead of heap-allocating one with
	gdb_xml_create_parser_and_cleanup.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]