aboutsummaryrefslogtreecommitdiff
path: root/gdb/psympriv.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2016-11-21 16:26:20 -0700
committerTom Tromey <tom@tromey.com>2017-01-10 19:14:11 -0700
commitbef155c3e8a995fcdb1c2ba5aba012eb653d9f30 (patch)
tree50b429ebc20397db99dbb753e5ce9f72fe7e9fde /gdb/psympriv.h
parent192b62ce0b4bb5c61188f570e127a26d2c32f716 (diff)
downloadgdb-bef155c3e8a995fcdb1c2ba5aba012eb653d9f30.zip
gdb-bef155c3e8a995fcdb1c2ba5aba012eb653d9f30.tar.gz
gdb-bef155c3e8a995fcdb1c2ba5aba012eb653d9f30.tar.bz2
Introduce and use gdb::unlinker
This introduces a new class, gdb::unlinker, that unlinks a file in the destructor. The user of this class has the option to preserve the file instead, by calling the "keep" method. This patch then changes the spots in gdb that use unlink in a cleanup to use this class instead. In one spot I went ahead and removed all the cleanups from the function. This fixes one latent bug -- do_bfd_delete_cleanup could refer to freed memory, by decref'ing the BFD before using its filename. 2017-01-10 Tom Tromey <tom@tromey.com> * record-full.c (record_full_save_cleanups): Remove. (record_full_save): Use gdb::unlinker. * gcore.c (do_bfd_delete_cleanup): Remove. (gcore_command): Use gdb::unlinker, unique_xmalloc_ptr. Remove cleanups. * dwarf2read.c (unlink_if_set): Remove. (write_psymtabs_to_index): Use gdb::unlinker. * common/gdb_unlinker.h: New file.
Diffstat (limited to 'gdb/psympriv.h')
0 files changed, 0 insertions, 0 deletions