From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26142 invoked by alias); 2 May 2017 14:57:04 -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 26126 invoked by uid 89); 2 May 2017 14:57:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_3,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy=Baldwin, baldwin, merit, HX-Greylist:0400 X-HELO: mail.baldwin.cx Received: from bigwig.baldwin.cx (HELO mail.baldwin.cx) (96.47.65.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 02 May 2017 14:57:00 +0000 Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id BDEFE10A7DB; Tue, 2 May 2017 10:56:59 -0400 (EDT) From: John Baldwin To: gdb-patches@sourceware.org Cc: Simon Marchi , Sergio Durigan Junior , Pedro Alves Subject: Re: [PATCH] Introduce "gdb/configure.nat" (and delete "gdb/config/*/*.mh" files) Date: Tue, 02 May 2017 14:57:00 -0000 Message-ID: <3544696.meYI8VJtXZ@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: References: <20170425202309.15771-1-sergiodj@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-IsSubscribed: yes X-SW-Source: 2017-05/txt/msg00013.txt.bz2 On Monday, May 01, 2017 10:44:39 PM Simon Marchi wrote: > > +++ b/gdb/configure.nat > > @@ -0,0 +1,591 @@ > > +# Copyright (C) 2013-2017 Free Software Foundation, Inc. > > +# > > +# This file is part of GDB. > > +# > > +# This program is free software; you can redistribute it and/or modify > > +# it under the terms of the GNU General Public License as published by > > +# the Free Software Foundation; either version 3 of the License, or > > +# (at your option) any later version. > > +# > > +# This program is distributed in the hope that it will be useful, > > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > > +# GNU General Public License for more details. > > +# > > +# You should have received a copy of the GNU General Public License > > +# along with this program. If not, see > > . > > + > > +# Variables defined here: > > +# > > +# NAT_FILE > > +# NATDEPFILES > > +# NAT_CDEPS > > +# LOADLIBES > > +# MH_CFLAGS > > +# XM_CLIBS > > +# NAT_GENERATED_FILES > > +# HAVE_NATIVE_GCORE_HOST > > +# NAT_EXTRA_FRAGS_FILE > > Could you document (if you know it) what each variable does? > > > +# - To avoid shell expansion of variables, declare them with single > > +# quotes. > > +# > > +# - NAT_EXTRA_FRAGS_FILE should contain the full path of the file. > > + > > +case ${gdb_host_cpu} in > > + aarch64) > > + case ${gdb_host} in > > + linux) > > + # Host: AArch64 based machine running GNU/Linux > > + NAT_FILE='config/nm-linux.h' > > + NATDEPFILES='inf-ptrace.o fork-child.o aarch64-linux-nat.o > > aarch32-linux-nat.o \ > > + proc-service.o linux-thread-db.o linux-nat.o linux-fork.o \ > > + linux-procfs.o linux-ptrace.o linux-osdata.o linux-waitpid.o \ > > + linux-personality.o linux-namespaces.o aarch64-linux-hw-point.o \ > > + aarch64-linux.o' > > IMO, the interest of having all of this in a single file is to be able > to factor out common things. A lot of NATDEPFILES are repeated Would it > be possible to have a switch on ${gdb_host} at the top level, and > specify all the files specific to OSes but machine-agnostic? For > example, fork-child.o and inf-ptrace.o probably appear in all the linux > ports. I had a similar thought about FreeBSD, FWIW. I wasn't sure if we wanted to wait for a followup to do that so that for this commit you could directly compare the old foo.mh file to a new clause in configure.nat as a way to check for any typos in case there is a regression reported in the future. You could perhaps include a second patch as a followup in a single series to add a host clause, but I think the intermediate step as its own commit has some merit. -- John Baldwin