Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [rfc] [0/9] Multi-target support
@ 2007-10-26  1:15 Ulrich Weigand
  2007-10-26  7:19 ` Daniel Jacobowitz
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Ulrich Weigand @ 2007-10-26  1:15 UTC (permalink / raw)
  To: gdb-patches

Hello,

as promised, here's a set of patches to provide the --enable-targets=
configure option, allowing to support multiple (remote) targets within
a single GDB executable.

The basic implementation idea is simple: now that DEPRECATED_TM_FILE
is no longer in use, the only remaining settings provided by target-
specific makefile fragments *.mt are TDEPFILES, SIM, and SIM_OBS.

The patch series moves this information from the makefile fragments
into configure.tgt itself (removing the then-obsolete concept of
per-target makefile fragments in the process).

Once we have the list of target-dependent object files available in
configure.tgt, we can simply execute that script multiple times,
once for every desired target configuration, and simply accumulate
the total set of needed object files to support all of them.

Note that other target-specific information, in particular whether
to build a simulator or the gdbserver, remains determined by the
"master" target (specified via --target), not --enable-targets.
Also, only the master target can be used as native configuration
(if applicable).  All other targets are supported as remote or
core file targets only.

I'm aware of one bug that still needs to be fixed: "info set"
crashes as show_mipsfpu_command unconditionally refers to
gdbarch_tdep (current_gdbarch), and assumes it to be formatted
as defined in mips-tdep.c.  This is of course no longer guaranteed
to be the case ...   It is certainly possible that other problems
of that sort still lurk.

I'd appreciate any feedback on the approach, and testers of
various combinations of host vs. --enable-targets=... settings
would certainly be welcome.

I've tested the full patch set with no regressions (except for
the mips issue above) with both a regular build and an 
--enable-targets=all build on each of powerpc64-linux, 
s390-ibm-linux, s390x-ibm-linux, and amd64-linux.

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


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

* Re: [rfc] [0/9] Multi-target support
  2007-10-26  1:15 [rfc] [0/9] Multi-target support Ulrich Weigand
@ 2007-10-26  7:19 ` Daniel Jacobowitz
  2007-10-30 21:54 ` [rfc] [0/9] Multi-target support: Fix show_mipsfpu_command crash Ulrich Weigand
  2007-11-17  1:08 ` [rfc] [0/9] Multi-target support Ulrich Weigand
  2 siblings, 0 replies; 15+ messages in thread
From: Daniel Jacobowitz @ 2007-10-26  7:19 UTC (permalink / raw)
  To: gdb-patches

On Fri, Oct 26, 2007 at 03:14:55AM +0200, Ulrich Weigand wrote:
> Hello,
> 
> as promised, here's a set of patches to provide the --enable-targets=
> configure option, allowing to support multiple (remote) targets within
> a single GDB executable.

Great!

I've looked over all of the patches, and saw nothing wrong with them.

-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: [rfc] [0/9] Multi-target support: Fix show_mipsfpu_command crash
  2007-10-26  1:15 [rfc] [0/9] Multi-target support Ulrich Weigand
  2007-10-26  7:19 ` Daniel Jacobowitz
@ 2007-10-30 21:54 ` Ulrich Weigand
  2007-11-17  1:08 ` [rfc] [0/9] Multi-target support Ulrich Weigand
  2 siblings, 0 replies; 15+ messages in thread
From: Ulrich Weigand @ 2007-10-30 21:54 UTC (permalink / raw)
  To: Ulrich Weigand; +Cc: gdb-patches


> I'm aware of one bug that still needs to be fixed: "info set"
> crashes as show_mipsfpu_command unconditionally refers to
> gdbarch_tdep (current_gdbarch), and assumes it to be formatted
> as defined in mips-tdep.c.  This is of course no longer guaranteed
> to be the case ...   It is certainly possible that other problems
> of that sort still lurk.

This adds a simple fix for the mips problem.  The show_mips_abi routine
already contains a check to recognize if called while the current architecture
is not mips.  This patch adds the same check to show_mipsfpu_command.

With this patch in addition to the other patches in the series, I'm able
to run the testsuite on s390x-ibm-linux using an --enable-targets=all
build with no regressions.

Bye,
Ulrich


ChangeLog:

	* mips-tdep.c (show_mipsfpu_command): Do not crash if called when
	current architecture is not MIPS.

diff -urNp gdb-orig/gdb/mips-tdep.c gdb-head/gdb/mips-tdep.c
--- gdb-orig/gdb/mips-tdep.c	2007-10-23 23:32:16.000000000 +0200
+++ gdb-head/gdb/mips-tdep.c	2007-10-30 20:16:56.403345116 +0100
@@ -4643,6 +4643,15 @@ static void
 show_mipsfpu_command (char *args, int from_tty)
 {
   char *fpu;
+
+  if (gdbarch_bfd_arch_info (current_gdbarch)->arch != bfd_arch_mips)
+    {
+      printf_unfiltered
+	("The MIPS floating-point coprocessor is unknown "
+	 "because the current architecture is not MIPS.\n");
+      return;
+    }
+
   switch (MIPS_FPU_TYPE)
     {
     case MIPS_FPU_SINGLE:


-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


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

* Re: [rfc] [0/9] Multi-target support
  2007-10-26  1:15 [rfc] [0/9] Multi-target support Ulrich Weigand
  2007-10-26  7:19 ` Daniel Jacobowitz
  2007-10-30 21:54 ` [rfc] [0/9] Multi-target support: Fix show_mipsfpu_command crash Ulrich Weigand
@ 2007-11-17  1:08 ` Ulrich Weigand
  2007-11-19 10:14   ` Pierre Muller
  2 siblings, 1 reply; 15+ messages in thread
From: Ulrich Weigand @ 2007-11-17  1:08 UTC (permalink / raw)
  To: Ulrich Weigand; +Cc: gdb-patches


> as promised, here's a set of patches to provide the --enable-targets=
> configure option, allowing to support multiple (remote) targets within
> a single GDB executable.

I've committed --enable-targets= support now, consisting of the 
original patch series, except for the old 7/9 OPENBSD_AOUT patch,
and in addition the show_mipsfpu_command crash fix from:
http://sourceware.org/ml/gdb-patches/2007-10/msg00832.html

I've also updated NEWS with the text from:
http://sourceware.org/ml/gdb-patches/2007-10/msg00711.html

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


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

* RE: [rfc] [0/9] Multi-target support
  2007-11-17  1:08 ` [rfc] [0/9] Multi-target support Ulrich Weigand
@ 2007-11-19 10:14   ` Pierre Muller
  2007-11-19 11:38     ` Ulrich Weigand
  0 siblings, 1 reply; 15+ messages in thread
From: Pierre Muller @ 2007-11-19 10:14 UTC (permalink / raw)
  To: 'Ulrich Weigand'; +Cc: gdb-patches

  I tried to compile gdb with --enable-targets=all
on cygwin and got the following failure:

gcc -c -g -O2   -I. -I../../src/gdb -I../../src/gdb/config
-DLOCALEDIR="\"/usr/l
ocal/share/locale\"" -DHAVE_CONFIG_H -I../../src/gdb/../include/opcode
-I../../s
rc/gdb/../readline/.. -I../bfd -I../../src/gdb/../bfd
-I../../src/gdb/../include
 -I../libdecnumber -I../../src/gdb/../libdecnumber   -DMI_OUT=1 -DGDBTK
-DTUI=1
 -Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral
-Wno-un
used -Wno-switch -Wno-char-subscripts -Werror ../../src/gdb/alpha-tdep.c
gcc -c -g -O2   -I. -I../../src/gdb -I../../src/gdb/config
-DLOCALEDIR="\"/usr/l
ocal/share/locale\"" -DHAVE_CONFIG_H -I../../src/gdb/../include/opcode
-I../../s
rc/gdb/../readline/.. -I../bfd -I../../src/gdb/../bfd
-I../../src/gdb/../include
 -I../libdecnumber -I../../src/gdb/../libdecnumber   -DMI_OUT=1 -DGDBTK
-DTUI=1
 -Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral
-Wno-un
used -Wno-switch -Wno-char-subscripts -Werror ../../src/gdb/amd64fbsd-tdep.c
../../src/gdb/amd64fbsd-tdep.c:89: warning: large integer implicitly
truncated t
o unsigned type
../../src/gdb/amd64fbsd-tdep.c:90: warning: large integer implicitly
truncated t
o unsigned type
make[1]: *** [amd64fbsd-tdep.o] Error 1
make[1]: Leaving directory `/usr/local/src/cvs/build-all/gdb'
make: *** [all-gdb] Error 2

The corresponding sourcelines contain 64 bit constants that are assigned to
CORE_ADDR
type. 
  Is the CORE_ADDR size changed according to the target of the current tdep
file?

Pierre


> -----Original Message-----
> From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] On Behalf Of Ulrich Weigand
> Sent: Saturday, November 17, 2007 2:08 AM
> To: Ulrich Weigand
> Cc: gdb-patches@sourceware.org
> Subject: Re: [rfc] [0/9] Multi-target support
> 
> 
> > as promised, here's a set of patches to provide the --enable-targets=
> > configure option, allowing to support multiple (remote) targets
> within
> > a single GDB executable.
> 
> I've committed --enable-targets= support now, consisting of the
> original patch series, except for the old 7/9 OPENBSD_AOUT patch,
> and in addition the show_mipsfpu_command crash fix from:
> http://sourceware.org/ml/gdb-patches/2007-10/msg00832.html
> 
> I've also updated NEWS with the text from:
> http://sourceware.org/ml/gdb-patches/2007-10/msg00711.html
> 
> Bye,
> Ulrich
> 
> --
>   Dr. Ulrich Weigand
>   GNU Toolchain for Linux on System z and Cell BE
>   Ulrich.Weigand@de.ibm.com




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

* Re: [rfc] [0/9] Multi-target support
  2007-11-19 10:14   ` Pierre Muller
@ 2007-11-19 11:38     ` Ulrich Weigand
  2007-11-19 16:35       ` Pierre Muller
  0 siblings, 1 reply; 15+ messages in thread
From: Ulrich Weigand @ 2007-11-19 11:38 UTC (permalink / raw)
  To: Pierre Muller; +Cc: gdb-patches

Pierre Muller wrote:

>   Is the CORE_ADDR size changed according to the target of the current tdep
> file?

CORE_ADDR is defined as bfd_vma, and the latter is supposed to be chosen
according to the selected targets (see the generated bfd/bfd.h file):

/* The word size used by BFD on the host.  This may be 64 with a 32
   bit target if the host is 64 bit, or if other 64 bit targets have
   been selected with --enable-targets, or if --enable-64-bit-bfd.  */
#define BFD_ARCH_SIZE 64

Not sure why this didn't work for you ...  Did you start from a clean
build directory?   Could you try whether at least explicitly specifying
--enable-64-bit-bfd works?

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


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

* RE: [rfc] [0/9] Multi-target support
  2007-11-19 11:38     ` Ulrich Weigand
@ 2007-11-19 16:35       ` Pierre Muller
  2007-11-19 17:24         ` Ulrich Weigand
  2007-11-20 22:23         ` [rfc/rft] --enable-targets=all with 32-bit BFD Ulrich Weigand
  0 siblings, 2 replies; 15+ messages in thread
From: Pierre Muller @ 2007-11-19 16:35 UTC (permalink / raw)
  To: 'Ulrich Weigand'; +Cc: gdb-patches

Yes, I started in a new directory.
mkdir build-all
cd build-all
../src/configure --enable-targets=all
make all-gdb

  I checked in bfd/bfd.h and BFD_ARCH_SIZE was set to 32
there.

  Adding --enable-64-bit-bfd I still 
needed to add WERROR_CFLAGS="" 
because I got warnings in win32-nat.c,
which implicitly assumes that CORE_ADDR
is 32 bit long.
../../src/gdb/win32-nat.c: In function `handle_output_debug_string':
../../src/gdb/win32-nat.c:884: warning: cast from pointer to integer of
different size
../../src/gdb/win32-nat.c: In function `handle_exception':
../../src/gdb/win32-nat.c:1091: warning: cast from pointer to integer of
different size
../../src/gdb/win32-nat.c: In function `win32_xfer_memory':
../../src/gdb/win32-nat.c:2068: warning: cast to pointer from integer of
different size
../../src/gdb/win32-nat.c:2071: warning: cast to pointer from integer of
different size
../../src/gdb/win32-nat.c:2077: warning: cast to pointer from integer of
different size
In win32_xfer_memory, the parameter memaddr of type CORE_ADDR
is typecasted to LPVOID as parameter of the windows API function
WriteProcessMemory, the fact that this only emits a warning probably means
that
it does the right thing, (that is, to truncate CORE_ADDR to a 32 bit value,
which is it anyhow).

  Nevertheless, without the WERROR_CFLAGS="", the build fails.

  Should all nat files be able to handle the case where
sizeof(CORE_ADDR) is strictly greater then sizeof( void *)
and do explicit conversion for that?

  I also got a problem with the m2-exp.y yacc file
conflicts: 15 shift/reduce, 15 reduce/reduce
conflicts: 5 shift/reduce
conflicts: 34 shift/reduce
/home/Pierre/gdbcvs/build-all/gdb/../../src/gdb/m2-exp.y:354.25-44: warning:
rule never reduced because of conflicts: @2: /* empty */

But after checking, this warning is also present for a simple build without
option.

Pierre
 

> -----Original Message-----
> From: Ulrich Weigand [mailto:uweigand@de.ibm.com]
> Sent: Monday, November 19, 2007 12:38 PM
> To: Pierre Muller
> Cc: gdb-patches@sourceware.org
> Subject: Re: [rfc] [0/9] Multi-target support
> 
> Pierre Muller wrote:
> 
> >   Is the CORE_ADDR size changed according to the target of the
> current tdep
> > file?
> 
> CORE_ADDR is defined as bfd_vma, and the latter is supposed to be
> chosen
> according to the selected targets (see the generated bfd/bfd.h file):
> 
> /* The word size used by BFD on the host.  This may be 64 with a 32
>    bit target if the host is 64 bit, or if other 64 bit targets have
>    been selected with --enable-targets, or if --enable-64-bit-bfd.  */
> #define BFD_ARCH_SIZE 64
> 
> Not sure why this didn't work for you ...  Did you start from a clean
> build directory?   Could you try whether at least explicitly specifying
> --enable-64-bit-bfd works?
> 
> Bye,
> Ulrich
> 
> --
>   Dr. Ulrich Weigand
>   GNU Toolchain for Linux on System z and Cell BE
>   Ulrich.Weigand@de.ibm.com




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

* Re: [rfc] [0/9] Multi-target support
  2007-11-19 16:35       ` Pierre Muller
@ 2007-11-19 17:24         ` Ulrich Weigand
  2007-11-19 17:28           ` Daniel Jacobowitz
  2007-11-20 22:23         ` [rfc/rft] --enable-targets=all with 32-bit BFD Ulrich Weigand
  1 sibling, 1 reply; 15+ messages in thread
From: Ulrich Weigand @ 2007-11-19 17:24 UTC (permalink / raw)
  To: Pierre Muller; +Cc: gdb-patches

Pierre Muller wrote:

> Yes, I started in a new directory.
> mkdir build-all
> cd build-all
> ../src/configure --enable-targets=all
> make all-gdb

OK, thanks for verifying.

>   I checked in bfd/bfd.h and BFD_ARCH_SIZE was set to 32 there.

So this looks like a bug in the --enable-target=all support:
apparently in BFD, if both host and target are 32-bit, then
--enable-target=all does not actually add support for all
targets, but only for all 32-bit targets.  If you really want
*all* targets, you have to use --enable-64-bit-bfd as well.

I guess I'll have to adapt GDB's --enable-target=all support
to follow the same rules ...

>   Adding --enable-64-bit-bfd I still needed to add WERROR_CFLAGS="" 
> because I got warnings in win32-nat.c, which implicitly assumes that
> CORE_ADDR is 32 bit long.

Now this is a bug in win32-nat.c, which would have already shown up
if you attempted to build a regular win32 -> amd64-linux (for example)
cross-debugger.

>   Should all nat files be able to handle the case where
> sizeof(CORE_ADDR) is strictly greater then sizeof( void *)
> and do explicit conversion for that?

Yes.  There should be an explicit conversion via uintptr_t (defined
in "gdb_stdint.h").  Other nat files already to that as appropriate.

>   I also got a problem with the m2-exp.y yacc file
> conflicts: 15 shift/reduce, 15 reduce/reduce
> conflicts: 5 shift/reduce
> conflicts: 34 shift/reduce
> /home/Pierre/gdbcvs/build-all/gdb/../../src/gdb/m2-exp.y:354.25-44: warning:
> rule never reduced because of conflicts: @2: /* empty */
> 
> But after checking, this warning is also present for a simple build without
> option.

Hmm, this looks like another pre-existing problem.  Unfortunately,
I'm not very familiar with yacc/bison details ...

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


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

* Re: [rfc] [0/9] Multi-target support
  2007-11-19 17:24         ` Ulrich Weigand
@ 2007-11-19 17:28           ` Daniel Jacobowitz
  2007-11-20 22:17             ` Ulrich Weigand
  0 siblings, 1 reply; 15+ messages in thread
From: Daniel Jacobowitz @ 2007-11-19 17:28 UTC (permalink / raw)
  To: Ulrich Weigand; +Cc: Pierre Muller, gdb-patches

On Mon, Nov 19, 2007 at 06:24:24PM +0100, Ulrich Weigand wrote:
> >   Adding --enable-64-bit-bfd I still needed to add WERROR_CFLAGS="" 
> > because I got warnings in win32-nat.c, which implicitly assumes that
> > CORE_ADDR is 32 bit long.
> 
> Now this is a bug in win32-nat.c, which would have already shown up
> if you attempted to build a regular win32 -> amd64-linux (for example)
> cross-debugger.

Well, no - you wouldn't get win32-nat.c in that case.  It would show
up if you build a native Windows GDB with --enable-64-bit-bfd though.

> Hmm, this looks like another pre-existing problem.  Unfortunately,
> I'm not very familiar with yacc/bison details ...

Yes, this seems to be a bug in the recently added Modula-2 support.

-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: [rfc] [0/9] Multi-target support
  2007-11-19 17:28           ` Daniel Jacobowitz
@ 2007-11-20 22:17             ` Ulrich Weigand
  0 siblings, 0 replies; 15+ messages in thread
From: Ulrich Weigand @ 2007-11-20 22:17 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: Pierre Muller, gdb-patches

Daniel Jacobowitz wrote:
> On Mon, Nov 19, 2007 at 06:24:24PM +0100, Ulrich Weigand wrote:
> > >   Adding --enable-64-bit-bfd I still needed to add WERROR_CFLAGS="" 
> > > because I got warnings in win32-nat.c, which implicitly assumes that
> > > CORE_ADDR is 32 bit long.
> > 
> > Now this is a bug in win32-nat.c, which would have already shown up
> > if you attempted to build a regular win32 -> amd64-linux (for example)
> > cross-debugger.
> 
> Well, no - you wouldn't get win32-nat.c in that case.  It would show
> up if you build a native Windows GDB with --enable-64-bit-bfd though.

You're right, of course.  Sorry for the confusion.

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


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

* [rfc/rft] --enable-targets=all with 32-bit BFD
  2007-11-19 16:35       ` Pierre Muller
  2007-11-19 17:24         ` Ulrich Weigand
@ 2007-11-20 22:23         ` Ulrich Weigand
  2007-11-21  1:01           ` Pedro Alves
  1 sibling, 1 reply; 15+ messages in thread
From: Ulrich Weigand @ 2007-11-20 22:23 UTC (permalink / raw)
  To: Pierre Muller; +Cc: gdb-patches

Pierre Muller wrote:

>   I checked in bfd/bfd.h and BFD_ARCH_SIZE was set to 32
> there.
> 
>   Adding --enable-64-bit-bfd I still 
> needed to add WERROR_CFLAGS="" 
> because I got warnings in win32-nat.c,
> which implicitly assumes that CORE_ADDR
> is 32 bit long.

Would you mind testing the following patch?  It should allow
building GDB with --enable-target=all in a 32-bit-only BFD
configuration (where CORE_ADDR is 32 bits long).

When testing this on i386-linux, I noticed another bug:
the i386_cygwin_osabi_sniffer routine claims all "elf32-i386"
files as GDB_OSABI_CYGWIN, because Cygwin apparently uses
ELF format core files.  This means that if Cygwin is 
configured as secondary target, i386-linux debugging will
fail because all ELF executables will be interpreted as
Cygwin ...

The following patch fixes this as well, by making sure that
only Cygwin core files are claimed as GDB_OSABI_CYGWIN.  The
heuristic used is to check whether a ".reg" section of the
proper size exists.  Could you verify whether Cygwin core
files are still recognized correctly with this patch?

Thanks,
Ulrich

ChangeLog:

	* Makefile.in (ALL_TARGET_OBS): Remove object files that require
	64-bit CORE_ADDR and BFD support, move them to ...
	(ALL_64_TARGET_OBS): ... this new variable.
	* configure.ac: Check for --enable-64-bit-bfd option.  Only add
	64-bit targets with --enable-targets=all if BFD supports 64-bit.
	* configure: Regenerate.

	* i386-cygwin-tdep.c (i386_cygwin_osabi_sniffer): Do not claim
	all elf32-i386 executables, only cygwin core files.


Index: gdb/Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.961
diff -c -p -r1.961 Makefile.in
*** gdb/Makefile.in	17 Nov 2007 01:02:01 -0000	1.961
--- gdb/Makefile.in	20 Nov 2007 21:44:45 -0000
*************** SIM_OBS = @SIM_OBS@
*** 431,442 ****
  # Target-dependent object files.
  TARGET_OBS = @TARGET_OBS@
  
! # All target-dependent objects files (used with --enable-targets=all).
! ALL_TARGET_OBS = \
  	alphabsd-tdep.o alphafbsd-tdep.o alpha-linux-tdep.o alpha-mdebug-tdep.o \
  	alphanbsd-tdep.o alphaobsd-tdep.o alpha-osf1-tdep.o alpha-tdep.o \
  	amd64fbsd-tdep.o amd64-linux-tdep.o amd64nbsd-tdep.o amd64obsd-tdep.o \
  	amd64-sol2-tdep.o amd64-tdep.o \
  	armbsd-tdep.o arm-linux-tdep.o armnbsd-tdep.o armobsd-tdep.o \
  	arm-tdep.o arm-wince-tdep.o \
  	avr-tdep.o \
--- 431,450 ----
  # Target-dependent object files.
  TARGET_OBS = @TARGET_OBS@
  
! # All target-dependent objects files that require 64-bit CORE_ADDR
! # (used with --enable-targets=all --enable-64-bit-bfd).
! ALL_64_TARGET_OBS = \
  	alphabsd-tdep.o alphafbsd-tdep.o alpha-linux-tdep.o alpha-mdebug-tdep.o \
  	alphanbsd-tdep.o alphaobsd-tdep.o alpha-osf1-tdep.o alpha-tdep.o \
  	amd64fbsd-tdep.o amd64-linux-tdep.o amd64nbsd-tdep.o amd64obsd-tdep.o \
  	amd64-sol2-tdep.o amd64-tdep.o \
+ 	ia64-linux-tdep.o ia64-tdep.o \
+ 	mips64obsd-tdep.o \
+ 	sparc64fbsd-tdep.o sparc64-linux-tdep.o sparc64nbsd-tdep.o \
+ 	sparc64obsd-tdep.o sparc64-sol2-tdep.o sparc64-tdep.o
+ 
+ # All other target-dependent objects files (used with --enable-targets=all).
+ ALL_TARGET_OBS = \
  	armbsd-tdep.o arm-linux-tdep.o armnbsd-tdep.o armobsd-tdep.o \
  	arm-tdep.o arm-wince-tdep.o \
  	avr-tdep.o \
*************** ALL_TARGET_OBS = \
*** 447,453 ****
  	i386bsd-tdep.o i386-cygwin-tdep.o i386fbsd-tdep.o i386gnu-tdep.o \
  	i386-linux-tdep.o i386nbsd-tdep.o i386-nto-tdep.o i386obsd-tdep.o \
  	i386-sol2-tdep.o i386-tdep.o i387-tdep.o \
- 	ia64-linux-tdep.o ia64-tdep.o \
  	iq2000-tdep.o \
  	m32c-tdep.o \
  	m32r-linux-tdep.o m32r-tdep.o \
--- 455,460 ----
*************** ALL_TARGET_OBS = \
*** 455,461 ****
  	m68kbsd-tdep.o m68klinux-tdep.o m68k-tdep.o \
  	m88k-tdep.o \
  	mep-tdep.o \
! 	mips64obsd-tdep.o mips-irix-tdep.o mips-linux-tdep.o \
  	mipsnbsd-tdep.o mips-tdep.o \
  	mn10300-linux-tdep.o mn10300-tdep.o \
  	mt-tdep.o \
--- 462,468 ----
  	m68kbsd-tdep.o m68klinux-tdep.o m68k-tdep.o \
  	m88k-tdep.o \
  	mep-tdep.o \
! 	mips-irix-tdep.o mips-linux-tdep.o \
  	mipsnbsd-tdep.o mips-tdep.o \
  	mn10300-linux-tdep.o mn10300-tdep.o \
  	mt-tdep.o \
*************** ALL_TARGET_OBS = \
*** 465,472 ****
  	s390-tdep.o \
  	score-tdep.o \
  	sh64-tdep.o sh-linux-tdep.o shnbsd-tdep.o sh-tdep.o \
- 	sparc64fbsd-tdep.o sparc64-linux-tdep.o sparc64nbsd-tdep.o \
- 	sparc64obsd-tdep.o sparc64-sol2-tdep.o sparc64-tdep.o \
  	sparc-linux-tdep.o sparcnbsd-tdep.o sparcobsd-tdep.o \
  	sparc-sol2-tdep.o sparc-tdep.o \
  	spu-tdep.o \
--- 472,477 ----
Index: gdb/configure
===================================================================
RCS file: /cvs/src/src/gdb/configure,v
retrieving revision 1.239
diff -c -p -r1.239 configure
*** gdb/configure	17 Nov 2007 01:02:01 -0000	1.239
--- gdb/configure	20 Nov 2007 21:44:47 -0000
*************** Optional Features:
*** 861,866 ****
--- 861,867 ----
    --enable-maintainer-mode  enable make rules and dependencies not useful
  			  (and sometimes confusing) to the casual installer
    --enable-targets        alternative target configurations
+   --enable-64-bit-bfd     64-bit support (on hosts with narrower word sizes)
    --disable-gdbcli        disable command-line interface (CLI)
    --disable-gdbmi         disable machine-interface (MI)
    --enable-tui            enable full-screen terminal user interface (TUI)
*************** echo "$as_me: error: enable-targets opti
*** 3095,3100 ****
--- 3096,3115 ----
  esac
  fi;
  
+ # Check whether to enable 64-bit support on 32-bit hosts
+ # Check whether --enable-64-bit-bfd or --disable-64-bit-bfd was given.
+ if test "${enable_64_bit_bfd+set}" = set; then
+   enableval="$enable_64_bit_bfd"
+   case "${enableval}" in
+   yes)  want64=true  ;;
+   no)   want64=false ;;
+   *)    { { echo "$as_me:$LINENO: error: bad value ${enableval} for 64-bit-bfd option" >&5
+ echo "$as_me: error: bad value ${enableval} for 64-bit-bfd option" >&2;}
+    { (exit 1); exit 1; }; } ;;
+ esac
+ else
+   want64=false
+ fi;
  # Provide defaults for some variables set by the per-host and per-target
  # configuration.
  gdb_host_obs=posix-hdep.o
*************** do
*** 3136,3291 ****
            ;;
          esac
      done
    fi
  done
  
  if test x${all_targets} = xtrue; then
-   TARGET_OBS='$(ALL_TARGET_OBS)'
- fi
- 
- 
- 
- # For other settings, only the main target counts.
- gdb_sim=
- gdb_osabi=
- build_gdbserver=
- targ=$target; . ${srcdir}/configure.tgt
- 
- # Fetch the default architecture and default target vector from BFD.
- targ=$target; . $srcdir/../bfd/config.bfd
- 
- # We only want the first architecture, so strip off the others if
- # there is more than one.
- targ_archs=`echo $targ_archs | sed 's/ .*//'`
- 
- if test "x$targ_archs" != x; then
- 
- cat >>confdefs.h <<_ACEOF
- #define DEFAULT_BFD_ARCH $targ_archs
- _ACEOF
- 
- fi
- if test "x$targ_defvec" != x; then
- 
- cat >>confdefs.h <<_ACEOF
- #define DEFAULT_BFD_VEC $targ_defvec
- _ACEOF
- 
- fi
- 
- test "$program_prefix" != NONE &&
-   program_transform_name="s,^,$program_prefix,;$program_transform_name"
- # Use a double $ so make ignores it.
- test "$program_suffix" != NONE &&
-   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
- # Double any \ or $.  echo might interpret backslashes.
- # By default was `s,x,x', remove it if useless.
- cat <<\_ACEOF >conftest.sed
- s/[\\$]/&&/g;s/;s,x,x,$//
- _ACEOF
- program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
- rm conftest.sed
- 
- 
- # The CLI cannot be disabled yet, but may be in the future.
- 
- # Enable CLI.
- # Check whether --enable-gdbcli or --disable-gdbcli was given.
- if test "${enable_gdbcli+set}" = set; then
-   enableval="$enable_gdbcli"
-   case $enableval in
-     yes)
-       ;;
-     no)
-       { { echo "$as_me:$LINENO: error: the command-line interface cannot be disabled yet" >&5
- echo "$as_me: error: the command-line interface cannot be disabled yet" >&2;}
-    { (exit 1); exit 1; }; } ;;
-     *)
-       { { echo "$as_me:$LINENO: error: bad value $enableval for --enable-gdbcli" >&5
- echo "$as_me: error: bad value $enableval for --enable-gdbcli" >&2;}
-    { (exit 1); exit 1; }; } ;;
-   esac
- else
-   enable_gdbcli=yes
- fi;
- if test x"$enable_gdbcli" = xyes; then
-   if test -d $srcdir/cli; then
-     CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_CLI_OBS)"
-     CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_CLI_DEPS)"
-     CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_CLI_SRCS)"
-     ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_CLI_CFLAGS)"
-   fi
- fi
- 
- # Enable MI.
- # Check whether --enable-gdbmi or --disable-gdbmi was given.
- if test "${enable_gdbmi+set}" = set; then
-   enableval="$enable_gdbmi"
-   case $enableval in
-     yes | no)
-       ;;
-     *)
-       { { echo "$as_me:$LINENO: error: bad value $enableval for --enable-gdbmi" >&5
- echo "$as_me: error: bad value $enableval for --enable-gdbmi" >&2;}
-    { (exit 1); exit 1; }; } ;;
-   esac
- else
-   enable_gdbmi=yes
- fi;
- if test x"$enable_gdbmi" = xyes; then
-   if test -d $srcdir/mi; then
-     CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_MI_OBS)"
-     CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_MI_DEPS)"
-     CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_MI_SRCS)"
-     ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_MI_CFLAGS)"
-   fi
- fi
- 
- # Enable TUI.
- # Check whether --enable-tui or --disable-tui was given.
- if test "${enable_tui+set}" = set; then
-   enableval="$enable_tui"
-   case $enableval in
-     yes | no)
-       ;;
-     *)
-       { { echo "$as_me:$LINENO: error: bad value $enableval for --enable-tui" >&5
- echo "$as_me: error: bad value $enableval for --enable-tui" >&2;}
-    { (exit 1); exit 1; }; } ;;
-   esac
- else
-   enable_tui=yes
- fi;
  
! # Enable gdbtk.
! # Check whether --enable-gdbtk or --disable-gdbtk was given.
! if test "${enable_gdbtk+set}" = set; then
!   enableval="$enable_gdbtk"
!   case $enableval in
!     yes | no)
!       ;;
!     *)
!       { { echo "$as_me:$LINENO: error: bad value $enableval for --enable-gdbtk" >&5
! echo "$as_me: error: bad value $enableval for --enable-gdbtk" >&2;}
!    { (exit 1); exit 1; }; } ;;
!   esac
! else
!   if test -d $srcdir/gdbtk -a -d $srcdir/../itcl; then
!     enable_gdbtk=yes
!   else
!     enable_gdbtk=no
!   fi
! fi;
! # We unconditionally disable gdbtk tests on selected platforms.
! case $host_os in
!   go32* | windows*)
!     { echo "$as_me:$LINENO: WARNING: gdbtk isn't supported on $host; disabling" >&5
! echo "$as_me: WARNING: gdbtk isn't supported on $host; disabling" >&2;}
!     enable_gdbtk=no ;;
! esac
  
! # Libunwind support.
! echo "$as_me:$LINENO: checking for ANSI C header files" >&5
  echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
  if test "${ac_cv_header_stdc+set}" = set; then
    echo $ECHO_N "(cached) $ECHO_C" >&6
--- 3151,3177 ----
            ;;
          esac
      done
+ 
+     # Check whether this target needs 64-bit CORE_ADDR
+     if test x${want64} = xfalse; then
+       . ${srcdir}/../bfd/config.bfd
+     fi
    fi
  done
  
  if test x${all_targets} = xtrue; then
  
!   # We want all 64-bit targets if we either:
!   #  - run on a 64-bit host  or
!   #  - already require 64-bit support for some other target  or
!   #  - the --enable-64-bit-bfd option was supplied
!   # Otherwise we only support all 32-bit targets.
!   #
!   # NOTE: This test must be in sync with the corresponding
!   #       tests in BFD!
  
!   if test x${want64} = xfalse; then
!     echo "$as_me:$LINENO: checking for ANSI C header files" >&5
  echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
  if test "${ac_cv_header_stdc+set}" = set; then
    echo $ECHO_N "(cached) $ECHO_C" >&6
*************** fi
*** 3523,3528 ****
--- 3409,3981 ----
  done
  
  
+ echo "$as_me:$LINENO: checking for long" >&5
+ echo $ECHO_N "checking for long... $ECHO_C" >&6
+ if test "${ac_cv_type_long+set}" = set; then
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h.  */
+ $ac_includes_default
+ int
+ main ()
+ {
+ if ((long *) 0)
+   return 0;
+ if (sizeof (long))
+   return 0;
+   ;
+   return 0;
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+   (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
+   grep -v '^ *+' conftest.er1 >conftest.err
+   rm -f conftest.er1
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+ 	 { ac_try='test -z "$ac_c_werror_flag"
+ 			 || test ! -s conftest.err'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }; } &&
+ 	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }; }; then
+   ac_cv_type_long=yes
+ else
+   echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+ ac_cv_type_long=no
+ fi
+ rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5
+ echo "${ECHO_T}$ac_cv_type_long" >&6
+ 
+ echo "$as_me:$LINENO: checking size of long" >&5
+ echo $ECHO_N "checking size of long... $ECHO_C" >&6
+ if test "${ac_cv_sizeof_long+set}" = set; then
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   if test "$ac_cv_type_long" = yes; then
+   # The cast to unsigned long works around a bug in the HP C Compiler
+   # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+   # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+   # This bug is HP SR number 8606223364.
+   if test "$cross_compiling" = yes; then
+   # Depending upon the size, compute the lo and hi bounds.
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h.  */
+ $ac_includes_default
+ int
+ main ()
+ {
+ static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)];
+ test_array [0] = 0
+ 
+   ;
+   return 0;
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+   (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
+   grep -v '^ *+' conftest.er1 >conftest.err
+   rm -f conftest.er1
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+ 	 { ac_try='test -z "$ac_c_werror_flag"
+ 			 || test ! -s conftest.err'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }; } &&
+ 	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }; }; then
+   ac_lo=0 ac_mid=0
+   while :; do
+     cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h.  */
+ $ac_includes_default
+ int
+ main ()
+ {
+ static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
+ test_array [0] = 0
+ 
+   ;
+   return 0;
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+   (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
+   grep -v '^ *+' conftest.er1 >conftest.err
+   rm -f conftest.er1
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+ 	 { ac_try='test -z "$ac_c_werror_flag"
+ 			 || test ! -s conftest.err'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }; } &&
+ 	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }; }; then
+   ac_hi=$ac_mid; break
+ else
+   echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+ ac_lo=`expr $ac_mid + 1`
+ 		    if test $ac_lo -le $ac_mid; then
+ 		      ac_lo= ac_hi=
+ 		      break
+ 		    fi
+ 		    ac_mid=`expr 2 '*' $ac_mid + 1`
+ fi
+ rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+   done
+ else
+   echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h.  */
+ $ac_includes_default
+ int
+ main ()
+ {
+ static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)];
+ test_array [0] = 0
+ 
+   ;
+   return 0;
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+   (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
+   grep -v '^ *+' conftest.er1 >conftest.err
+   rm -f conftest.er1
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+ 	 { ac_try='test -z "$ac_c_werror_flag"
+ 			 || test ! -s conftest.err'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }; } &&
+ 	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }; }; then
+   ac_hi=-1 ac_mid=-1
+   while :; do
+     cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h.  */
+ $ac_includes_default
+ int
+ main ()
+ {
+ static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)];
+ test_array [0] = 0
+ 
+   ;
+   return 0;
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+   (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
+   grep -v '^ *+' conftest.er1 >conftest.err
+   rm -f conftest.er1
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+ 	 { ac_try='test -z "$ac_c_werror_flag"
+ 			 || test ! -s conftest.err'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }; } &&
+ 	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }; }; then
+   ac_lo=$ac_mid; break
+ else
+   echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+ ac_hi=`expr '(' $ac_mid ')' - 1`
+ 		       if test $ac_mid -le $ac_hi; then
+ 			 ac_lo= ac_hi=
+ 			 break
+ 		       fi
+ 		       ac_mid=`expr 2 '*' $ac_mid`
+ fi
+ rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+   done
+ else
+   echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+ ac_lo= ac_hi=
+ fi
+ rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ # Binary search between lo and hi bounds.
+ while test "x$ac_lo" != "x$ac_hi"; do
+   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+   cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h.  */
+ $ac_includes_default
+ int
+ main ()
+ {
+ static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
+ test_array [0] = 0
+ 
+   ;
+   return 0;
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+   (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
+   grep -v '^ *+' conftest.er1 >conftest.err
+   rm -f conftest.er1
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+ 	 { ac_try='test -z "$ac_c_werror_flag"
+ 			 || test ! -s conftest.err'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }; } &&
+ 	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }; }; then
+   ac_hi=$ac_mid
+ else
+   echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+ ac_lo=`expr '(' $ac_mid ')' + 1`
+ fi
+ rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+ case $ac_lo in
+ ?*) ac_cv_sizeof_long=$ac_lo;;
+ '') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77
+ See \`config.log' for more details." >&5
+ echo "$as_me: error: cannot compute sizeof (long), 77
+ See \`config.log' for more details." >&2;}
+    { (exit 1); exit 1; }; } ;;
+ esac
+ else
+   if test "$cross_compiling" = yes; then
+   { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+ See \`config.log' for more details." >&5
+ echo "$as_me: error: cannot run test program while cross compiling
+ See \`config.log' for more details." >&2;}
+    { (exit 1); exit 1; }; }
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h.  */
+ $ac_includes_default
+ long longval () { return (long) (sizeof (long)); }
+ unsigned long ulongval () { return (long) (sizeof (long)); }
+ #include <stdio.h>
+ #include <stdlib.h>
+ int
+ main ()
+ {
+ 
+   FILE *f = fopen ("conftest.val", "w");
+   if (! f)
+     exit (1);
+   if (((long) (sizeof (long))) < 0)
+     {
+       long i = longval ();
+       if (i != ((long) (sizeof (long))))
+ 	exit (1);
+       fprintf (f, "%ld\n", i);
+     }
+   else
+     {
+       unsigned long i = ulongval ();
+       if (i != ((long) (sizeof (long))))
+ 	exit (1);
+       fprintf (f, "%lu\n", i);
+     }
+   exit (ferror (f) || fclose (f) != 0);
+ 
+   ;
+   return 0;
+ }
+ _ACEOF
+ rm -f conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+   (eval $ac_link) 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }; }; then
+   ac_cv_sizeof_long=`cat conftest.val`
+ else
+   echo "$as_me: program exited with status $ac_status" >&5
+ echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+ ( exit $ac_status )
+ { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77
+ See \`config.log' for more details." >&5
+ echo "$as_me: error: cannot compute sizeof (long), 77
+ See \`config.log' for more details." >&2;}
+    { (exit 1); exit 1; }; }
+ fi
+ rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+ fi
+ fi
+ rm -f conftest.val
+ else
+   ac_cv_sizeof_long=0
+ fi
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
+ echo "${ECHO_T}$ac_cv_sizeof_long" >&6
+ cat >>confdefs.h <<_ACEOF
+ #define SIZEOF_LONG $ac_cv_sizeof_long
+ _ACEOF
+ 
+ 
+     if test "x${ac_cv_sizeof_long}" = "x8"; then
+       want64=true
+     fi
+   fi
+   if test x${want64} = xtrue; then
+     TARGET_OBS='$(ALL_TARGET_OBS) $(ALL_64_TARGET_OBS)'
+   else
+     TARGET_OBS='$(ALL_TARGET_OBS)'
+   fi
+ fi
+ 
+ 
+ 
+ # For other settings, only the main target counts.
+ gdb_sim=
+ gdb_osabi=
+ build_gdbserver=
+ targ=$target; . ${srcdir}/configure.tgt
+ 
+ # Fetch the default architecture and default target vector from BFD.
+ targ=$target; . $srcdir/../bfd/config.bfd
+ 
+ # We only want the first architecture, so strip off the others if
+ # there is more than one.
+ targ_archs=`echo $targ_archs | sed 's/ .*//'`
+ 
+ if test "x$targ_archs" != x; then
+ 
+ cat >>confdefs.h <<_ACEOF
+ #define DEFAULT_BFD_ARCH $targ_archs
+ _ACEOF
+ 
+ fi
+ if test "x$targ_defvec" != x; then
+ 
+ cat >>confdefs.h <<_ACEOF
+ #define DEFAULT_BFD_VEC $targ_defvec
+ _ACEOF
+ 
+ fi
+ 
+ test "$program_prefix" != NONE &&
+   program_transform_name="s,^,$program_prefix,;$program_transform_name"
+ # Use a double $ so make ignores it.
+ test "$program_suffix" != NONE &&
+   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
+ # Double any \ or $.  echo might interpret backslashes.
+ # By default was `s,x,x', remove it if useless.
+ cat <<\_ACEOF >conftest.sed
+ s/[\\$]/&&/g;s/;s,x,x,$//
+ _ACEOF
+ program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
+ rm conftest.sed
+ 
+ 
+ # The CLI cannot be disabled yet, but may be in the future.
+ 
+ # Enable CLI.
+ # Check whether --enable-gdbcli or --disable-gdbcli was given.
+ if test "${enable_gdbcli+set}" = set; then
+   enableval="$enable_gdbcli"
+   case $enableval in
+     yes)
+       ;;
+     no)
+       { { echo "$as_me:$LINENO: error: the command-line interface cannot be disabled yet" >&5
+ echo "$as_me: error: the command-line interface cannot be disabled yet" >&2;}
+    { (exit 1); exit 1; }; } ;;
+     *)
+       { { echo "$as_me:$LINENO: error: bad value $enableval for --enable-gdbcli" >&5
+ echo "$as_me: error: bad value $enableval for --enable-gdbcli" >&2;}
+    { (exit 1); exit 1; }; } ;;
+   esac
+ else
+   enable_gdbcli=yes
+ fi;
+ if test x"$enable_gdbcli" = xyes; then
+   if test -d $srcdir/cli; then
+     CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_CLI_OBS)"
+     CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_CLI_DEPS)"
+     CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_CLI_SRCS)"
+     ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_CLI_CFLAGS)"
+   fi
+ fi
+ 
+ # Enable MI.
+ # Check whether --enable-gdbmi or --disable-gdbmi was given.
+ if test "${enable_gdbmi+set}" = set; then
+   enableval="$enable_gdbmi"
+   case $enableval in
+     yes | no)
+       ;;
+     *)
+       { { echo "$as_me:$LINENO: error: bad value $enableval for --enable-gdbmi" >&5
+ echo "$as_me: error: bad value $enableval for --enable-gdbmi" >&2;}
+    { (exit 1); exit 1; }; } ;;
+   esac
+ else
+   enable_gdbmi=yes
+ fi;
+ if test x"$enable_gdbmi" = xyes; then
+   if test -d $srcdir/mi; then
+     CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_MI_OBS)"
+     CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_MI_DEPS)"
+     CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_MI_SRCS)"
+     ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_MI_CFLAGS)"
+   fi
+ fi
+ 
+ # Enable TUI.
+ # Check whether --enable-tui or --disable-tui was given.
+ if test "${enable_tui+set}" = set; then
+   enableval="$enable_tui"
+   case $enableval in
+     yes | no)
+       ;;
+     *)
+       { { echo "$as_me:$LINENO: error: bad value $enableval for --enable-tui" >&5
+ echo "$as_me: error: bad value $enableval for --enable-tui" >&2;}
+    { (exit 1); exit 1; }; } ;;
+   esac
+ else
+   enable_tui=yes
+ fi;
+ 
+ # Enable gdbtk.
+ # Check whether --enable-gdbtk or --disable-gdbtk was given.
+ if test "${enable_gdbtk+set}" = set; then
+   enableval="$enable_gdbtk"
+   case $enableval in
+     yes | no)
+       ;;
+     *)
+       { { echo "$as_me:$LINENO: error: bad value $enableval for --enable-gdbtk" >&5
+ echo "$as_me: error: bad value $enableval for --enable-gdbtk" >&2;}
+    { (exit 1); exit 1; }; } ;;
+   esac
+ else
+   if test -d $srcdir/gdbtk -a -d $srcdir/../itcl; then
+     enable_gdbtk=yes
+   else
+     enable_gdbtk=no
+   fi
+ fi;
+ # We unconditionally disable gdbtk tests on selected platforms.
+ case $host_os in
+   go32* | windows*)
+     { echo "$as_me:$LINENO: WARNING: gdbtk isn't supported on $host; disabling" >&5
+ echo "$as_me: WARNING: gdbtk isn't supported on $host; disabling" >&2;}
+     enable_gdbtk=no ;;
+ esac
+ 
+ # Libunwind support.
  
  # Check whether --with-libunwind or --without-libunwind was given.
  if test "${with_libunwind+set}" = set; then
Index: gdb/configure.ac
===================================================================
RCS file: /cvs/src/src/gdb/configure.ac,v
retrieving revision 1.61
diff -c -p -r1.61 configure.ac
*** gdb/configure.ac	17 Nov 2007 01:02:01 -0000	1.61
--- gdb/configure.ac	20 Nov 2007 21:44:47 -0000
*************** AC_ARG_ENABLE(targets,
*** 101,106 ****
--- 101,115 ----
    *)        enable_targets=$enableval ;;
  esac])
  
+ # Check whether to enable 64-bit support on 32-bit hosts
+ AC_ARG_ENABLE(64-bit-bfd,
+ [  --enable-64-bit-bfd     64-bit support (on hosts with narrower word sizes)],
+ [case "${enableval}" in
+   yes)  want64=true  ;;
+   no)   want64=false ;;
+   *)    AC_MSG_ERROR(bad value ${enableval} for 64-bit-bfd option) ;;
+ esac],[want64=false])dnl
+ 
  # Provide defaults for some variables set by the per-host and per-target
  # configuration.
  gdb_host_obs=posix-hdep.o
*************** do
*** 142,152 ****
            ;;
          esac
      done
    fi
  done
  
  if test x${all_targets} = xtrue; then
!   TARGET_OBS='$(ALL_TARGET_OBS)'
  fi
  
  AC_SUBST(TARGET_OBS)
--- 151,186 ----
            ;;
          esac
      done
+ 
+     # Check whether this target needs 64-bit CORE_ADDR
+     if test x${want64} = xfalse; then
+       . ${srcdir}/../bfd/config.bfd
+     fi
    fi
  done
  
  if test x${all_targets} = xtrue; then
! 
!   # We want all 64-bit targets if we either:
!   #  - run on a 64-bit host  or
!   #  - already require 64-bit support for some other target  or
!   #  - the --enable-64-bit-bfd option was supplied
!   # Otherwise we only support all 32-bit targets.
!   #
!   # NOTE: This test must be in sync with the corresponding
!   #       tests in BFD!
! 
!   if test x${want64} = xfalse; then
!     AC_CHECK_SIZEOF(long)
!     if test "x${ac_cv_sizeof_long}" = "x8"; then
!       want64=true
!     fi
!   fi
!   if test x${want64} = xtrue; then
!     TARGET_OBS='$(ALL_TARGET_OBS) $(ALL_64_TARGET_OBS)'
!   else
!     TARGET_OBS='$(ALL_TARGET_OBS)'
!   fi
  fi
  
  AC_SUBST(TARGET_OBS)
Index: gdb/i386-cygwin-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-cygwin-tdep.c,v
retrieving revision 1.14
diff -c -p -r1.14 i386-cygwin-tdep.c
*** gdb/i386-cygwin-tdep.c	24 Oct 2007 21:16:30 -0000	1.14
--- gdb/i386-cygwin-tdep.c	20 Nov 2007 21:44:47 -0000
*************** i386_cygwin_osabi_sniffer (bfd *abfd)
*** 252,260 ****
    if (strcmp (target_name, "pei-i386") == 0)
      return GDB_OSABI_CYGWIN;
  
!   /* Cygwin uses elf core dumps.  */
    if (strcmp (target_name, "elf32-i386") == 0)
!     return GDB_OSABI_CYGWIN;
  
    return GDB_OSABI_UNKNOWN;
  }
--- 252,266 ----
    if (strcmp (target_name, "pei-i386") == 0)
      return GDB_OSABI_CYGWIN;
  
!   /* Cygwin uses elf core dumps.  Do not claim all ELF executables,
!      check whether there is a .reg section of proper size.  */
    if (strcmp (target_name, "elf32-i386") == 0)
!     {
!       asection *section = bfd_get_section_by_name (abfd, ".reg");
!       if (section
! 	  && bfd_section_size (abfd, section) == I386_WIN32_SIZEOF_GREGSET)
! 	return GDB_OSABI_CYGWIN;
!     }
  
    return GDB_OSABI_UNKNOWN;
  }

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


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

* Re: [rfc/rft] --enable-targets=all with 32-bit BFD
  2007-11-20 22:23         ` [rfc/rft] --enable-targets=all with 32-bit BFD Ulrich Weigand
@ 2007-11-21  1:01           ` Pedro Alves
  2007-11-26 15:30             ` Ulrich Weigand
  0 siblings, 1 reply; 15+ messages in thread
From: Pedro Alves @ 2007-11-21  1:01 UTC (permalink / raw)
  To: Ulrich Weigand; +Cc: Pierre Muller, gdb-patches

Hi Ulrich, Pierre,

Ulrich Weigand wrote:

> When testing this on i386-linux, I noticed another bug:
> the i386_cygwin_osabi_sniffer routine claims all "elf32-i386"
> files as GDB_OSABI_CYGWIN, because Cygwin apparently uses
> ELF format core files.  This means that if Cygwin is 
> configured as secondary target, i386-linux debugging will
> fail because all ELF executables will be interpreted as
> Cygwin ...
> 
> The following patch fixes this as well, by making sure that
> only Cygwin core files are claimed as GDB_OSABI_CYGWIN.  The
> heuristic used is to check whether a ".reg" section of the
> proper size exists.  Could you verify whether Cygwin core
> files are still recognized correctly with this patch?
> 

At least on my machine this requires dumper.exe (the
tool that produces cygwin core dumps) from HEAD.
Since I've written the original problem (wasn't really a
problem then :-) ), if Pierre doesn't have a Cygwin HEAD
build handy, I'll try to test that part of the patch
tomorrow or the day after.

-- 
Pedro Alves


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

* Re: [rfc/rft] --enable-targets=all with 32-bit BFD
  2007-11-21  1:01           ` Pedro Alves
@ 2007-11-26 15:30             ` Ulrich Weigand
  2007-11-27  3:00               ` Pedro Alves
  0 siblings, 1 reply; 15+ messages in thread
From: Ulrich Weigand @ 2007-11-26 15:30 UTC (permalink / raw)
  To: Pedro Alves; +Cc: Pierre Muller, gdb-patches

Hi Pedro,

> Ulrich Weigand wrote:
> > The following patch fixes this as well, by making sure that
> > only Cygwin core files are claimed as GDB_OSABI_CYGWIN.  The
> > heuristic used is to check whether a ".reg" section of the
> > proper size exists.  Could you verify whether Cygwin core
> > files are still recognized correctly with this patch?
> 
> At least on my machine this requires dumper.exe (the
> tool that produces cygwin core dumps) from HEAD.
> Since I've written the original problem (wasn't really a
> problem then :-) ), if Pierre doesn't have a Cygwin HEAD
> build handy, I'll try to test that part of the patch
> tomorrow or the day after.

Thanks for the offer; I'd appreciate if you could do that test!

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


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

* Re: [rfc/rft] --enable-targets=all with 32-bit BFD
  2007-11-26 15:30             ` Ulrich Weigand
@ 2007-11-27  3:00               ` Pedro Alves
  2007-11-27 17:08                 ` Ulrich Weigand
  0 siblings, 1 reply; 15+ messages in thread
From: Pedro Alves @ 2007-11-27  3:00 UTC (permalink / raw)
  To: Ulrich Weigand; +Cc: Pierre Muller, gdb-patches

Hi Ulrich,

Sorry for the delay,

Ulrich Weigand wrote:
> Hi Pedro,
> 
>> Ulrich Weigand wrote:
>>> The following patch fixes this as well, by making sure that
>>> only Cygwin core files are claimed as GDB_OSABI_CYGWIN.  The
>>> heuristic used is to check whether a ".reg" section of the
>>> proper size exists.  Could you verify whether Cygwin core
>>> files are still recognized corwrectly with this patch?
>> At least on my machine this requires dumper.exe (the
>> tool that produces cygwin core dumps) from HEAD.
>> Since I've written the original problem (wasn't really a
>> problem then :-) ), if Pierre doesn't have a Cygwin HEAD
>> build handy, I'll try to test that part of the patch
>> tomorrow or the day after.
> 
> Thanks for the offer; I'd appreciate if you could do that test!
> 

Just did.

Recognizing Cygwin core file still works fine from both
i686-pc-cygwin and i686-pc-linux-gnu with that hunk
applied.

-- 
Pedro Alves


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

* Re: [rfc/rft] --enable-targets=all with 32-bit BFD
  2007-11-27  3:00               ` Pedro Alves
@ 2007-11-27 17:08                 ` Ulrich Weigand
  0 siblings, 0 replies; 15+ messages in thread
From: Ulrich Weigand @ 2007-11-27 17:08 UTC (permalink / raw)
  To: Pedro Alves; +Cc: Pierre Muller, gdb-patches

Hi Pedro,

> Just did.
> 
> Recognizing Cygwin core file still works fine from both
> i686-pc-cygwin and i686-pc-linux-gnu with that hunk
> applied.

Thank you very much!  I've now checked the patch in.

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


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

end of thread, other threads:[~2007-11-27 17:08 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-26  1:15 [rfc] [0/9] Multi-target support Ulrich Weigand
2007-10-26  7:19 ` Daniel Jacobowitz
2007-10-30 21:54 ` [rfc] [0/9] Multi-target support: Fix show_mipsfpu_command crash Ulrich Weigand
2007-11-17  1:08 ` [rfc] [0/9] Multi-target support Ulrich Weigand
2007-11-19 10:14   ` Pierre Muller
2007-11-19 11:38     ` Ulrich Weigand
2007-11-19 16:35       ` Pierre Muller
2007-11-19 17:24         ` Ulrich Weigand
2007-11-19 17:28           ` Daniel Jacobowitz
2007-11-20 22:17             ` Ulrich Weigand
2007-11-20 22:23         ` [rfc/rft] --enable-targets=all with 32-bit BFD Ulrich Weigand
2007-11-21  1:01           ` Pedro Alves
2007-11-26 15:30             ` Ulrich Weigand
2007-11-27  3:00               ` Pedro Alves
2007-11-27 17:08                 ` Ulrich Weigand

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