From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 35060 invoked by alias); 1 Apr 2015 15:50:41 -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 34177 invoked by uid 89); 1 Apr 2015 15:50:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,SPF_HELO_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 15:50:40 +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 (8.14.4/8.14.4) with ESMTP id t31FocrS006771 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 1 Apr 2015 11:50:39 -0400 Received: from blade.nx (ovpn-116-118.ams2.redhat.com [10.36.116.118]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t31FobK7027509; Wed, 1 Apr 2015 11:50:38 -0400 Received: by blade.nx (Postfix, from userid 1000) id 325DE26410B; Wed, 1 Apr 2015 16:50:37 +0100 (BST) Date: Wed, 01 Apr 2015 15:50:00 -0000 From: Gary Benson To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 5/9] Rearrange symfile_bfd_open Message-ID: <20150401155037.GA22176@blade.nx> References: <1426870087-32654-1-git-send-email-gbenson@redhat.com> <1426870087-32654-6-git-send-email-gbenson@redhat.com> <551BE0D9.9000902@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <551BE0D9.9000902@redhat.com> X-IsSubscribed: yes X-SW-Source: 2015-04/txt/msg00060.txt.bz2 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. ? Cheers, Gary -- http://gbenson.net/