Re: [PATCH v2 2/2] Rearrange gdb/configure.nat to make it simpler and less redundant

Sergio Durigan Junior
2017-05-05T04:23:01Z

On Thursday, May 04 2017, Pedro Alves wrote:

> On 05/03/2017 04:49 AM, Sergio Durigan Junior wrote:
>> The previous commit introduced gdb/configure.nat, but it was just a
>> copy-and-past (with the necessary adjustments) from the files under
>> gdb/config/. We can do better than that.
>>
>> Instead of using one big 'case' statement that matches the
>> ${gdb_host_cpu} and then match each ${gdb_host}, it is possible to
>> remove a lof of redundancy by matching the most common ${gdb_host}'s
>> first, setting the common variables for each, and then proceed to
>> matching specific ${gdb_host}'s and ${gdb_host_cpu}'s. In other
>> words, reverse the order of the 'case's and take advantage of the fact
>> that a lot of parameters are the same for each host.
>>
>> This commit was tested on x86_64 without regressions.
>>
>> yyyy-mm-dd Sergio Durigan Junior <sergiodj@redhat.com>
>>
>> * configure.nat: Rearrange 'case' statements to make the code
>> simpler and less redundant.
>
> Should probably say instead:
>
> * configure.nat: Rearrange 'case' statements to match
> host before cpu.
>
> This one's OK with that and with the nit John pointed out fixed.

Thanks, I updated the ChangeLog entry accordingly.

> Please make sure that a build that _doesn't_ include the
> native target still builds before pushing.

Tested compiling with --enable-targets=aarch64-unknown-linux and it
worked as expected.

Thanks,

--
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible