This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 5/9] Rearrange symfile_bfd_open
- From: Gary Benson <gbenson at redhat dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 1 Apr 2015 16:50:37 +0100
- Subject: Re: [PATCH 5/9] Rearrange symfile_bfd_open
- Authentication-results: sourceware.org; auth=none
- References: <1426870087-32654-1-git-send-email-gbenson at redhat dot com> <1426870087-32654-6-git-send-email-gbenson at redhat dot com> <551BE0D9 dot 9000902 at redhat dot com>
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/