Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: John Baldwin <jhb@freebsd.org>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@polymtl.ca>,
	Sergio Durigan Junior <sergiodj@redhat.com>,
	Pedro Alves <palves@redhat.com>
Subject: Re: [PATCH] Introduce "gdb/configure.nat" (and delete  "gdb/config/*/*.mh" files)
Date: Tue, 02 May 2017 14:57:00 -0000	[thread overview]
Message-ID: <3544696.meYI8VJtXZ@ralph.baldwin.cx> (raw)
In-Reply-To: <f891a53a78673a2ca30f15f25130ef30@polymtl.ca>

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 
> > <http://www.gnu.org/licenses/>.
> > +
> > +# 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


  reply	other threads:[~2017-05-02 14:57 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-25 20:23 Sergio Durigan Junior
2017-04-25 21:08 ` John Baldwin
2017-05-01 18:45 ` Sergio Durigan Junior
2017-05-02  2:44 ` Simon Marchi
2017-05-02 14:57   ` John Baldwin [this message]
2017-05-02 17:01     ` Simon Marchi
2017-05-02 19:28   ` Sergio Durigan Junior
2017-05-02 20:16     ` Simon Marchi
2017-05-02 21:30       ` Pedro Alves
2017-05-02 22:17       ` Sergio Durigan Junior
2017-05-03  3:49 ` [PATCH v2 0/2] Introduce gdb/configure.nat Sergio Durigan Junior
2017-05-03  3:49   ` [PATCH v2 2/2] Rearrange gdb/configure.nat to make it simpler and less redundant Sergio Durigan Junior
2017-05-03 16:45     ` John Baldwin
2017-05-03 17:28       ` Sergio Durigan Junior
2017-05-04 16:34     ` Pedro Alves
2017-05-05  4:23       ` Sergio Durigan Junior
2017-05-03  3:49   ` [PATCH v2 1/2] Introduce "gdb/configure.nat" (and delete "gdb/config/*/*.mh" files) Sergio Durigan Junior
2017-05-04 16:16     ` Pedro Alves
2017-05-05  3:58       ` Sergio Durigan Junior
2017-05-05  9:41         ` Pedro Alves
2017-05-06 14:04           ` Sergio Durigan Junior
2017-05-17 14:03             ` Pedro Alves
2017-05-05  4:31 ` [PATCH v3 0/2] Introduce gdb/configure.nat Sergio Durigan Junior
2017-05-05  4:31   ` [PATCH v3 2/2] Rearrange gdb/configure.nat to make it simpler and less redundant Sergio Durigan Junior
2017-05-06 14:13     ` Sergio Durigan Junior
2017-05-05  4:32   ` [PATCH v3 1/2] Introduce "gdb/configure.nat" (and delete "gdb/config/*/*.mh" files) Sergio Durigan Junior
2017-05-05 16:35     ` Pedro Alves
2017-05-06 14:13       ` Sergio Durigan Junior
2017-05-17 13:22         ` Pedro Alves
2017-05-23 14:40           ` Sergio Durigan Junior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3544696.meYI8VJtXZ@ralph.baldwin.cx \
    --to=jhb@freebsd.org \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=sergiodj@redhat.com \
    --cc=simon.marchi@polymtl.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox