RE: [rfc] [0/9] Multi-target support

Pierre Muller
2007-11-19T16:35:20Z

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