From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10182 invoked by alias); 1 Apr 2015 16:03:32 -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 10165 invoked by uid 89); 1 Apr 2015 16:03:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 01 Apr 2015 16:03:30 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 97CE9AD017 for ; Wed, 1 Apr 2015 16:03:29 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t31G3SYK005014; Wed, 1 Apr 2015 12:03:28 -0400 Message-ID: <551C16CF.60506@redhat.com> Date: Wed, 01 Apr 2015 16:03:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Gary Benson CC: gdb-patches@sourceware.org Subject: Re: [PATCH 5/9] Rearrange symfile_bfd_open References: <1426870087-32654-1-git-send-email-gbenson@redhat.com> <1426870087-32654-6-git-send-email-gbenson@redhat.com> <551BE0D9.9000902@redhat.com> <20150401155037.GA22176@blade.nx> In-Reply-To: <20150401155037.GA22176@blade.nx> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-04/txt/msg00062.txt.bz2 On 04/01/2015 04:50 PM, Gary Benson wrote: > Pedro Alves wrote: >> On 03/20/2015 04:48 PM, Gary Benson wrote: >>> symfile_bfd_open handles what were remote files as a special case. >>> Now that remote files are replaced with target the reverse is true >>> and the BFD opening, format checking and error printing code is >>> essentially duplicated. This commit rearranges symfile_bfd_open >>> to treat local files as a special case, removing the duplication. >> >> Where were they already done? Can you add a comment? > > They were done twice in the same function: > > if remote: > open bfd, check format, etc > return > local-specific stuff > open bfd, check format, etc > return > > I rearranged it to be like this: > > if local: > local-specific stuff > open bfd, check format, etc > return > > How about I change the commit message to this: > > symfile_bfd_open handled what were remote files as a special case. > Converting from "remote:" files to "target:" means the two cases > are now very similar and may be merged. This commit rearranges > symfile_bfd_open to remove the duplicated code. Ah, I see now. The pseudo code above helped me a lot too. I'd suggest putting in the commit log too. Patch is OK. Thanks, Pedro Alves