This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 5/9] New probe type: DTrace USDT probes.
- From: Sergio Durigan Junior <sergiodj at redhat dot com>
- To: jose dot marchesi at oracle dot com (Jose E. Marchesi)
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 10 Oct 2014 14:44:53 -0400
- Subject: Re: [PATCH 5/9] New probe type: DTrace USDT probes.
- Authentication-results: sourceware.org; auth=none
- References: <1411724905-31234-1-git-send-email-jose dot marchesi at oracle dot com> <1411724905-31234-6-git-send-email-jose dot marchesi at oracle dot com> <87y4syt5zn dot fsf at redhat dot com> <87iojrevbz dot fsf at oracle dot com> <87ppdz23p1 dot fsf at redhat dot com> <87lhondb4y dot fsf at oracle dot com>
On Friday, October 10 2014, Jose E. Marchesi wrote:
> > You should free the enablers VEC in the end of the function. You could
> > probably make a cleanup and call it later.
> >
> > Hmm, I don't see the need of doing a deep copy of the vector, nor I
> > remember why I felt it was necessary to do it when I wrote the original
> > code.
> >
> > I changed that to:
> >
> > /* Add the vector of enablers to this probe, if any. */
> > ret->enablers = enablers;
> >
> > But maybe(probably) I am missing something? :?
>
> Hm, right. But if you do that, you will have to adjust
> dtrace_probe_destroy, because it will be freeing the same 'enablers'
> over and over...
>
> Aaah, that was indeed the reason! A "DOF probe" translates into 0 or
> more gdb probes, and they all share the same vector of enablers.
>
> Maintaining a copy of the enablers per gdb probe makes it trivial to
> manage its memory. Otherwise we would need to keep track of which
> enabler vectors are shared by which gdb probes... argh!
>
> I will roll back to the deep copy approach :)
:-)
And then you need that cleanup I mentioned before :-P.
--
Sergio
GPG key ID: 0x65FC5E36
Please send encrypted e-mail if possible
http://sergiodj.net/