This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA 3/8] Introduce and use gdb::unlinker


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]