This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] Alternate approach to keeping convenience variables
On Wed, Jan 04, 2006 at 10:37:06AM -0800, Jim Blandy wrote:
> On 1/4/06, Andrew STUBBS <andrew.stubbs@st.com> wrote:
> > Perhaps you could modify copy_type_recursive such that it creates a
> > cleanup chain specific to the internal variable. Then call do cleanups
> > in set_internal_var.
> >
> > Might be tricky with shared type copies though. Just a thought.
>
> Exactly.
>
> You can keep throwing complexity into the code to deal with this stuff
> until it buries you. And it'll never be a full solution. Or it'll be
> complete until someone wants to add some perfectly reasonable feature
> (just as is happening with "let's preserve the values of convenience
> variables across symfile loads" right now). At some point, we have to
> take a step back and think about a complete solution.
Right. For now, I'm OK with saying "this is a small memory leak when
symbol files are unloaded". If someone wants to investigate adding
boehm-gc to GDB and using that, instead, then I'm OK with that too :-)
Every once in a while I do get the urge to go through GDB with a
leak checker. But not often enough to jump through huge, rarely tested
hoops for that case.
--
Daniel Jacobowitz
CodeSourcery