[binutils-gdb] Remove last traces of discard_all_inferiors

Pedro Alves palves@sourceware.org
Sun Jan 12 00:56:00 GMT 2020


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=4ec89149dd83efecea15300bf425c9988f4cd5c0

commit 4ec89149dd83efecea15300bf425c9988f4cd5c0
Author: Pedro Alves <palves@redhat.com>
Date:   Sun Jan 12 00:40:02 2020 +0000

    Remove last traces of discard_all_inferiors
    
    The multi-target patch should have removed all traces of
    discard_all_inferiors, but somehow one use stayed behind along with
    the definition of the function.
    
    discard_all_inferiors is bad now because it blindly exits inferiors of
    all target connections.  It's best to remove it.
    
    gdb/ChangeLog:
    2020-01-12  Pedro Alves  <palves@redhat.com>
    
    	* bsd-kvm.c (bsd_kvm_target::close): Call exit_inferior_silent
    	directly for the current inferior instead of
    	discard_all_inferiors.
    	(discard_all_inferiors): Delete.

Diff:
---
 gdb/ChangeLog  | 7 +++++++
 gdb/bsd-kvm.c  | 2 +-
 gdb/inferior.c | 7 -------
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 735c46b..9801149 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2020-01-12  Pedro Alves  <palves@redhat.com>
+
+	* bsd-kvm.c (bsd_kvm_target::close): Call exit_inferior_silent
+	directly for the current inferior instead of
+	discard_all_inferiors.
+	(discard_all_inferiors): Delete.
+
 2020-01-11  Tom Tromey  <tom@tromey.com>
 
 	* tui/tui-wingeneral.c (box_win): Check cli_styling.
diff --git a/gdb/bsd-kvm.c b/gdb/bsd-kvm.c
index f864ba8..b1b1fee 100644
--- a/gdb/bsd-kvm.c
+++ b/gdb/bsd-kvm.c
@@ -156,7 +156,7 @@ bsd_kvm_target::close ()
     }
 
   inferior_ptid = null_ptid;
-  discard_all_inferiors ();
+  exit_inferior_silent (current_inferior ());
 }
 
 static LONGEST
diff --git a/gdb/inferior.c b/gdb/inferior.c
index eb090df..c2e9da3 100644
--- a/gdb/inferior.c
+++ b/gdb/inferior.c
@@ -260,13 +260,6 @@ inferior_appeared (struct inferior *inf, int pid)
   gdb::observers::inferior_appeared.notify (inf);
 }
 
-void
-discard_all_inferiors (void)
-{
-  for (inferior *inf : all_non_exited_inferiors ())
-    exit_inferior_silent (inf);
-}
-
 struct inferior *
 find_inferior_id (int num)
 {



More information about the Gdb-cvs mailing list