From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27811 invoked by alias); 2 Mar 2014 21:23:31 -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 27791 invoked by uid 89); 2 Mar 2014 21:23:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-pd0-f173.google.com Received: from mail-pd0-f173.google.com (HELO mail-pd0-f173.google.com) (209.85.192.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sun, 02 Mar 2014 21:23:29 +0000 Received: by mail-pd0-f173.google.com with SMTP id z10so2890167pdj.18 for ; Sun, 02 Mar 2014 13:23:27 -0800 (PST) X-Received: by 10.68.224.195 with SMTP id re3mr15836166pbc.93.1393795407812; Sun, 02 Mar 2014 13:23:27 -0800 (PST) Received: from seba.sebabeach.org.gmail.com (173-13-178-53-sfba.hfc.comcastbusiness.net. [173.13.178.53]) by mx.google.com with ESMTPSA id fk4sm69332742pab.23.2014.03.02.13.23.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Mar 2014 13:23:27 -0800 (PST) From: Doug Evans To: gdb-patches@sourceware.org Subject: [PATCH] Prune program spaces in remove-inferiors Date: Sun, 02 Mar 2014 21:23:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2014-03/txt/msg00024.txt.bz2 Hi. While writing a test for Guile program space support I found that after I removed an inferior I would still see it show up in the progspaces list. And then if I did "mt info program-spaces" it would then go away. While info commands shouldn't in general exhibit side effects like this, I'm not too worried here (*1). But I think remove-inferiors should call prune_program_spaces. Is there a reason for it to not to? Regression tested on amd64-linux. 2014-03-02 Doug Evans * inferior.c (prune_inferiors): Fix comment. (remove_inferior_command): Call prune_program_spaces. diff --git a/gdb/inferior.c b/gdb/inferior.c index 90d9649..23da0c7 100644 --- a/gdb/inferior.c +++ b/gdb/inferior.c @@ -475,8 +475,8 @@ have_live_inferiors (void) return inf != NULL; } -/* Prune away automatically added program spaces that aren't required - anymore. */ +/* Prune away any unused inferiors, and then prune away no longer used + program spaces. */ void prune_inferiors (void) @@ -788,6 +788,8 @@ remove_inferior_command (char *args, int from_tty) delete_inferior_1 (inf, 1); } + + prune_program_spaces (); } struct inferior * --- (*1): For reference sake, "info threads" is a more serious case of this when debugging remotely, ref: "Finding new threads in the inferior" in https://sourceware.org/gdb/wiki/LocalRemoteFeatureParity