public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: Simon Marchi <simon.marchi@ericsson.com>
Cc: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Add call to prune_program_spaces in mi_cmd_remove_inferior
Date: Sun, 28 Sep 2014 20:54:00 -0000	[thread overview]
Message-ID: <CADPb22QABcOsUr7oN-=tHSryTUWiDx1E0fAGxV0zpARiWd+mAA@mail.gmail.com> (raw)
In-Reply-To: <CADPb22RP0LH96jDz_BSGaDaGtkuyvLoS=p0A2BVN7KHNacnYJQ@mail.gmail.com>

On Sun, Sep 28, 2014 at 1:16 PM, Doug Evans <dje@google.com> wrote:
>[...]
> btw #2, There's also the invariant "There's always (at least) one
> program space."
> One is left with the question of whether they could be unrelated.
> IOW could there be an inferior without a program space or a program
> space without an inferior?
> [At least in general. There are special cases where we do temporary
> hacks to get through forks and such.]
> Another cleanup could be to make this clearer.

One thought I had, and I'm just thinking out loud here, is to rephrase
this invariant as "An inferior always has a program space."  Then,
given that there is always an inferior, it falls out that there will
also always be a program space.

But, at least to this reader, program spaces can't ever be thought of
as being created on their own, they are only created when an inferior
is created, and deleted when the last inferior using it is deleted.
That includes the initial program space, which leads to the thought of
merging the creation of the initial program space and initial
inferior.
Doing that feels clearer to me than initializing them separately,
given that we're going to be actively deleting program spaces when the
last-using inferior is deleted.

  reply	other threads:[~2014-09-28 20:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-24 21:19 Simon Marchi
2014-09-24 22:43 ` Doug Evans
2014-09-25 15:07   ` Simon Marchi
2014-09-28 20:16     ` Doug Evans
2014-09-28 20:54       ` Doug Evans [this message]
2014-09-29 17:48         ` Simon Marchi
2014-09-29 23:16           ` Doug Evans

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='CADPb22QABcOsUr7oN-=tHSryTUWiDx1E0fAGxV0zpARiWd+mAA@mail.gmail.com' \
    --to=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@ericsson.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).