This is the mail archive of the gdb@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: Multiple inferiors and memory consumption


>>>>> "Chris" == Chris January <chris.january@allinea.com> writes:

Chris> We ran across the same problem some time back. There is a comment in
Chris> objfiles.h:
Chris> FIXME:  There is a problem here if the objfile is reusable, and if
Chris>         multiple users are to be supported.  The problem is that the 

I think this refers to some ancient code that wrote out data to a file
and then later mmap'd it back in.  Search the archives for "mmalloc", I
think.

That code is long gone.  I see the comment is gone now too.

Chris> We have a patch that allows multiple programs_spaces to share the same
Chris> objfiles by moving the linked list entry into a new struct
Chris> objfile_instance.

Presumably this only works if the objfile is mapped at the same address
in each inferior.

I wouldn't mind your patch -- I think it is an improvement -- but I was
trying to make it so that sharing happened regardless of the mapping.
There's no deep reason this can't be done, it is just a gdb design
error.

Tom


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