From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4333 invoked by alias); 21 Aug 2009 17:30:09 -0000 Received: (qmail 4320 invoked by uid 22791); 21 Aug 2009 17:30:07 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS 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; Fri, 21 Aug 2009 17:29:58 +0000 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n7LHTrg3027831; Fri, 21 Aug 2009 13:29:53 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7LHTqUN003421; Fri, 21 Aug 2009 13:29:53 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n7LHTp1A000488; Fri, 21 Aug 2009 13:29:52 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 76A833782EF; Fri, 21 Aug 2009 11:29:51 -0600 (MDT) From: Tom Tromey To: Paul Pluzhnikov Cc: gdb@sourceware.org Subject: Re: Solibs and objfile BFD ownership References: <20090728154001.GA19451@caradoc.them.org> <8ac60eac0907291656v13f568ebw4f3a2b9bb7c7223d@mail.gmail.com> <8ac60eac0908031749y59867374wa451d2f504483390@mail.gmail.com> <20090804145318.GA31664@caradoc.them.org> <8ac60eac0908041037q46b447d9n7b539ab53d7ce1ea@mail.gmail.com> <20090804184000.GA14873@caradoc.them.org> <8ac60eac0908041147m17f3f337g3ea15696dc0a3170@mail.gmail.com> <8ac60eac0908171544r6d1eac67lcaedb388b525c5@mail.gmail.com> <8ac60eac0908191656o6c7c876cp503a3b6973ea090b@mail.gmail.com> Reply-To: tromey@redhat.com Date: Fri, 21 Aug 2009 17:32:00 -0000 In-Reply-To: <8ac60eac0908191656o6c7c876cp503a3b6973ea090b@mail.gmail.com> (Paul Pluzhnikov's message of "Wed, 19 Aug 2009 16:56:42 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2009-08/txt/msg00210.txt.bz2 >>>>> "Paul" == Paul Pluzhnikov writes: Paul> It would be slightly wasteful to set refcount to 1 everywhere, Paul> since solib is the only place where sharing could (currently) Paul> occur. Yeah, I suppose. But it seems clearer and more future-proof to me. Paul> 2009-08-19 Paul Pluzhnikov Paul> * objfiles.h (gdb_bfd_ref): New prototype. Paul> * objfiles.c (gdb_bfd_ref): New function. Paul> (allocate_objfile): Call it. Paul> (gdb_bfd_unref): Adjust assertion. Paul> * solib.c (solib_map_sections): Add reference. Paul> (symbol_add_stub): Don't add reference here. Paul> * symfile.c (reread_symbols): Add reference. This is ok. Thanks. Paul> + gdb_assert (*p_refcount == 1 || *p_refcount == 2); This assertion is a bit strange, but I suppose it is harmless. If we ever want more sharing, we can always just remove it. In the meantime I suppose it is checking that we don't over-share somehow. Tom