Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Yao Qi <yao@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Fix ada inferior-data cleanup
Date: Mon, 28 Oct 2013 14:27:00 -0000	[thread overview]
Message-ID: <526E7435.2030801@redhat.com> (raw)
In-Reply-To: <526E5702.8070104@codesourcery.com>

On 10/28/2013 12:22 PM, Yao Qi wrote:
> On 10/28/2013 07:27 PM, Pedro Alves wrote:
>>> 'struct ada_inferior_data' is registered to per-inferior-data with
>>>> cleanup ada_inferior_data_cleanup, which means the data will be
>>>> destroyed when the inferior exits.
>> That's not correct.  The registry data cleanups are only ran when
>> the inferior object is destroyed, IOW, when the inferior is
>> removed/deleted (e.g, with "remove-inferiors"), not when the program
>> exits.
>>
> 
> Is it a good idea to call clear_inferior_data when inferior exists (in 
> exit_inferior_1)?

IMO, it's not, for it confuses two different lifetimes.  It's quite
plausible to have data associated with the inferior object that should
be preserved across runs.

> These inferior_exit observer functions are duplicated to
> inferior_data_cleanup functions.  WDYT?

There's really no reason for the code to be duplicated.  For each
case, a helper that does the real work can be called from
wherever necessary, for instance.

-- 
Pedro Alves


      reply	other threads:[~2013-10-28 14:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-26  3:58 Yao Qi
2013-10-28  3:43 ` Joel Brobecker
2013-10-28 12:06   ` Yao Qi
2013-10-28 11:28 ` Pedro Alves
2013-10-28 12:24   ` Yao Qi
2013-10-28 14:27     ` Pedro Alves [this message]

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=526E7435.2030801@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=yao@codesourcery.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