From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [RFA] Remove exit_inferior_num_silent
Date: Tue, 03 Jul 2018 15:54:00 -0000 [thread overview]
Message-ID: <20180703155355.23180-1-tom@tromey.com> (raw)
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.
---
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 8ecf370e599..0841703435f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+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:
diff --git a/gdb/inferior.c b/gdb/inferior.c
index ab506f6aec5..22beea58a0c 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 28a4391c358..2eb25c03cda 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;
--
2.17.1
next reply other threads:[~2018-07-03 15:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-03 15:54 Tom Tromey [this message]
2018-07-03 16:44 ` Pedro Alves
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=20180703155355.23180-1-tom@tromey.com \
--to=tom@tromey.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