From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 115967 invoked by alias); 5 Dec 2016 22:34:23 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 115942 invoked by uid 89); 5 Dec 2016 22:34:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 05 Dec 2016 22:34:21 +0000 Received: from svr-orw-mbx-03.mgc.mentorg.com ([147.34.90.203]) by relay1.mentorg.com with esmtp id 1cE1pz-0004Jo-VX from Luis_Gustavo@mentor.com ; Mon, 05 Dec 2016 14:34:19 -0800 Received: from [172.30.7.171] (147.34.91.1) by svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Mon, 5 Dec 2016 14:34:17 -0800 Subject: Re: [PATCH] Remove unnecessary inferior lookup in inferior_command References: <20161205223216.5443-1-simon.marchi@ericsson.com> To: Simon Marchi , Reply-To: Luis Machado From: Luis Machado Message-ID: <2efbaa89-3259-ab1e-056a-37f9320e06d0@codesourcery.com> Date: Mon, 05 Dec 2016 22:34:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20161205223216.5443-1-simon.marchi@ericsson.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) To svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) X-IsSubscribed: yes X-SW-Source: 2016-12/txt/msg00145.txt.bz2 On 12/05/2016 04:32 PM, Simon Marchi wrote: > In the case where we switch to a non-running inferior, we do a > "find_inferior_id (num)", although we did the same call right before. We can > safely remove it. > > gdb/ChangeLog: > > * inferior.c (inferior_command): Remove duplicate > find_inferior_id call. > --- > gdb/inferior.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/gdb/inferior.c b/gdb/inferior.c > index 0abd2c058e..9fcdbd3b83 100644 > --- a/gdb/inferior.c > +++ b/gdb/inferior.c > @@ -763,9 +763,6 @@ inferior_command (char *args, int from_tty) > } > else > { > - struct inferior *inf; > - > - inf = find_inferior_id (num); > set_current_inferior (inf); > switch_to_thread (null_ptid); > set_current_program_space (inf->pspace); > Looks fairly obvious.