This is the mail archive of the
gdb-testers@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Introduce and use gdb::unlinker
- From: sergiodj+buildbot at sergiodj dot net
- To: gdb-testers at sourceware dot org
- Date: Thu, 12 Jan 2017 01:50:44 -0500
- Subject: [binutils-gdb] Introduce and use gdb::unlinker
- Authentication-results: sourceware.org; auth=none
*** TEST RESULTS FOR COMMIT bef155c3e8a995fcdb1c2ba5aba012eb653d9f30 ***
Author: Tom Tromey <tom@tromey.com>
Branch: master
Commit: bef155c3e8a995fcdb1c2ba5aba012eb653d9f30
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.
- Follow-Ups:
- Failures on Fedora-s390x-m64, branch master
- Failures on Fedora-x86_64-native-gdbserver-m32, branch master
- Failures on Fedora-x86_64-cc-with-index, branch master
- Failures on Fedora-x86_64-native-extended-gdbserver-m64, branch master
- Failures on Fedora-x86_64-native-extended-gdbserver-m32, branch master
- Failures on Fedora-i686, branch master
- Failures on Ubuntu-AArch64-native-gdbserver-m64, branch master
- Failures on Debian-s390x-native-extended-gdbserver-m64, branch master
- Failures on Debian-s390x-m64, branch master
- Failures on Fedora-ppc64be-native-extended-gdbserver-m64, branch master
- Failures on Fedora-ppc64be-cc-with-index, branch master