From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29807 invoked by alias); 28 Sep 2014 20:54:57 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 29797 invoked by uid 89); 28 Sep 2014 20:54:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-vc0-f170.google.com Received: from mail-vc0-f170.google.com (HELO mail-vc0-f170.google.com) (209.85.220.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sun, 28 Sep 2014 20:54:55 +0000 Received: by mail-vc0-f170.google.com with SMTP id hy10so414822vcb.15 for ; Sun, 28 Sep 2014 13:54:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=WIrigxpTc7dcmmtaaB0ENMyNLym17H9bDvRToHL5w8k=; b=B1oY9bimj7YHBNE7AHnd6dLkHZp9VM98UKGJlAA7U1ULSRpuH9ZjsOPpGi9yEcpLOO In+KlattaJ51kjOytz0GIxWh4nLEVRMH2MQnRDnW732z3CPyMOrcRZ1q8EVJPJwCMl6j +8uxxvjXNQgG7h1dsme4cR/hv/fHRZzV8AOq2uOx86+pMF+0b/2GnKEnQmhOAbxbB8W9 kzWaGqDhD6n4+f4Ta/R6mJ8ck2erwPv71XcNs6otaP0KjRip4mpEtldsItitD74YqPJD d6aFMswUPlJ6MfI8Siu2lWqjW4XXIs5eV4VKPiroJoj6qe5TFpNqJNHPTlf6RyukjPwn /C6g== X-Gm-Message-State: ALoCoQkN/EBA3zkQXqy4vrRv5/yj6z0kGrtEy4KO40cB08aoVX2wdevwzrGkchRTx8teimvWo0eX MIME-Version: 1.0 X-Received: by 10.221.66.194 with SMTP id xr2mr17035224vcb.27.1411937693443; Sun, 28 Sep 2014 13:54:53 -0700 (PDT) Received: by 10.52.181.65 with HTTP; Sun, 28 Sep 2014 13:54:53 -0700 (PDT) In-Reply-To: References: <1411593539-6507-1-git-send-email-simon.marchi@ericsson.com> <54242FBD.7030408@ericsson.com> Date: Sun, 28 Sep 2014 20:54:00 -0000 Message-ID: Subject: Re: [PATCH] Add call to prune_program_spaces in mi_cmd_remove_inferior From: Doug Evans To: Simon Marchi Cc: gdb-patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-09/txt/msg00813.txt.bz2 On Sun, Sep 28, 2014 at 1:16 PM, Doug Evans 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.