Re: Building today's snapshot of GDB with MinGW

Eli Zaretskii
2020-07-02T17:46:21Z

> Cc: tromey@adacore.com, brobecker@adacore.com, gdb-patches@sourceware.org
> From: Pedro Alves <pedro@palves.net>
> Date: Thu, 2 Jul 2020 15:40:20 +0100
>
> > 290 i[34567]86-*-linux*)
> > 291 # Target: Intel 386 running GNU/Linux
> > 292 gdb_target_obs="i386-linux-tdep.o \
> > 293 glibc-tdep.o \
> > 294 solib-svr4.o symfile-mem.o \
> > 295 linux-tdep.o linux-record.o"
> > 296 if test "x$enable_64_bit_bfd" = "xyes"; then
> > 297 # Target: GNU/Linux x86-64
> > 298 gdb_target_obs="amd64-linux-tdep.o ${gdb_target_obs}"
> > 299 fi
> > 300 ;;
> >
>
> This is so a i686-linux-gnu hosted toolchain works with 64-bit binaries.
> There are vendors who prefer (or used to prefer, time has passed
> and don't know if that's still a thing) it that way, as it's a single
> build for 32-bit and 64-bit hosts that way. Users can then build
> 64-bit apps with e.g., "i686-unknown-linux-gnu-gcc -m64". Naturally,
> the debugger follows suit (though that's only useful for cross debugging,
> since for native debugging 64-bit inferiors, you need a 64-bit debugger).

Thanks.

AFAIK, this is impossible on Windows: a 64-bit debugger can debug
32-bit programs (and I think GDB recently learned how to do that), but
a 32-bit debugger cannot debug 64-bit programs.