Multiple inferiors and memory consumption

Tom Tromey tromey@redhat.com
Tue Jul 10 19:09:00 GMT 2012


>>>>> "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



More information about the Gdb mailing list