From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15422 invoked by alias); 18 Jan 2002 21:56:29 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 15389 invoked from network); 18 Jan 2002 21:56:27 -0000 Received: from unknown (HELO localhost.cygnus.com) (216.138.202.10) by sources.redhat.com with SMTP; 18 Jan 2002 21:56:27 -0000 Received: from cygnus.com (localhost [127.0.0.1]) by localhost.cygnus.com (Postfix) with ESMTP id E51583D29; Fri, 18 Jan 2002 16:56:26 -0500 (EST) Message-ID: <3C489A0A.9060904@cygnus.com> Date: Fri, 18 Jan 2002 13:56:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:0.9.7) Gecko/20020103 X-Accept-Language: en-us MIME-Version: 1.0 To: Andrew Cagney Cc: gdb-patches@sources.redhat.com, mrg@redhat.com Subject: Re: [patch/rfc] Don't assume the host References: <3C45053B.9060900@cygnus.com> Content-Type: multipart/mixed; boundary="------------070601040304030403020308" X-SW-Source: 2002-01/txt/msg00517.txt.bz2 This is a multi-part message in MIME format. --------------070601040304030403020308 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 722 Hello, > Hello, > > The attached patch should fix a problem Matthew Green reported with GDB insisting on needing to know the host. > > It tweeks things to only insist on a *.mh file when a native configuration. > > On potential problem - if there isn't a .mh file, it uses /dev/null. Not sure how robust that is. > > Andrew the attached is a revised patch. The configure.in change is the same but this time it includes updates to gdbint.texinfo (Eli?). One thing I noticed in tweeking the doco is that there is a mysterious but almost useless chapter ``Porting GDB''. The information that chapter provides is also present elsewhere in a more complete form. I'll put that down on my todo list. enjoy, Andrew --------------070601040304030403020308 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 7351 2002-01-18 Andrew Cagney * configure.in (host_makefile_frag): Only require a host makefile fragment when a native build. * configure: Re-generate. Index: doc/ChangeLog 2002-01-18 Andrew Cagney * gdbint.texinfo (Host Definition): Revise. xm-xyz.h and xyz.mh are no longer needed. (Porting GDB): Add maintainer note about configure.host. Index: configure.in =================================================================== RCS file: /cvs/src/src/gdb/configure.in,v retrieving revision 1.78 diff -p -r1.78 configure.in *** configure.in 2002/01/05 22:06:38 1.78 --- configure.in 2002/01/18 21:50:53 *************** AC_SUBST(target_subdir) *** 1203,1209 **** frags= host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh if test ! -f ${host_makefile_frag}; then ! AC_MSG_ERROR("*** Gdb does not support host ${host}") fi frags="$frags $host_makefile_frag" --- 1203,1216 ---- frags= host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh if test ! -f ${host_makefile_frag}; then ! # When building a native debuger the .mh file containing things ! # like NATDEPFILES is needed. Cross debuggers don't need .mh ! # since it no longer contains anything useful. ! if test "${target}" = "${host}"; then ! AC_MSG_ERROR("*** Gdb does not support native host ${host}") ! else ! host_makefile_frag=/dev/null ! fi fi frags="$frags $host_makefile_frag" Index: doc/gdbint.texinfo =================================================================== RCS file: /cvs/src/src/gdb/doc/gdbint.texinfo,v retrieving revision 1.56 diff -p -r1.56 gdbint.texinfo *** gdbint.texinfo 2002/01/18 04:51:10 1.56 --- gdbint.texinfo 2002/01/18 21:51:04 *************** distribution! *** 2020,2057 **** @chapter Host Definition - @emph{Maintainer's note: In theory, new targets no longer need to use - the host framework described below. Instead it should be possible to - handle everything using autoconf. Patches eliminating this framework - welcome.} - With the advent of Autoconf, it's rarely necessary to have host ! definition machinery anymore. @section Adding a New Host @cindex adding a new host @cindex host, adding ! Most of @value{GDBN}'s host configuration support happens via ! Autoconf. New host-specific definitions should be rarely needed. ! @value{GDBN} still uses the host-specific definitions and files listed ! below, but these mostly exist for historical reasons, and should eventually disappear. - Several files control @value{GDBN}'s configuration for host systems: - @table @file @item gdb/config/@var{arch}/@var{xyz}.mh ! Specifies Makefile fragments needed when hosting on machine @var{xyz}. ! Optionally specifies the header file which describes host @var{xyz}, by ! defining @code{XM_FILE= xm-@var{xyz}.h}. You can also define @code{CC}, @code{SYSV_DEFINE}, @code{XM_CFLAGS}, @code{XM_ADD_FILES}, @code{XM_CLIBS}, @code{XM_CDEPS}, etc.; see @file{Makefile.in}. @item gdb/config/@var{arch}/xm-@var{xyz}.h ! (@file{xm.h} is a link to this file, created by @code{configure}). Contains C ! macro definitions describing the host system environment, such as byte ! order, host C compiler and library. @end table --- 2020,2063 ---- @chapter Host Definition With the advent of Autoconf, it's rarely necessary to have host ! definition machinery anymore. The following information is provided, ! mainly, as an historical reference. @section Adding a New Host @cindex adding a new host @cindex host, adding ! @value{GDBN}'s host configuration support normally happens via Autoconf. ! New host-specific definitions should not be needed. Older hosts ! @value{GDBN} still use the host-specific definitions and files listed ! below, but these mostly exist for historical reasons, and will eventually disappear. @table @file @item gdb/config/@var{arch}/@var{xyz}.mh ! This file once contained both host and native configuration information ! (@pxref{Native Debugging}) for the machine @var{xyz}. The host ! configuration information is now handed by Autoconf. ! ! Host configuration information included a definition of ! @code{XM_FILE=xm-@var{xyz}.h} and possibly definitions for @code{CC}, @code{SYSV_DEFINE}, @code{XM_CFLAGS}, @code{XM_ADD_FILES}, @code{XM_CLIBS}, @code{XM_CDEPS}, etc.; see @file{Makefile.in}. + New host only configurations do not need this file. + @item gdb/config/@var{arch}/xm-@var{xyz}.h ! This file once contained definitions and includes required when hosting ! gdb on machine @var{xyz}. Those definitions and includes are now ! handled by Autoconf. ! ! New host and native configurations do not need this file. ! ! @emph{Maintainer's note: Some hosts continue to use the @file{xm-xyz.h} ! file to define the macros @var{HOST_FLOAT_FORMAT}, ! @var{HOST_DOUBLE_FORMAT} and @var{HOST_LONG_DOUBLE_FORMAT}. That code ! also needs to be replaced with either an Autoconf or run-time test.} @end table *************** Several files control @value{GDBN}'s con *** 3770,3776 **** @table @file @vindex NATDEPFILES @item gdb/config/@var{arch}/@var{xyz}.mh ! Specifies Makefile fragments needed when hosting @emph{or native} on machine @var{xyz}. In particular, this lists the required native-dependent object files, by defining @samp{NATDEPFILES=@dots{}}. Also specifies the header file which describes native support on --- 3776,3782 ---- @table @file @vindex NATDEPFILES @item gdb/config/@var{arch}/@var{xyz}.mh ! Specifies Makefile fragments needed by a @emph{native} configuration on machine @var{xyz}. In particular, this lists the required native-dependent object files, by defining @samp{NATDEPFILES=@dots{}}. Also specifies the header file which describes native support on *************** Also specifies the header file which des *** 3778,3783 **** --- 3784,3796 ---- define @samp{NAT_CFLAGS}, @samp{NAT_ADD_FILES}, @samp{NAT_CLIBS}, @samp{NAT_CDEPS}, etc.; see @file{Makefile.in}. + @emph{Maintainer's note: The @file{.mh} suffix is because this file + originally contained @file{Makefile} fragments for hosting @value{GDBN} + on machine @var{xyz}. While the file is no longer used for this + purpose, the @file{.mh} suffix remains. Perhaphs someone will + eventually rename these fragments so that they have a @file{.mn} + suffix.} + @item gdb/config/@var{arch}/nm-@var{xyz}.h (@file{nm.h} is a link to this file, created by @code{configure}). Contains C macro definitions describing the native system environment, such as *************** your system and set @code{gdb_host} to @ *** 4752,4757 **** --- 4765,4777 ---- desired target is already available) also edit @file{gdb/configure.tgt}, setting @code{gdb_target} to something appropriate (for instance, @var{xyz}). + + @emph{Maintainer's note: Work in progress. The file + @file{gdb/configure.host} originally needed to be modified when either a + new native target or a new host machine was being added to @value{GDBN}. + Recent changes have removed this requirement. The file now only needs + to be modified when adding a new native configuration. This will likely + changed again in the future.} @item Finally, you'll need to specify and define @value{GDBN}'s host-, native-, and --------------070601040304030403020308--