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 v4 11/11] RFC only: compile: Use also inferior munmap


On 05/03/2015 03:08 PM, Jan Kratochvil wrote:
> Hi,
> 
> currently inferior memory is allocated by inferior mmap() but it is never
> deallocated; despite the injected objfile incl. its symbols is freed.  This was
> intentional so that one can do for example:
> inferior:
> 	char *str = "foo";
> GDB:
> 	(gdb) compile code str = "bar";
> 
> I believe later patches will be needed to introduce full control over keeping
> vs. discarding the injected module as being discussed in:
> 	compile: objfiles lifetime UI
> 	https://sourceware.org/ml/gdb/2015-04/msg00051.html
> 	Message-ID: <20150429135735.GA16974@host1.jankratochvil.net>
> This patch at least introduces code which will be needed for the part/cases of
> really freeing all the resources of an injected module.
> 
> It is "RFC only" as given the patch as is it regresses GDB functionality.

I don't which parts of this would cause regressions; it's helpful
when an RFC points out what is known to be hacky or patch bits that are known
to need to change.  It's not obvious, at least to me.

That said, I skimmed it and it overall looks good.  The stop_registers
bits looked surprising.  My reaction was that I'd think that would be
something handled around save_infcall_suspend_state/restore_infcall_suspend_state,
though it's not clear to me.

Thanks,
Pedro Alves


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