aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-05-17 00:04:53 -0600
committerTom Tromey <tom@tromey.com>2018-05-18 14:33:24 -0600
commit400174b12a46fffbfad7c2504c33bb3ac29f3ef9 (patch)
treec2d7292909fcce4148ef069f760fdbc42081a89e /gdb/dwarf2read.h
parent3063847f29cb83bae0cdf018c2dca68b65a50780 (diff)
downloadgdb-400174b12a46fffbfad7c2504c33bb3ac29f3ef9.zip
gdb-400174b12a46fffbfad7c2504c33bb3ac29f3ef9.tar.gz
gdb-400174b12a46fffbfad7c2504c33bb3ac29f3ef9.tar.bz2
Allocate dwp_file with new
This adds a constructor and initializer to dwp_file and changes it to be allocated with "new". This removes a bit of manual refcount management. Tested by the buildbot. gdb/ChangeLog 2018-05-18 Tom Tromey <tom@tromey.com> * dwarf2read.h (struct dwarf2_per_objfile) <dwp_file>: Now a unique_ptr. * dwarf2read.c (struct dwp_file): Add constructor and initializers. (open_and_init_dwp_file): Return a unique_ptr. (dwarf2_per_objfile, create_dwp_hash_table) (create_dwo_unit_in_dwp_v1, create_dwo_unit_in_dwp_v2) (lookup_dwo_unit_in_dwp): Update. (open_and_init_dwp_file, get_dwp_file): Update.
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 f36d039..1e0663b 100644
--- a/gdb/dwarf2read.h
+++ b/gdb/dwarf2read.h
@@ -194,7 +194,7 @@ public:
bool dwp_checked = false;
/* The DWP file if there is one, or NULL. */
- struct dwp_file *dwp_file = NULL;
+ std::unique_ptr<struct dwp_file> dwp_file;
/* The shared '.dwz' file, if one exists. This is used when the
original data was compressed using 'dwz -m'. */