This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA/commit] Memory leak in on reading frame register
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Doug Evans <dje at google dot com>
- Cc: Pedro Alves <palves at redhat dot com>, gdb-patches <gdb-patches at sourceware dot org>, Jerome Guitton <guitton at adacore dot com>
- Date: Fri, 15 May 2015 17:03:49 -0700
- Subject: Re: [RFA/commit] Memory leak in on reading frame register
- Authentication-results: sourceware.org; auth=none
- References: <1431100524-7793-1-git-send-email-brobecker at adacore dot com> <55508A83 dot 3060605 at redhat dot com> <20150511205312 dot GE4767 at adacore dot com> <5551CB20 dot 4090104 at redhat dot com> <20150515155823 dot GL4767 at adacore dot com> <CADPb22TgSUX6zj9SGd_1cgfmHOnhr4i1ecDy7qozigDOG_1qCA at mail dot gmail dot com>
> > gdb/ChangeLog:
> >
> > * infrun.c (handle_inferior_event_1): Renames handle_inferior_event.
> > (handle_inferior_event): New function.
> >
> > Tested on x86_64-linux. No regression.
>
> Not that this has to be changed here, but I'm wondering why all value
> mark/frees aren't done via cleanups. I can imagine sometimes it's not,
> technically, necessary, and I can imagine there's some history/inertia
> here, but having two ways to do this (using a cleanup or not) leaves
> the reader having to wonder if using a cleanup was errantly skipped.
I guess it depends on whether you think you need the certainty of
the cleanup or not. I think both approaches are valid depending
on the context.
In this case, I asked myself that question, and I didn't see a real
need for it, since my thinking was that, if an exception occurs and
propagates through handle_inferior_event, then chances are it'll
propagate all the way, which would then lead to values being cleaned
up as well. So I went with the current pattern.
But I can change it to a cleanup if people prefer. I don't mind.
--
Joel