This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/3] make_corefile_notes: have caller free returned memory
- From: Pedro Alves <palves at redhat dot com>
- To: Markus Metzger <markus dot t dot metzger at intel dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 04 Jun 2014 17:42:15 +0100
- Subject: Re: [PATCH 1/3] make_corefile_notes: have caller free returned memory
- Authentication-results: sourceware.org; auth=none
- References: <1400761183-21956-1-git-send-email-markus dot t dot metzger at intel dot com>
On 05/22/2014 01:19 PM, Markus Metzger wrote:
> The various make_corefile_notes implementations for gdbarch as well as target
> currently make an xfree cleanup on the data they return. This causes problems
> when trying to put a TRY_CATCH around the make_corefile_notes call.
Please clarify in the commit log / intro what these problems are.
I happen to know because you told me off list, but if you hadn't,
I'd have to ask. :-)
I suggest adding:
"Specifically, we get a stale cleanup error in restore_my_cleanups."
> Omit the make_cleanup and have the caller free the memory.
>
> 2014-05-22 Markus Metzger <markus.t.metzger@intel.com>
>
> * fbsd-nat.c (fbsd_make_corefile_notes): Remove make_cleanup call.
> * gcore.c (write_gcore_file): Free memory returned from
> make_corefile_notes.
> * linux-tdep.c (linux_make_corefile_notes): Remove make_cleanup call.
> * procfs.c (procfs_make_note_section): Remove make_cleanup call.
OK.
Thanks,
--
Pedro Alves