Allocate dwz_file with new
authorTom Tromey <tom@tromey.com>
Wed, 16 May 2018 20:33:15 +0000 (14:33 -0600)
committerTom Tromey <tom@tromey.com>
Fri, 18 May 2018 21:12:14 +0000 (15:12 -0600)
commit7ff8cb8c51adec9cd1b461f9b670223d01223fef
treeb0e24ec7be79f9a49da4b24070eeb219666599c9
parent7f99954970001cfc1b155d877ac2966d77e2c647
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.
gdb/ChangeLog
gdb/dwarf2read.c
gdb/dwarf2read.h
This page took 0.025101 seconds and 4 git commands to generate.