This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2 2/2] Rearrange gdb/configure.nat to make it simpler and less redundant
- From: Sergio Durigan Junior <sergiodj at redhat dot com>
- To: John Baldwin <jhb at freebsd dot org>
- Cc: GDB Patches <gdb-patches at sourceware dot org>, Pedro Alves <palves at redhat dot com>, Simon Marchi <simon dot marchi at polymtl dot ca>
- Date: Wed, 03 May 2017 13:27:58 -0400
- Subject: Re: [PATCH v2 2/2] Rearrange gdb/configure.nat to make it simpler and less redundant
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=sergiodj at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 3F21680041
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3F21680041
- References: <20170425202309.15771-1-sergiodj@redhat.com> <20170503034931.4515-1-sergiodj@redhat.com> <20170503034931.4515-3-sergiodj@redhat.com> <13974428.RlsgoICUZ5@ralph.baldwin.cx>
On Wednesday, May 03 2017, John Baldwin wrote:
> On Tuesday, May 02, 2017 11:49:31 PM 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.
>
> Thanks. Just one minor nit that I see:
>
>> + fbsd)
>> + case ${gdb_host_cpu} in
>> + i386)
>> + # Host: FreeBSD/i386
>> + NATDEPFILES="${NATDEPFILES} x86-nat.o x86-dregs.o \
>> + x86-bsd-nat.o i386-bsd-nat.o i386-fbsd-nat.o bsd-kvm.o"
>> + NAT_FILE='nm-fbsd.h'
>> + ;;
>> + mips)
>> + # Host: FreeBSD/mips
>> + NATDEPFILES="${NATDEPFILES} mips-fbsd-nat.o"
>> + HAVE_NATIVE_GCORE_HOST=1
>
> This seems redundant as it is set in the "global" fbsd section?
You're right, John. Fixed in my local tree.
Thanks for the review,
--
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/