aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-05-16 14:33:15 -0600
committerTom Tromey <tom@tromey.com>2018-05-18 15:12:14 -0600
commit7ff8cb8c51adec9cd1b461f9b670223d01223fef (patch)
treeb0e24ec7be79f9a49da4b24070eeb219666599c9 /gdb/dwarf2read.h
parent7f99954970001cfc1b155d877ac2966d77e2c647 (diff)
downloadgdb-7ff8cb8c51adec9cd1b461f9b670223d01223fef.zip
gdb-7ff8cb8c51adec9cd1b461f9b670223d01223fef.tar.gz
gdb-7ff8cb8c51adec9cd1b461f9b670223d01223fef.tar.bz2
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.
Diffstat (limited to 'gdb/dwarf2read.h')
-rw-r--r--gdb/dwarf2read.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/dwarf2read.h b/gdb/dwarf2read.h
index 1e0663b..fbac717 100644
--- a/gdb/dwarf2read.h
+++ b/gdb/dwarf2read.h
@@ -198,7 +198,7 @@ public:
/* The shared '.dwz' file, if one exists. This is used when the
original data was compressed using 'dwz -m'. */
- struct dwz_file *dwz_file = NULL;
+ std::unique_ptr<struct dwz_file> dwz_file;
/* A flag indicating whether this objfile has a section loaded at a
VMA of 0. */