This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH] C++ patches
Kevin Buettner <kevinb@cygnus.com> writes:
> On Sep 6, 9:35pm, Daniel Berlin wrote:
>
> > I've rerun indent on the files this affects, because the formatting has
> > gotten way out of whack with the GNU standards.
> > I hope nobody minds, if somebody does, i'll undo the whitespace changes in
> > my patch
> > (diff -c3pwBb, remove the unbreaking of lines it did).
>
> I think the generally agreed upon practice is to do two separate
> commits; the first being the actual changes you made and the second
> being the reformatting. This way it's easier to review the first
> patch.
Works for me, i'll split it into two patches.
>
> > Please note we now have one memory leak in lookup_symbol. The demangler
> > gives us a buffer we never free. I'd need to free it at every exit point
> > from the function, of which we have 12 right now, all of which end almost
> > the exact same way (most return fixup_symbol_section(sym), a few just
> > return sym. Is this incorrect?).
> >
> > I'm thinking that i'll change it so we just have a label at the end, and
> > 12 gotos, rather than 12 exit points, and do the cleanup of the
> > buffer there.
> > It would make it about 50x easier for someone who needed to do something
> > that requires cleanup when we exit.
>
> I think gotos in this case are preferable.
Okeydokey.