This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 5/9] Rearrange symfile_bfd_open


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]