Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch/rfc] Don't assume the host
@ 2002-01-15 20:44 Andrew Cagney
  2002-01-18 13:56 ` Andrew Cagney
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Cagney @ 2002-01-15 20:44 UTC (permalink / raw)
  To: gdb-patches; +Cc: mrg

[-- Attachment #1: Type: text/plain, Size: 305 bytes --]

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

[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 1255 bytes --]

2002-01-15  Andrew Cagney  <ac131313@redhat.com>

	* configure.in (host_makefile_frag): Only require a host makefile
	fragment when a native build.
	* configure: Re-generate.

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/16 04:36:34
*************** 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"
  

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [patch/rfc] Don't assume the host
  2002-01-15 20:44 [patch/rfc] Don't assume the host Andrew Cagney
@ 2002-01-18 13:56 ` Andrew Cagney
  2002-01-20  0:29   ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Cagney @ 2002-01-18 13:56 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches, mrg

[-- Attachment #1: Type: text/plain, Size: 722 bytes --]

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

[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 7351 bytes --]

2002-01-18  Andrew Cagney  <ac131313@redhat.com>

	* 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  <ac131313@redhat.com>

	* 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [patch/rfc] Don't assume the host
  2002-01-18 13:56 ` Andrew Cagney
@ 2002-01-20  0:29   ` Eli Zaretskii
  2002-01-20  9:13     ` Andrew Cagney
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2002-01-20  0:29 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches, mrg


On Fri, 18 Jan 2002, Andrew Cagney wrote:

> this time it includes updates to gdbint.texinfo (Eli?).

Approved.

> 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. 

What is that other chapter?

> + New host only configurations do not need this file.

What is a ``host only configuration''?  Is it an a.k.a. for
``native''?  I'm not sure, since you later say

> ! New host and native configurations do not need this file.

Otherwise, I have no comments.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [patch/rfc] Don't assume the host
  2002-01-20  0:29   ` Eli Zaretskii
@ 2002-01-20  9:13     ` Andrew Cagney
  2002-01-20 10:21       ` Andrew Cagney
  2002-01-20 10:25       ` Eli Zaretskii
  0 siblings, 2 replies; 8+ messages in thread
From: Andrew Cagney @ 2002-01-20  9:13 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb-patches, mrg

> On Fri, 18 Jan 2002, Andrew Cagney wrote:
> 
> 
>> this time it includes updates to gdbint.texinfo (Eli?).
> 
> 
> Approved.
> 
> 
>> 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. 
> 
> 
> What is that other chapter?


Much of ``Porting GDB'' also appears in ``Host Definition''.  The two 
could do with some rationalization.


>> + New host only configurations do not need this file.
> 
> 
> What is a ``host only configuration''?  Is it an a.k.a. for
> ``native''?  I'm not sure, since you later say


I suspect strictly speaking I've used the correct technical word but the 
usage isn't exactly mainstream.

host - the machine GDB will run on
build - the machine your compiling GDB on
target - the machine that GDB will debug

Native is a special case where host==target.
Cross is where host!=target

Adding to the problems is (as I've now documented) the way GDB uses HOST 
when it probably means NATIVE!  This one really messes up people playing 
with GDBSERVER.


>> ! New host and native configurations do not need this file.
> 
> 
> Otherwise, I have no comments.


Thanks!

Andrew


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [patch/rfc] Don't assume the host
  2002-01-20  9:13     ` Andrew Cagney
@ 2002-01-20 10:21       ` Andrew Cagney
  2002-01-20 10:25       ` Eli Zaretskii
  1 sibling, 0 replies; 8+ messages in thread
From: Andrew Cagney @ 2002-01-20 10:21 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: Eli Zaretskii, gdb-patches, mrg

> On Fri, 18 Jan 2002, Andrew Cagney wrote:
> 
> 
> this time it includes updates to gdbint.texinfo (Eli?).
> 
> 
> Approved.


Thanks.  I've checked it all in.

Andrew


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [patch/rfc] Don't assume the host
  2002-01-20  9:13     ` Andrew Cagney
  2002-01-20 10:21       ` Andrew Cagney
@ 2002-01-20 10:25       ` Eli Zaretskii
  2002-01-20 10:38         ` Andrew Cagney
  1 sibling, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2002-01-20 10:25 UTC (permalink / raw)
  To: ac131313; +Cc: gdb-patches, mrg

> Date: Sun, 20 Jan 2002 12:13:01 -0500
> From: Andrew Cagney <ac131313@cygnus.com>
> 
> Much of ``Porting GDB'' also appears in ``Host Definition''.  The two 
> could do with some rationalization.

The way I see it, "Porting GDB" is a cookbook: it should list the
necessary steps without explaining their rationale too much.  It
should refer to "Host Definition" for more info, wherever appropriate.
"Host Definition", by contrast, should explain as much as possible
each of the components of the host definition machinery.

> host - the machine GDB will run on
> build - the machine your compiling GDB on
> target - the machine that GDB will debug
> 
> Native is a special case where host==target.
> Cross is where host!=target

Yes, I know that, but I still don't understand what is ``host only''.
According to what you say now, such a beast does not exist, since
there cannot be a GDB without a target ;-)


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [patch/rfc] Don't assume the host
  2002-01-20 10:25       ` Eli Zaretskii
@ 2002-01-20 10:38         ` Andrew Cagney
  2002-01-20 10:55           ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Cagney @ 2002-01-20 10:38 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb-patches, mrg

> Date: Sun, 20 Jan 2002 12:13:01 -0500
>> From: Andrew Cagney <ac131313@cygnus.com>
>> 
>> Much of ``Porting GDB'' also appears in ``Host Definition''.  The two 
>> could do with some rationalization.
> 
> 
> The way I see it, "Porting GDB" is a cookbook: it should list the
> necessary steps without explaining their rationale too much.  It
> should refer to "Host Definition" for more info, wherever appropriate.
> "Host Definition", by contrast, should explain as much as possible
> each of the components of the host definition machinery.


Ah, ok.  Yes, that makes sense.  Should ``Porting GDB'' be moved to 
before the host, architecture and target sections (and add a native 
section?).  That way the user is lead into the other chapters.  Porting 
GDB being a brief overview.


>> host - the machine GDB will run on
>> build - the machine your compiling GDB on
>> target - the machine that GDB will debug
>> 
>> Native is a special case where host==target.
>> Cross is where host!=target
> 
> 
> Yes, I know that, but I still don't understand what is ``host only''.
> According to what you say now, such a beast does not exist, since
> there cannot be a GDB without a target ;-)


Yes.  Good point.  ``host only'' is a backward way of saying a GDB 
supporting a ``non native target''.  More to rewrite.

Andrew


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [patch/rfc] Don't assume the host
  2002-01-20 10:38         ` Andrew Cagney
@ 2002-01-20 10:55           ` Eli Zaretskii
  0 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2002-01-20 10:55 UTC (permalink / raw)
  To: ac131313; +Cc: gdb-patches, mrg

> Date: Sun, 20 Jan 2002 13:38:25 -0500
> From: Andrew Cagney <ac131313@cygnus.com>
> > 
> > The way I see it, "Porting GDB" is a cookbook: it should list the
> > necessary steps without explaining their rationale too much.  It
> > should refer to "Host Definition" for more info, wherever appropriate.
> > "Host Definition", by contrast, should explain as much as possible
> > each of the components of the host definition machinery.
> 
> Ah, ok.  Yes, that makes sense.  Should ``Porting GDB'' be moved to 
> before the host, architecture and target sections (and add a native 
> section?).  That way the user is lead into the other chapters.  Porting 
> GDB being a brief overview.

Yes, if we say in ``Porting GDB'' that it's an overview, and the other
chapters describe the stuff in more details, it would make a lot of
sense to move ``Porting GDB''.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2002-01-20 18:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-15 20:44 [patch/rfc] Don't assume the host Andrew Cagney
2002-01-18 13:56 ` Andrew Cagney
2002-01-20  0:29   ` Eli Zaretskii
2002-01-20  9:13     ` Andrew Cagney
2002-01-20 10:21       ` Andrew Cagney
2002-01-20 10:25       ` Eli Zaretskii
2002-01-20 10:38         ` Andrew Cagney
2002-01-20 10:55           ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox