This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Remove exit_inferior_num_silent
- From: Tom Tromey <tromey at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 3 Jul 2018 17:35:48 -0000
- Subject: [binutils-gdb] Remove exit_inferior_num_silent
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=057302ceb3b1c171afe9bfa24642af208a60b6e9
commit 057302ceb3b1c171afe9bfa24642af208a60b6e9
Author: Tom Tromey <tom@tromey.com>
Date: Mon Jul 2 09:20:40 2018 -0600
Remove exit_inferior_num_silent
The sole caller of exit_inferior_num_silent was getting the inferior's
number to then use the number to look up the inferior again. I think
it's better to simply not have exit_inferior_num_silent; any potential
callers that only have the inferior's number should probably be
converted to pass the inferior itself around instead.
Tested by the buildbot.
gdb/ChangeLog
2018-07-03 Tom Tromey <tom@tromey.com>
* infrun.c (follow_exec): Use exit_inferior_silent.
* inferior.c (exit_inferior_num_silent): Remove.
* inferior.h (exit_inferior_num_silent): Don't declare.
Diff:
---
gdb/ChangeLog | 6 ++++++
gdb/inferior.c | 8 --------
gdb/infrun.c | 2 +-
3 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 8ecf370..0841703 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2018-07-03 Tom Tromey <tom@tromey.com>
+ * infrun.c (follow_exec): Use exit_inferior_silent.
+ * inferior.c (exit_inferior_num_silent): Remove.
+ * inferior.h (exit_inferior_num_silent): Don't declare.
+
+2018-07-03 Tom Tromey <tom@tromey.com>
+
PR cli/23340:
* darwin-nat.c (darwin_attach_pid): Reset inferior and
inferior_ptid on error.
diff --git a/gdb/inferior.c b/gdb/inferior.c
index ab506f6..22beea5 100644
--- a/gdb/inferior.c
+++ b/gdb/inferior.c
@@ -250,14 +250,6 @@ exit_inferior_silent (inferior *inf)
exit_inferior_1 (inf, 1);
}
-void
-exit_inferior_num_silent (int num)
-{
- struct inferior *inf = find_inferior_id (num);
-
- exit_inferior_1 (inf, 1);
-}
-
/* See inferior.h. */
void
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 28a4391..2eb25c0 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -1190,7 +1190,7 @@ follow_exec (ptid_t ptid, char *exec_file_target)
/* Do exit processing for the original inferior before adding
the new inferior so we don't have two active inferiors with
the same ptid, which can confuse find_inferior_ptid. */
- exit_inferior_num_silent (current_inferior ()->num);
+ exit_inferior_silent (current_inferior ());
inf = add_inferior_with_spaces ();
inf->pid = pid;