This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/6] Call dummy_frame_dtor_ftype also from remove_dummy_frame
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 13 May 2015 15:52:30 +0200
- Subject: Re: [PATCH 2/6] Call dummy_frame_dtor_ftype also from remove_dummy_frame
- Authentication-results: sourceware.org; auth=none
- References: <20150508202119 dot 15830 dot 18218 dot stgit at host1 dot jankratochvil dot net> <20150508202128 dot 15830 dot 40142 dot stgit at host1 dot jankratochvil dot net> <55534A2E dot 5020608 at redhat dot com>
On Wed, 13 May 2015 14:57:18 +0200, Pedro Alves wrote:
> On 05/08/2015 09:21 PM, Jan Kratochvil wrote:
> > Hi,
> >
> > there was now a leak-like bug that if dummy_frame "disappeared" by
> > remove_dummy_frame then its destructor was not called. For example in the case
> > of 'compile code' dummy frames the injected objfile would never get freed after
> > some inferior longjmp out of the injected code.
>
> So the real fix here is this bit, right?
This fix was just a side-effect, the original goal of this patch was to add
'registers_valid'.
> > /* Arbitrary data that is passed to DTOR. */
> > @@ -96,6 +96,9 @@ remove_dummy_frame (struct dummy_frame **dummy_ptr)
> > {
> > struct dummy_frame *dummy = *dummy_ptr;
> >
> > + if (dummy->dtor != NULL)
> > + dummy->dtor (dummy->dtor_data, 0);
> > +
>
> I'm not seeing where registers_valid is used anywhere in this patch.
> Guess it'll be used in follow up patches.
Yes.
> (A clearer patch split would have added the missing dummy->dtor call
> in this patch, and left the registers_valid addition to a separate
> patch that needs that.)
I haven't found the fix too much significant to separate it into a new patch
part but you are right, it should have been separated.
Thanks,
Jan