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: [PATCH 2/6] Call dummy_frame_dtor_ftype also from remove_dummy_frame


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


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