This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 3/8] Introduce and use gdb::unlinker
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org
- Date: Fri, 2 Dec 2016 13:17:23 +0000
- Subject: Re: [RFA 3/8] Introduce and use gdb::unlinker
- Authentication-results: sourceware.org; auth=none
- References: <1480395946-10924-1-git-send-email-tom@tromey.com> <1480395946-10924-4-git-send-email-tom@tromey.com>
On 11/29/2016 05:05 AM, Tom Tromey wrote:
> 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.
Thanks.
>
> 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.
LGTM.
Thanks,
Pedro Alves