From patchwork Tue Jul 3 15:53:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 28212 Received: (qmail 19606 invoked by alias); 3 Jul 2018 15:54:23 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 19590 invoked by uid 89); 3 Jul 2018 15:54:22 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: gateway23.websitewelcome.com Received: from gateway23.websitewelcome.com (HELO gateway23.websitewelcome.com) (192.185.50.119) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 03 Jul 2018 15:54:21 +0000 Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway23.websitewelcome.com (Postfix) with ESMTP id 92BB41A738 for ; Tue, 3 Jul 2018 10:54:18 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id aNcvf2zrBSjJAaNd5fXyVv; Tue, 03 Jul 2018 10:54:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version :Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=wz3AiVrz1yQdUsodJ6uwIzaLgLfXUpT8/caTDi5OGPc=; b=Rs8J3e5bky37uAvWuwCC0TIst1 hTes76AqC7uxw33YsC16eJYFQOqJs/0zD4MJsr1wL9UYsTblTzfUh2pNBhpecKlqGb7b++ThQpbc8 2oWfmRDgunM2OOcgfKwC45dHi; Received: from 75-166-85-72.hlrn.qwest.net ([75.166.85.72]:39250 helo=pokyo.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1faNcv-00439J-Ai; Tue, 03 Jul 2018 10:54:01 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA] Remove exit_inferior_num_silent Date: Tue, 3 Jul 2018 09:53:55 -0600 Message-Id: <20180703155355.23180-1-tom@tromey.com> 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 * 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 + + * 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 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;