Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: tromey@redhat.com
Cc: Paul Pluzhnikov <ppluzhnikov@google.com>, gdb@sourceware.org
Subject: Re: TYPE_NAME memory management
Date: Fri, 04 Sep 2009 22:54:00 -0000	[thread overview]
Message-ID: <e394668d0909041554iabaace3wea25a6cd3fa75ba9@mail.gmail.com> (raw)
In-Reply-To: <m37hwe8h8x.fsf@fleche.redhat.com>

On Fri, Sep 4, 2009 at 3:41 PM, Tom Tromey<tromey@redhat.com> 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.  In 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.  That will let us avoid memory leaks once the type
> GC work is completed.  (Currently I don't think we ever free such
> types.)


  reply	other threads:[~2009-09-04 22:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-04 21:18 Doug Evans
2009-09-04 22:42 ` Tom Tromey
2009-09-04 22:54   ` Doug Evans [this message]
2009-09-04 23:04     ` Joel Brobecker
2009-09-09 16:40   ` Doug Evans
2009-09-09 17:30     ` Paul Pluzhnikov
2009-09-09 17:38       ` Doug Evans
2009-09-09 17:46     ` Tom Tromey
2009-09-04 22:44 ` Joel Brobecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e394668d0909041554iabaace3wea25a6cd3fa75ba9@mail.gmail.com \
    --to=dje@google.com \
    --cc=gdb@sourceware.org \
    --cc=ppluzhnikov@google.com \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox