From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20428 invoked by alias); 10 Jul 2012 19:09:41 -0000 Received: (qmail 20419 invoked by uid 22791); 10 Jul 2012 19:09:40 -0000 X-SWARE-Spam-Status: No, hits=-6.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,TW_BJ,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 10 Jul 2012 19:09:26 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6AJ9NO4023281 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 10 Jul 2012 15:09:23 -0400 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q6AJ9L2h011575 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 10 Jul 2012 15:09:22 -0400 From: Tom Tromey To: Chris January Cc: gdb@sourceware.org Subject: Re: Multiple inferiors and memory consumption References: <4FFB3F86.2000109@codesourcery.com> <1341907434.2162.5.camel@gumtree> Date: Tue, 10 Jul 2012 19:09:00 -0000 In-Reply-To: <1341907434.2162.5.camel@gumtree> (Chris January's message of "Tue, 10 Jul 2012 09:03:54 +0100") Message-ID: <87a9z7h1r2.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2012-07/txt/msg00016.txt.bz2 >>>>> "Chris" == Chris January 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