Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Doug Evans <xdje42@gmail.com>
To: gdb-patches@sourceware.org
Subject: [PATCH] Prune program spaces in remove-inferiors
Date: Sun, 02 Mar 2014 21:23:00 -0000	[thread overview]
Message-ID: <m34n3guwfv.fsf@sspiff.org> (raw)

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  <xdje42@gmail.com>

	* 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


             reply	other threads:[~2014-03-02 21:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-02 21:23 Doug Evans [this message]
2014-03-03 13:49 ` Pedro Alves
2014-05-17 19:00   ` Doug Evans
2014-05-19 21:08 ` Tom Tromey
2014-05-19 21:23   ` 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=m34n3guwfv.fsf@sspiff.org \
    --to=xdje42@gmail.com \
    --cc=gdb-patches@sourceware.org \
    /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