[binutils-gdb] Allocate dwz_file with new

sergiodj+buildbot@sergiodj.net sergiodj+buildbot@sergiodj.net
Sat May 19 03:06:00 GMT 2018


*** TEST RESULTS FOR COMMIT 7ff8cb8c51adec9cd1b461f9b670223d01223fef ***

Author: Tom Tromey <tom@tromey.com>
Branch: master
Commit: 7ff8cb8c51adec9cd1b461f9b670223d01223fef

Allocate dwz_file with new

This adds a constructor to struct dwz_file and arranges for it to be
allocated with "new" and wrapped in a unique_ptr.  This cuts down on
the amount of manual memory management that must be done.

Regression tested by the buildbot.

gdb/ChangeLog
2018-05-18  Tom Tromey  <tom@tromey.com>

	* dwarf2read.c (struct dwz_file): Add constructor, initializers.
	<dwz_bfd>: Now a gdb_bfd_ref_ptr.
	(~dwarf2_per_objfile): Update
	(dwarf2_get_dwz_file): Use new.
	* dwarf2read.h (struct dwarf2_per_objfile) <dwz_file>: Now a
	unique_ptr.



More information about the Gdb-testers mailing list