From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18320 invoked by alias); 4 Sep 2009 22:54:16 -0000 Received: (qmail 18309 invoked by uid 22791); 4 Sep 2009 22:54:15 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 04 Sep 2009 22:54:08 +0000 Received: from zps37.corp.google.com (zps37.corp.google.com [172.25.146.37]) by smtp-out.google.com with ESMTP id n84Ms4Mw022343 for ; Fri, 4 Sep 2009 23:54:05 +0100 Received: from yxe14 (yxe14.prod.google.com [10.190.2.14]) by zps37.corp.google.com with ESMTP id n84Ms2Gq031575 for ; Fri, 4 Sep 2009 15:54:02 -0700 Received: by yxe14 with SMTP id 14so3278244yxe.21 for ; Fri, 04 Sep 2009 15:54:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.150.213.18 with SMTP id l18mr18157215ybg.183.1252104841861; Fri, 04 Sep 2009 15:54:01 -0700 (PDT) In-Reply-To: References: Date: Fri, 04 Sep 2009 22:54:00 -0000 Message-ID: Subject: Re: TYPE_NAME memory management From: Doug Evans To: tromey@redhat.com Cc: Paul Pluzhnikov , gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-IsSubscribed: yes 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-09/txt/msg00096.txt.bz2 On Fri, Sep 4, 2009 at 3:41 PM, Tom Tromey wrote: > > My understanding is that in the past the rule was that if a type had an > objfile, then the type name could come directly from the debuginfo > (allocated on the objfile's obstack), because GDB made a guarantee about > the relative lifetimes of these objects. =A0In particular, types were > copied by preserve_one_value at a point where the string data was still > live. > > Why can't we maintain that guarantee for mmap'd debuginfo as well? Oh, we can. It's fairly straightforward. I just wanted to make sure I was on solid ground. > I realize that having a lot of lifetime dependencies can be tricky. > But, this one is fairly well established already. Thanks. > For objfile-less types, I suspect we ought to always malloc any > associated strings. =A0That will let us avoid memory leaks once the type > GC work is completed. =A0(Currently I don't think we ever free such > types.)